From d82e6926fca842992c06a899520cae4000a9acf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Wed, 27 Sep 2017 13:27:01 +0200 Subject: [PATCH] style: Do not optimize out lazy pseudo rules if the main stylist doesn't have rules for it. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This could prevent an XBL binding to use some pseudo-elements fairly randomly. MozReview-Commit-ID: b44DO8qcfD Signed-off-by: Emilio Cobos Álvarez --- components/style/stylist.rs | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/components/style/stylist.rs b/components/style/stylist.rs index 7e89db40957..b5e76a6d44d 100644 --- a/components/style/stylist.rs +++ b/components/style/stylist.rs @@ -964,12 +964,6 @@ impl Stylist { ) } - fn has_rules_for_pseudo(&self, pseudo: &PseudoElement) -> bool { - self.cascade_data - .iter_origins() - .any(|(d, _)| d.has_rules_for_pseudo(pseudo)) - } - /// Computes the cascade inputs for a lazily-cascaded pseudo-element. /// /// See the documentation on lazy pseudo-elements in @@ -988,10 +982,6 @@ impl Stylist { let pseudo = pseudo.canonical(); debug_assert!(pseudo.is_lazy()); - if !self.has_rules_for_pseudo(&pseudo) { - return CascadeInputs::default() - } - // Apply the selector flags. We should be in sequential mode // already, so we can directly apply the parent flags. let mut set_selector_flags = |element: &E, flags: ElementSelectorFlags| { @@ -2195,10 +2185,6 @@ impl CascadeData { } } - fn has_rules_for_pseudo(&self, pseudo: &PseudoElement) -> bool { - self.pseudos_map.get(pseudo).is_some() - } - /// Clears the cascade data, but not the invalidation data. fn clear_cascade_data(&mut self) { self.element_map.clear();