Bug 1041510 - Add some missing newlines when dumping display list sets, and include z-index in the dump. r=tn
authorKartikaya Gupta <kgupta@mozilla.com>
Wed, 23 Jul 2014 21:50:26 -0400
changeset 195810 9c3d8f8b46f7cddc778420daa47002afd708a7c1
parent 195809 eeccb95d2e83d362001413b1ac442399746f0673
child 195811 f654e6bf1089820f000b61fcb5fc3099d17bffe9
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewerstn
bugs1041510
milestone34.0a1
Bug 1041510 - Add some missing newlines when dumping display list sets, and include z-index in the dump. r=tn
layout/base/nsLayoutDebugger.cpp
--- a/layout/base/nsLayoutDebugger.cpp
+++ b/layout/base/nsLayoutDebugger.cpp
@@ -156,18 +156,19 @@ PrintDisplayItemTo(nsDisplayListBuilder*
   const DisplayItemClip& clip = aItem->GetClip();
   nsRegion opaque = aItem->GetOpaqueRegion(aBuilder, &snap);
   if (aDumpHtml && aItem->Painted()) {
     nsCString string(aItem->Name());
     string.Append('-');
     string.AppendInt((uint64_t)aItem);
     aStream << nsPrintfCString("<a href=\"javascript:ViewImage('%s')\">", string.BeginReading());
   }
-  aStream << nsPrintfCString("%s p=0x%p f=0x%p(%s) bounds(%d,%d,%d,%d) visible(%d,%d,%d,%d) componentAlpha(%d,%d,%d,%d) clip(%s) %s",
+  aStream << nsPrintfCString("%s p=0x%p f=0x%p(%s) %sbounds(%d,%d,%d,%d) visible(%d,%d,%d,%d) componentAlpha(%d,%d,%d,%d) clip(%s) %s",
           aItem->Name(), aItem, (void*)f, NS_ConvertUTF16toUTF8(fName).get(),
+          (aItem->ZIndex() ? nsPrintfCString("z=%d ", aItem->ZIndex()).get() : ""),
           rect.x, rect.y, rect.width, rect.height,
           vis.x, vis.y, vis.width, vis.height,
           component.x, component.y, component.width, component.height,
           clip.ToString().get(),
           aItem->IsUniform(aBuilder, &color) ? " uniform" : "");
 
   nsRegionRectIterator iter(opaque);
   for (const nsRect* r = iter.Next(); r; r = iter.Next()) {
@@ -261,17 +262,17 @@ PrintDisplayListSetItem(nsDisplayListBui
                         const char* aItemName,
                         const nsDisplayList& aList,
                         std::stringstream& aStream,
                         bool aDumpHtml)
 {
   if (aDumpHtml) {
     aStream << "<li>";
   }
-  aStream << aItemName;
+  aStream << aItemName << "\n";
   PrintDisplayListTo(aBuilder, aList, aStream, 0, aDumpHtml);
   if (aDumpHtml) {
     aStream << "</li>";
   }
 }
 
 void
 nsFrame::PrintDisplayListSet(nsDisplayListBuilder* aBuilder,