Bug 1399546: Implement the tables inherit from body quirk in a more straight-forward way. r=heycam
MozReview-Commit-ID: 8mtd4CsoSlU
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -839,20 +839,21 @@ Gecko_FillAllBackgroundLists(nsStyleImag
}
void
Gecko_FillAllMaskLists(nsStyleImageLayers* aLayers, uint32_t aMaxLen)
{
nsRuleNode::FillAllMaskLists(*aLayers, aMaxLen);
}
-RawGeckoElementBorrowedOrNull
-Gecko_GetBody(RawGeckoPresContextBorrowed aPresContext)
+bool
+Gecko_IsDocumentBody(RawGeckoElementBorrowed aElement)
{
- return aPresContext->Document()->GetBodyElement();
+ nsIDocument* doc = aElement->GetUncomposedDoc();
+ return doc && doc->GetBodyElement() == aElement;
}
nscolor
Gecko_GetLookAndFeelSystemColor(int32_t aId,
RawGeckoPresContextBorrowed aPresContext)
{
bool useStandinsForNativeColors = aPresContext && !aPresContext->IsChrome();
nscolor result;
--- a/layout/style/ServoBindings.h
+++ b/layout/style/ServoBindings.h
@@ -626,17 +626,17 @@ NS_DECL_FFI_REFCOUNTING(nsCSSFontFaceRul
// Counter style rule
// Creates and returns a new (already-addrefed) nsCSSCounterStyleRule object.
nsCSSCounterStyleRule* Gecko_CSSCounterStyle_Create(nsIAtom* name);
nsCSSCounterStyleRule* Gecko_CSSCounterStyle_Clone(const nsCSSCounterStyleRule* rule);
void Gecko_CSSCounterStyle_GetCssText(const nsCSSCounterStyleRule* rule, nsAString* result);
NS_DECL_FFI_REFCOUNTING(nsCSSCounterStyleRule, CSSCounterStyleRule);
-RawGeckoElementBorrowedOrNull Gecko_GetBody(RawGeckoPresContextBorrowed pres_context);
+bool Gecko_IsDocumentBody(RawGeckoElementBorrowed element);
// We use an int32_t here instead of a LookAndFeel::ColorID
// because forward-declaring a nested enum/struct is impossible
nscolor Gecko_GetLookAndFeelSystemColor(int32_t color_id,
RawGeckoPresContextBorrowed pres_context);
bool Gecko_MatchStringArgPseudo(RawGeckoElementBorrowed element,
mozilla::CSSPseudoClassType type,