Bug 1368113 - Part 3: Use closest non-NAC ancestor as originating element when restyling all NAC-implemented pseudo-elements. r?bz draft
authorCameron McCormack <cam@mcc.id.au>
Sat, 10 Jun 2017 11:19:52 +0800
changeset 592066 7c08a0cfd231c8d879396d33ff39b7efd3cf3ed2
parent 592065 7629929eaa8879a7cce8da999ad7832f83428fc4
child 632715 9092a2a99bcd247a94903fe50b64ea694b554749
push id63273
push userbmo:cam@mcc.id.au
push dateSat, 10 Jun 2017 05:33:02 +0000
reviewersbz
bugs1368113
milestone55.0a1
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
layout/base/GeckoRestyleManager.cpp
layout/reftests/bugs/reftest.list
--- 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