Bug 1265280 - Temporary debugging code to crash with a useful abort message. r=khuey
☠☠ backed out by ca6ab5be342e ☠ ☠
authorL. David Baron <dbaron@dbaron.org>
Sat, 23 Apr 2016 14:17:24 -0700
changeset 318464 ff82389380c1e4c550314ffe536191075a405b0b
parent 318463 5d3ac1da48e0ba42362b7531b0a345d477e0770c
child 318465 b0e5199c93c64a3a8e351c960d10ccfc07fae2b9
push id9480
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 17:12:58 +0000
treeherdermozilla-aurora@0d6a91c76a9e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs1265280
milestone48.0a1
Bug 1265280 - Temporary debugging code to crash with a useful abort message. r=khuey MozReview-Commit-ID: G1XOUcfwY20
layout/base/nsDisplayList.cpp
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -2163,16 +2163,24 @@ static bool IsCSSOrderLEQ(nsDisplayItem*
   nsIFrame* frame2 = aItem2->Frame();
   int32_t order1 = frame1 ? frame1->StylePosition()->mOrder : 0;
   int32_t order2 = frame2 ? frame2->StylePosition()->mOrder : 0;
   return order1 <= order2;
 }
 
 static bool IsZOrderLEQ(nsDisplayItem* aItem1, nsDisplayItem* aItem2,
                         void* aClosure) {
+  {
+    // TEMPORARY debugging code for bug 1265280
+    nsIFrame* f2 = aItem2->Frame();
+    if (!f2 || !f2->StyleContext()) {
+      NS_RUNTIMEABORT(nsPrintfCString("bad display item %p type %s frame %p",
+                                      aItem2, aItem2->Name(), f2).get());
+    }
+  }
   // Note that we can't just take the difference of the two
   // z-indices here, because that might overflow a 32-bit int.
   return aItem1->ZIndex() <= aItem2->ZIndex();
 }
 
 void nsDisplayList::SortByZOrder() {
   Sort(IsZOrderLEQ, nullptr);
 }