Bug 1506216 - Remove bogus assert in AssertColumnSpanWrapperSubtreeIsSane(). r=bzbarsky
authorTing-Yu Lin <tlin@mozilla.com>
Wed, 21 Nov 2018 18:59:00 +0000
changeset 504063 e70144f3fc89118b48a541daf9206cef292b4a24
parent 504062 ec31fba4ef982c5db303374e79d1c39844512c6f
child 504064 fab7024e765889bd2ea6d42e735e40b74e3ba166
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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 1506216 - Remove bogus assert in AssertColumnSpanWrapperSubtreeIsSane(). r=bzbarsky The assert is testing that the content's primary frame shouldn't generate any native anonymous children, but what we really want to ensure is that :-moz-column-span-wrapper doesn't create any native anonymous child (because we don't restyle the wrapper), not the content which creates ::-moz-column-span-wrapper. The condition is already guaranteed by !aFrame->HasAnyStateBits(NS_FRAME_OWNS_ANON_BOXES) above. Also, at this point during the frame construction, we haven't associate the content with the its primary frame. Therefore, nsContentUtils::AppendNativeAnonymousChildren() won't return anything except for scrollbars on root element. That's why we have the crash in this bug. Differential Revision: https://phabricator.services.mozilla.com/D12359
--- a/layout/generic/ColumnSetWrapperFrame.cpp
+++ b/layout/generic/ColumnSetWrapperFrame.cpp
@@ -141,21 +141,14 @@ ColumnSetWrapperFrame::AssertColumnSpanW
   MOZ_ASSERT(aFrame->Style()->GetPseudo() == nsCSSAnonBoxes::columnSpanWrapper(),
              "aFrame should be ::-moz-column-span-wrapper");
              "::-moz-column-span-wrapper anonymous blocks cannot own "
              "other types of anonymous blocks!");
-  nsTArray<nsIContent*> anonKids;
-  nsContentUtils::AppendNativeAnonymousChildren(
-    aFrame->GetContent(), anonKids, 0);
-  MOZ_ASSERT(anonKids.IsEmpty(),
-             "We support only column-span on block and inline frame. They "
-             "should not create any native anonymous children.");
   for (const nsIFrame* child : aFrame->PrincipalChildList()) {
new file mode 100644
--- /dev/null
+++ b/layout/generic/crashtests/1506216.html
@@ -0,0 +1,4 @@
+:root { columns: 5px }
+<hr style="column-span:all">
--- a/layout/generic/crashtests/crashtests.list
+++ b/layout/generic/crashtests/crashtests.list
@@ -713,8 +713,9 @@ load 1489863.html
 load 1489770.html
 load 1490032.html
 load 1490685.html
 load 1493708.html
 load 1493710.html
 load 1493741.html
 load 1494380.html
 load 1505817.html
+pref(layout.css.column-span.enabled,true) load 1506216.html