From bfc2cc4ebfc3ccfcb11ac90ca9b49e12ea65da34 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Sun, 26 Mar 2017 13:53:34 -0700 Subject: [PATCH] stylo: Include content rules from HTMLTableCellElement::WalkContentStyleRules This also removes the TABLE_ATTRS_DIRTY optimization. Constructing nsMappedAttributes isn't really expensive and we do it all the time anyway. --- components/style/gecko/wrapper.rs | 8 ++++++++ components/style/gecko_bindings/bindings.rs | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs index 2fee62cb2b6..6b912b2fda9 100644 --- a/components/style/gecko/wrapper.rs +++ b/components/style/gecko/wrapper.rs @@ -33,6 +33,7 @@ use gecko_bindings::bindings::Gecko_ClassOrClassList; use gecko_bindings::bindings::Gecko_ElementHasAnimations; use gecko_bindings::bindings::Gecko_ElementHasCSSAnimations; use gecko_bindings::bindings::Gecko_GetAnimationRule; +use gecko_bindings::bindings::Gecko_GetExtraContentStyleDeclarations; use gecko_bindings::bindings::Gecko_GetHTMLPresentationAttrDeclarationBlock; use gecko_bindings::bindings::Gecko_GetStyleAttrDeclarationBlock; use gecko_bindings::bindings::Gecko_GetStyleContext; @@ -618,6 +619,13 @@ impl<'le> PresentationalHintsSynthetizer for GeckoElement<'le> { ApplicableDeclarationBlock::from_declarations(Clone::clone(decl), ServoCascadeLevel::PresHints) ); } + let declarations = unsafe { Gecko_GetExtraContentStyleDeclarations(self.0) }; + let declarations = declarations.and_then(|s| s.as_arc_opt()); + if let Some(decl) = declarations { + hints.push( + ApplicableDeclarationBlock::from_declarations(Clone::clone(decl), ServoCascadeLevel::PresHints) + ); + } } } diff --git a/components/style/gecko_bindings/bindings.rs b/components/style/gecko_bindings/bindings.rs index c39a5fbe5c8..c5896b01127 100644 --- a/components/style/gecko_bindings/bindings.rs +++ b/components/style/gecko_bindings/bindings.rs @@ -596,6 +596,10 @@ extern "C" { RawGeckoElementBorrowed) -> RawServoDeclarationBlockStrongBorrowedOrNull; } +extern "C" { + pub fn Gecko_GetExtraContentStyleDeclarations(element: RawGeckoElementBorrowed) + -> RawServoDeclarationBlockStrongBorrowedOrNull; +} extern "C" { pub fn Gecko_GetAnimationRule(aElement: RawGeckoElementBorrowed, aPseudoTag: *mut nsIAtom,