Bug 1427824: Remove invalid assertion in presence of display: contents. r?bz draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Fri, 05 Jan 2018 19:12:42 +0100
changeset 716410 e517d777502d9d56f8d79dd4e0519381f546cb0c
parent 716409 1d4b3dee7b70ea844b32881523791cc55842e891
child 745034 7e78b8b460b53576e4341638c2826166d37d2c53
push id94435
push userbmo:emilio@crisal.io
push dateFri, 05 Jan 2018 18:20:24 +0000
reviewersbz
bugs1427824
milestone59.0a1
Bug 1427824: Remove invalid assertion in presence of display: contents. r?bz MozReview-Commit-ID: 4jFGHcD5wds
layout/base/nsCSSFrameConstructor.cpp
layout/generic/crashtests/1427824.html
layout/generic/crashtests/crashtests.list
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -6544,19 +6544,16 @@ nsCSSFrameConstructor::GetFloatContainin
  */
 static nsIFrame*
 FindAppendPrevSibling(nsIFrame* aParentFrame, nsIFrame* aNextSibling)
 {
   aParentFrame->DrainSelfOverflowList();
 
   if (aNextSibling) {
     MOZ_ASSERT(aNextSibling->GetParent() == aParentFrame, "Wrong parent");
-    MOZ_ASSERT(aNextSibling->GetPrevSibling() ||
-               aParentFrame->PrincipalChildList().FirstChild() == aNextSibling,
-               "next sibling must be on the principal child list here");
     return aNextSibling->GetPrevSibling();
   }
 
   return aParentFrame->GetChildList(kPrincipalList).LastChild();
 }
 
 /**
  * Finds the right parent frame to append content to aParentFrame.
new file mode 100644
--- /dev/null
+++ b/layout/generic/crashtests/1427824.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<div id="container"></div>
+<script>
+let contents = document.createElement('div');
+contents.style.display = "contents";
+container.appendChild(contents);
+container.appendChild(document.createElement('colgroup'));
+container.offsetTop;
+contents.appendChild(document.createElement('colgroup'));
+</script>
--- a/layout/generic/crashtests/crashtests.list
+++ b/layout/generic/crashtests/crashtests.list
@@ -671,8 +671,9 @@ load 1375858.html
 load 1381134.html
 load 1381134-2.html
 load 1401420-1.html
 load 1401709.html
 load 1401807.html
 load 1405443.html
 load 1415185.html
 load 1416544.html
+load 1427824.html