Bug 799199: Use IndentBy() instead of looped "fputs" in nsHTMLFramesetBlankFrame's and nsLineBox's List() methods. r=bz
authorDaniel Holbert <dholbert@cs.stanford.edu>
Mon, 08 Oct 2012 13:06:04 -0700
changeset 109698 b177c32d57d653bae1764cfb508a4d1c9b3b936e
parent 109697 8db47189455919c3e0499dba4100f1a9369a4222
child 109699 5a3ebc9d46ac85982e98cb4e024f512adbc6479c
push id23648
push useremorley@mozilla.com
push dateTue, 09 Oct 2012 14:23:49 +0000
treeherdermozilla-central@dd61540f237c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs799199
milestone18.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 799199: Use IndentBy() instead of looped "fputs" in nsHTMLFramesetBlankFrame's and nsLineBox's List() methods. r=bz
layout/generic/nsFrameSetFrame.cpp
layout/generic/nsLineBox.cpp
--- a/layout/generic/nsFrameSetFrame.cpp
+++ b/layout/generic/nsFrameSetFrame.cpp
@@ -1821,17 +1821,17 @@ void nsDisplayFramesetBlank::Paint(nsDis
 }
 
 #ifdef DEBUG
 NS_IMETHODIMP
 nsHTMLFramesetBlankFrame::List(FILE*    out,
                                int32_t  aIndent,
                                uint32_t aFlags) const
 {
-  for (int32_t i = aIndent; --i >= 0; ) fputs("  ", out);   // Indent
+  IndentBy(out, aIndent);
   fprintf(out, "%p BLANK \n", (void*)this);
   return nsLeafFrame::List(out, aIndent, aFlags);
 }
 #endif
 
 NS_IMETHODIMP
 nsHTMLFramesetBlankFrame::BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                                            const nsRect&           aDirtyRect,
--- a/layout/generic/nsLineBox.cpp
+++ b/layout/generic/nsLineBox.cpp
@@ -223,17 +223,17 @@ nsLineBox::StateToString(char* aBuf, int
   return aBuf;
 }
 
 void
 nsLineBox::List(FILE* out, int32_t aIndent, uint32_t aFlags) const
 {
   int32_t i;
 
-  for (i = aIndent; --i >= 0; ) fputs("  ", out);
+  nsFrame::IndentBy(out, aIndent);
   char cbuf[100];
   fprintf(out, "line %p: count=%d state=%s ",
           static_cast<const void*>(this), GetChildCount(),
           StateToString(cbuf, sizeof(cbuf)));
   if (IsBlock() && !GetCarriedOutBottomMargin().IsZero()) {
     fprintf(out, "bm=%d ", GetCarriedOutBottomMargin().get());
   }
   fprintf(out, "{%d,%d,%d,%d} ",
@@ -253,22 +253,22 @@ nsLineBox::List(FILE* out, int32_t aInde
 
   nsIFrame* frame = mFirstChild;
   int32_t n = GetChildCount();
   while (--n >= 0) {
     frame->List(out, aIndent + 1, aFlags);
     frame = frame->GetNextSibling();
   }
 
-  for (i = aIndent; --i >= 0; ) fputs("  ", out);
   if (HasFloats()) {
+    nsFrame::IndentBy(out, aIndent);
     fputs("> floats <\n", out);
     ListFloats(out, aIndent + 1, mInlineData->mFloats);
-    for (i = aIndent; --i >= 0; ) fputs("  ", out);
   }
+  nsFrame::IndentBy(out, aIndent);
   fputs(">\n", out);
 }
 #endif
 
 #ifdef DEBUG
 nsIFrame*
 nsLineBox::LastChild() const
 {