style: Introduce a generic way of gathering information from the cascade, and use it for viewport units.

This commit is contained in:
Emilio Cobos Álvarez 2016-08-12 16:30:35 -07:00
parent 40c04b4c6b
commit 9e88a495c8
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
12 changed files with 205 additions and 23 deletions

View file

@ -230,6 +230,7 @@ impl Stylist {
&declarations, false,
parent.map(|p| &**p),
None,
None,
Box::new(StdoutErrorReporter));
Some(Arc::new(computed))
} else {
@ -242,8 +243,9 @@ impl Stylist {
pseudo: &PseudoElement,
parent: &Arc<ComputedValues>)
-> Option<Arc<ComputedValues>>
where E: Element<Impl=TheSelectorImpl> +
PresentationalHintsSynthetizer {
where E: Element<Impl=TheSelectorImpl> +
PresentationalHintsSynthetizer
{
debug_assert!(TheSelectorImpl::pseudo_element_cascade_type(pseudo).is_lazy());
if self.pseudos_map.get(pseudo).is_none() {
return None;
@ -262,8 +264,10 @@ impl Stylist {
let (computed, _) =
properties::cascade(self.device.au_viewport_size(),
&declarations, false,
Some(&**parent), None,
Some(&**parent), None, None,
Box::new(StdoutErrorReporter));
Some(Arc::new(computed))
}