From 2c52210ba7510edc6fb6919a1661dca3282c3430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Mon, 15 Oct 2018 03:13:09 +0000 Subject: [PATCH] style: Remove PseudoElement::inherits_all. I plan to change servo to use all: inherit on its UA sheet. I hope the patch below should make it good enough performance-wise. And also, it's probably broken so I don't think it's worth supporting it specially. Differential Revision: https://phabricator.services.mozilla.com/D8686 --- components/style/gecko/pseudo_element.rs | 9 --------- components/style/properties/properties.mako.rs | 9 --------- components/style/servo/selector_parser.rs | 5 ----- components/style/stylist.rs | 8 -------- 4 files changed, 31 deletions(-) diff --git a/components/style/gecko/pseudo_element.rs b/components/style/gecko/pseudo_element.rs index 70b0e112cee..23fea10189f 100644 --- a/components/style/gecko/pseudo_element.rs +++ b/components/style/gecko/pseudo_element.rs @@ -57,15 +57,6 @@ impl PseudoElement { PseudoElementCascadeType::Lazy } - /// Whether cascading this pseudo-element makes it inherit all properties, - /// even reset ones. - /// - /// This is used in Servo for anonymous boxes, though it's likely broken. - #[inline] - pub fn inherits_all(&self) -> bool { - false - } - /// Whether the pseudo-element should inherit from the default computed /// values instead of from the parent element. /// diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs index 109f21960c1..0540d90be70 100644 --- a/components/style/properties/properties.mako.rs +++ b/components/style/properties/properties.mako.rs @@ -3298,15 +3298,6 @@ impl<'a> StyleBuilder<'a> { let reset_style = device.default_computed_values(); let inherited_style = parent_style.unwrap_or(reset_style); let inherited_style_ignoring_first_line = parent_style_ignoring_first_line.unwrap_or(reset_style); - // FIXME(bz): inherits_all seems like a fundamentally broken idea. I'm - // 99% sure it should give incorrect behavior for table anonymous box - // backgrounds, for example. This code doesn't attempt to make it play - // nice with inherited_style_ignoring_first_line. - let reset_style = if pseudo.map_or(false, |p| p.inherits_all()) { - inherited_style - } else { - reset_style - }; let flags = inherited_style.flags.inherited(); diff --git a/components/style/servo/selector_parser.rs b/components/style/servo/selector_parser.rs index 7b2c06019a4..de8257dcc4c 100644 --- a/components/style/servo/selector_parser.rs +++ b/components/style/servo/selector_parser.rs @@ -221,11 +221,6 @@ impl PseudoElement { } } - /// To be removed. - pub fn inherits_all(&self) -> bool { - false - } - /// Covert non-canonical pseudo-element to canonical one, and keep a /// canonical one as it is. pub fn canonical(&self) -> PseudoElement { diff --git a/components/style/stylist.rs b/components/style/stylist.rs index df7a55c6f18..e5249a52b8f 100644 --- a/components/style/stylist.rs +++ b/components/style/stylist.rs @@ -614,14 +614,6 @@ impl Stylist { /// Computes the style for a given "precomputed" pseudo-element, taking the /// universal rules and applying them. - /// - /// If `inherit_all` is true, then all properties are inherited from the - /// parent; otherwise, non-inherited properties are reset to their initial - /// values. The flow constructor uses this flag when constructing anonymous - /// flows. - /// - /// TODO(emilio): The type parameter could go away with a void type - /// implementing TElement. pub fn precomputed_values_for_pseudo( &self, guards: &StylesheetGuards,