Bug 907396 - DEBUG only; make frame tree dumps print up to 2 style context parents in the unusual case when they are not the parent frame's style context (e.g. display:contents). r=bzbarsky
authorMats Palmgren <matspal@gmail.com>
Thu, 20 Nov 2014 18:24:10 +0000
changeset 216694 92926cd0034b2678169464f498a998824a00b70d
parent 216693 bf4849f9b83557c4a6db98f2f5f9a406d0175495
child 216695 1a4bb406f950881a467694bc8be2e9cdefcba9e2
push id27858
push userkwierso@gmail.com
push dateFri, 21 Nov 2014 01:35:46 +0000
treeherdermozilla-central@6309710dd71d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbzbarsky
bugs907396
milestone36.0a1
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 907396 - DEBUG only; make frame tree dumps print up to 2 style context parents in the unusual case when they are not the parent frame's style context (e.g. display:contents). r=bzbarsky
layout/generic/nsFrame.cpp
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -5574,18 +5574,25 @@ nsIFrame::ListGeneric(nsACString& aTo, c
   aTo += nsPrintfCString(" [sc=%p", static_cast<void*>(mStyleContext));
   if (mStyleContext) {
     nsIAtom* pseudoTag = mStyleContext->GetPseudo();
     if (pseudoTag) {
       nsAutoString atomString;
       pseudoTag->ToString(atomString);
       aTo += nsPrintfCString("%s", NS_LossyConvertUTF16toASCII(atomString).get());
     }
-    if (GetParent() && mStyleContext->GetParent() != GetParent()->StyleContext()) {
-      aTo += nsPrintfCString(",parent=%p", mStyleContext->GetParent());
+    if (!mStyleContext->GetParent() ||
+        (GetParent() && GetParent()->StyleContext() != mStyleContext->GetParent())) {
+      aTo += nsPrintfCString("^%p", mStyleContext->GetParent());
+      if (mStyleContext->GetParent()) {
+        aTo += nsPrintfCString("^%p", mStyleContext->GetParent()->GetParent());
+        if (mStyleContext->GetParent()->GetParent()) {
+          aTo += nsPrintfCString("^%p", mStyleContext->GetParent()->GetParent()->GetParent());
+        }
+      }
     }
   }
   aTo += "]";
 }
 
 void
 nsIFrame::List(FILE* out, const char* aPrefix, uint32_t aFlags) const
 {