From 0eb7d65e73d51bf3b85d2607fd0e4b4782781856 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Wed, 11 Oct 2017 17:31:38 -0500 Subject: [PATCH] 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 --- components/style/stylist.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/style/stylist.rs b/components/style/stylist.rs index eb4976d246b..710f0cb56a0 100644 --- a/components/style/stylist.rs +++ b/components/style/stylist.rs @@ -25,6 +25,7 @@ use properties::{AnimationRules, PropertyDeclarationBlock}; #[cfg(feature = "servo")] use properties::INHERIT_ALL; use properties::IS_LINK; +use properties::VISITED_DEPENDENT_ONLY; use rule_tree::{CascadeLevel, RuleTree, StrongRuleNode, StyleSource}; use selector_map::{PrecomputedHashMap, SelectorMap, SelectorMapEntry}; use selector_parser::{SelectorImpl, PerPseudoElementMap, PseudoElement}; @@ -924,7 +925,7 @@ impl Stylist { Some(layout_parent_style_for_visited), None, font_metrics, - cascade_flags, + cascade_flags | VISITED_DEPENDENT_ONLY, self.quirks_mode, /* rule_cache = */ None, &mut Default::default(),