Bug 1368113 - Part 3: Use closest non-NAC ancestor as originating element when restyling all NAC-implemented pseudo-elements. r?bz
MozReview-Commit-ID: 9RZBuv9X5OC
--- a/layout/base/GeckoRestyleManager.cpp
+++ b/layout/base/GeckoRestyleManager.cpp
@@ -736,27 +736,19 @@ ElementForStyleContext(nsIContent* aPare
while (!f->IsNumberControlFrame()) {
f = f->GetParent();
MOZ_ASSERT(f);
}
return f->GetContent()->AsElement();
}
Element* frameElement = aFrame->GetContent()->AsElement();
- if (frameElement->IsNativeAnonymous() &&
- nsCSSPseudoElements::PseudoElementIsJSCreatedNAC(aPseudoType)) {
+ if (frameElement->IsNativeAnonymous()) {
// NAC-implemented pseudos use the closest non-NAC element as their
// element to inherit from.
- //
- // FIXME(heycam): In theory we shouldn't need to limit this only to
- // JS-created pseudo-implementing NAC, as all pseudo-implementing
- // should use the closest non-native anonymous ancestor element as
- // its originating element. But removing that part of the condition
- // reveals some bugs in style resultion with display:contents and
- // XBL. See bug 1345809.
Element* originatingElement =
nsContentUtils::GetClosestNonNativeAnonymousAncestor(frameElement);
if (originatingElement) {
return originatingElement;
}
}
if (aParentContent) {
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -2003,11 +2003,11 @@ fails-if(styloVsGecko) == 1322512-1.html
== 1364280-2b.html 1364280-2-ref.html
== 1364280-2c.html 1364280-2-ref.html
== 1364335.html 1364335-ref.html
== 1364360-1.html 1364360-1-ref.html
== 1365159-1.html 1365159-1-ref.html
fails-if(!stylo||styloVsGecko) == 1365162-1.html 1365162-1-ref.html
== 1366144.html 1366144-ref.html
== 1367592-1.html 1367592-1-ref.html
-fails-if(!stylo) == 1368113-1.html 1368113-1-ref.html
+== 1368113-1.html 1368113-1-ref.html
== 1369584-1a.html 1369584-1-ref.html
== 1369584-1b.html 1369584-1-ref.html