From 6657f3dc19ac5c0bd93092823b00cb187461aea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Wed, 6 Sep 2017 10:27:30 +0200 Subject: [PATCH] style: Properly apply the display fixup for ::before and ::after. Bug: 1393861 Reviewed-by: heycam --- components/style/gecko/wrapper.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs index 591657c4be7..07101336716 100644 --- a/components/style/gecko/wrapper.rs +++ b/components/style/gecko/wrapper.rs @@ -1166,14 +1166,15 @@ impl<'le> TElement for GeckoElement<'le> { #[inline] fn skip_root_and_item_based_display_fixup(&self) -> bool { - // We don't want to fix up display values of native anonymous content. - // Additionally, we want to skip root-based display fixup for document - // level native anonymous content subtree roots, since they're not - // really roots from the style fixup perspective. Checking that we - // are NAC handles both cases. - self.is_native_anonymous() && - (self.is_root_of_native_anonymous_subtree() || - self.implemented_pseudo_element().is_some()) + if !self.is_native_anonymous() { + return false; + } + + if let Some(p) = self.implemented_pseudo_element() { + return p.skip_item_based_display_fixup(); + } + + self.is_root_of_native_anonymous_subtree() } unsafe fn set_selector_flags(&self, flags: ElementSelectorFlags) {