Limit visited cascade for reparenting

The specialized cascade flow in `stylist::compute_style_with_inputs` (used with
reparenting) currently computes all properties for visited styles, but we only
need visited-dependent properties.

This adds the cascade flag to reduce the work to visited-dependent properties
only, like we do for the regular cascade flow.

MozReview-Commit-ID: FGCj6GPnQOB
This commit is contained in:
J. Ryan Stinnett 2017-10-11 17:31:38 -05:00
parent 9f8514d2b9
commit 0eb7d65e73

View file

@ -25,6 +25,7 @@ use properties::{AnimationRules, PropertyDeclarationBlock};
#[cfg(feature = "servo")] #[cfg(feature = "servo")]
use properties::INHERIT_ALL; use properties::INHERIT_ALL;
use properties::IS_LINK; use properties::IS_LINK;
use properties::VISITED_DEPENDENT_ONLY;
use rule_tree::{CascadeLevel, RuleTree, StrongRuleNode, StyleSource}; use rule_tree::{CascadeLevel, RuleTree, StrongRuleNode, StyleSource};
use selector_map::{PrecomputedHashMap, SelectorMap, SelectorMapEntry}; use selector_map::{PrecomputedHashMap, SelectorMap, SelectorMapEntry};
use selector_parser::{SelectorImpl, PerPseudoElementMap, PseudoElement}; use selector_parser::{SelectorImpl, PerPseudoElementMap, PseudoElement};
@ -924,7 +925,7 @@ impl Stylist {
Some(layout_parent_style_for_visited), Some(layout_parent_style_for_visited),
None, None,
font_metrics, font_metrics,
cascade_flags, cascade_flags | VISITED_DEPENDENT_ONLY,
self.quirks_mode, self.quirks_mode,
/* rule_cache = */ None, /* rule_cache = */ None,
&mut Default::default(), &mut Default::default(),