Bug 1298588 part 13. Make sure Device has a ComputedValues for stylo. r=bholley

This commit is contained in:
Boris Zbarsky 2017-01-04 13:55:05 -05:00
parent 62961370ec
commit 369fdddcd9
5 changed files with 54 additions and 21 deletions

View file

@ -8,6 +8,7 @@ use euclid::size::Size2D;
use media_queries::CSSErrorReporterTest;
use std::f32::consts::PI;
use style::parser::ParserContext;
use style::properties::ComputedValues;
use style::stylesheets::Origin;
use style::values::computed;
use style::values::computed::{Angle, Context, ToComputedValue};
@ -43,7 +44,14 @@ fn test_linear_gradient() {
// Note that Angle(PI) is correct for top-to-bottom rendering, whereas Angle(0) would render bottom-to-top.
// ref: https://developer.mozilla.org/en-US/docs/Web/CSS/angle
let container = Size2D::new(Au::default(), Au::default());
let specified_context = Context::initial(container, true);
let initial_style = ComputedValues::initial_values();
let specified_context = Context {
is_root_element: true,
viewport_size: container,
inherited_style: initial_style,
style: initial_style.clone(),
font_metrics_provider: None,
};
assert_eq!(specified::AngleOrCorner::None.to_computed_value(&specified_context),
computed::AngleOrCorner::Angle(Angle(PI)));
}