Bug 1360157: Assert that a display: contents child always has a parent. r?mats
MozReview-Commit-ID: Cyif2yCFu5
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -8536,16 +8536,17 @@ nsCSSFrameConstructor::ContentRemoved(ns
// XXXbz the GetContent() != aChild check is needed due to bug 135040.
// Remove it once that's fixed.
ClearUndisplayedContentIn(aChild, aContainer);
}
MOZ_ASSERT(!childFrame || !GetDisplayContentsStyleFor(aChild),
"display:contents nodes shouldn't have a frame");
if (!childFrame && GetDisplayContentsStyleFor(aChild)) {
nsIContent* ancestor = aContainer;
+ MOZ_ASSERT(ancestor, "display: contents on the root?");
while (!ancestor->GetPrimaryFrame()) {
// FIXME(emilio): Should this use the flattened tree parent instead?
ancestor = ancestor->GetParent();
MOZ_ASSERT(ancestor, "we can't have a display: contents subtree root!");
}
nsIFrame* ancestorFrame = ancestor->GetPrimaryFrame();
if (ancestorFrame->Properties().Get(nsIFrame::GenConProperty())) {