Backed out changeset 7bf4e5ea128d (bug 1343879) for causing merge conflicts
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Wed, 08 Mar 2017 14:23:57 +0100
changeset 346455 3b8c0a06aedd01ae231764854a47e64a453411a4
parent 346454 0678fa302154c157a331d515238e84d412cc27fe
child 346527 791a43e25a1e56bfad5a062bd7f94a6d2f0957d5
push id87824
push usercbook@mozilla.com
push dateWed, 08 Mar 2017 13:24:46 +0000
treeherdermozilla-inbound@3b8c0a06aedd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1343879
milestone55.0a1
backs out7bf4e5ea128d8e054b20949d90ff7aed32b36177
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
Backed out changeset 7bf4e5ea128d (bug 1343879) for causing merge conflicts
layout/base/nsCSSFrameConstructor.cpp
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -10865,32 +10865,26 @@ nsCSSFrameConstructor::AddFCItemsForAnon
     // We don't need to worry about display:contents here, because such
     // elements don't get a frame and thus can't generate NAC. But we do need
     // to worry about anonymous boxes, which CorrectStyleParentFrame handles
     // for us.
     nsIFrame* inheritFrame = aFrame;
     while (inheritFrame->GetContent()->IsNativeAnonymous()) {
       inheritFrame = inheritFrame->GetParent();
     }
-    nsIFrame* styleParentFrame =
-      nsFrame::CorrectStyleParentFrame(inheritFrame, pseudo);
-    // The only way we can not have a style parent now is if inheritFrame is the
-    // canvas frame and we're the NAC parent for all the things added via
-    // nsIDocument::InsertAnonymousContent.
-    MOZ_ASSERT_IF(!styleParentFrame,
-                  inheritFrame->GetType() == nsGkAtoms::canvasFrame);
-    // And that anonymous div has no pseudo.
-    MOZ_ASSERT_IF(!styleParentFrame, !pseudo);
-
-    Element* originating =
-      pseudo ? styleParentFrame->GetContent()->AsElement() : nullptr;
-    nsStyleContext* parentStyle =
-      styleParentFrame ? styleParentFrame->StyleContext() : nullptr;
+    if (inheritFrame->GetType() == nsGkAtoms::canvasFrame) {
+      // CorrectStyleParentFrame returns nullptr if the prospective parent is
+      // the canvas frame, so avoid calling it in that situation.
+    } else {
+      inheritFrame = nsFrame::CorrectStyleParentFrame(inheritFrame, pseudo);
+    }
+    Element* originating = pseudo ? inheritFrame->GetContent()->AsElement() : nullptr;
+
     styleContext =
-      ResolveStyleContext(parentStyle, content, &aState, originating);
+      ResolveStyleContext(inheritFrame->StyleContext(), content, &aState, originating);
 
     nsTArray<nsIAnonymousContentCreator::ContentInfo>* anonChildren = nullptr;
     if (!aAnonymousItems[i].mChildren.IsEmpty()) {
       anonChildren = &aAnonymousItems[i].mChildren;
     }
 
     uint32_t flags = ITEM_ALLOW_XBL_BASE | ITEM_ALLOW_PAGE_BREAK |
                      ITEM_IS_ANONYMOUSCONTENTCREATOR_CONTENT | aExtraFlags;