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

@ -62,20 +62,6 @@ impl<'a> Context<'a> {
pub fn style(&self) -> &ComputedValues { &self.style }
/// A mutable reference to the current style.
pub fn mutate_style(&mut self) -> &mut ComputedValues { &mut self.style }
/// Creates a dummy computed context for use in multiple places, like
/// evaluating media queries.
pub fn initial(viewport_size: Size2D<Au>, is_root_element: bool) -> Self {
let initial_style = ComputedValues::initial_values();
// FIXME: Enforce a font metrics provider.
Context {
is_root_element: is_root_element,
viewport_size: viewport_size,
inherited_style: initial_style,
style: initial_style.clone(),
font_metrics_provider: None,
}
}
}
/// A trait to represent the conversion between computed and specified values.