Bug 1368113 - Part 3: Use closest non-NAC ancestor as originating element when restyling all NAC-implemented pseudo-elements. r=bz
authorCameron McCormack <cam@mcc.id.au>
Sat, 10 Jun 2017 11:19:52 +0800
changeset 363364 68f9a27cdf3bc31652a3c33dab3110af348b5b2f
parent 363363 129c04db249edf92fb1ab2dbfc283ad84cd530b9
child 363365 7996b68e8a642f16633e3f6ec07e2473ed895608
push id44523
push usercmccormack@mozilla.com
push dateSun, 11 Jun 2017 00:31:16 +0000
treeherderautoland@68f9a27cdf3b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1368113
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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,12 +2003,12 @@ 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
 == 1369954-1.xhtml 1369954-1-ref.xhtml