Bug 1596339 Part 5 - Use ToString() on nsRect in frame tree dump. r=dholbert
authorTing-Yu Lin <tlin@mozilla.com>
Fri, 15 Nov 2019 03:52:14 +0000
changeset 502119 1622b327fb356012561b3ace3b382c89addeb4fc
parent 502118 e9e0e6b92381b73474c978d1fda096d69fb38eda
child 502120 a7a60ea3a7e06ff5b14a1cbb8c653637362b41bb
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1596339
milestone72.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 1596339 Part 5 - Use ToString() on nsRect in frame tree dump. r=dholbert Differential Revision: https://phabricator.services.mozilla.com/D52966
layout/generic/nsFrame.cpp
layout/generic/nsLineBox.cpp
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -7837,18 +7837,17 @@ void nsIFrame::ListGeneric(nsACString& a
   void* IBsibling = GetProperty(IBSplitSibling());
   if (IBsibling) {
     aTo += nsPrintfCString(" IBSplitSibling=%p", IBsibling);
   }
   void* IBprevsibling = GetProperty(IBSplitPrevSibling());
   if (IBprevsibling) {
     aTo += nsPrintfCString(" IBSplitPrevSibling=%p", IBprevsibling);
   }
-  aTo += nsPrintfCString(" {%d,%d,%d,%d}", mRect.x, mRect.y, mRect.width,
-                         mRect.height);
+  aTo += nsPrintfCString(" %s", ToString(mRect).c_str());
 
   mozilla::WritingMode wm = GetWritingMode();
   if (wm.IsVertical() || wm.IsBidiRTL()) {
     aTo += nsPrintfCString(" wm=%s logical-size=(%s)", ToString(wm).c_str(),
                            ToString(GetLogicalSize()).c_str());
   }
 
   nsIFrame* parent = GetParent();
@@ -7861,23 +7860,21 @@ void nsIFrame::ListGeneric(nsACString& a
                              ToString(pWM).c_str(), containerSize.width,
                              containerSize.height, ToString(lr).c_str());
     }
   }
   nsIFrame* f = const_cast<nsIFrame*>(this);
   if (f->HasOverflowAreas()) {
     nsRect vo = f->GetVisualOverflowRect();
     if (!vo.IsEqualEdges(mRect)) {
-      aTo += nsPrintfCString(" vis-overflow={%d,%d,%d,%d}", vo.x, vo.y,
-                             vo.width, vo.height);
+      aTo += nsPrintfCString(" vis-overflow=%s", ToString(vo).c_str());
     }
     nsRect so = f->GetScrollableOverflowRect();
     if (!so.IsEqualEdges(mRect)) {
-      aTo += nsPrintfCString(" scr-overflow={%d,%d,%d,%d}", so.x, so.y,
-                             so.width, so.height);
+      aTo += nsPrintfCString(" scr-overflow=%s", ToString(so).c_str());
     }
   }
   bool hasNormalPosition;
   nsPoint normalPosition = GetNormalPosition(&hasNormalPosition);
   if (hasNormalPosition) {
     aTo += nsPrintfCString(" normal-position={%d,%d}", normalPosition.x,
                            normalPosition.y);
   }
--- a/layout/generic/nsLineBox.cpp
+++ b/layout/generic/nsLineBox.cpp
@@ -237,35 +237,29 @@ void nsLineBox::List(FILE* out, const ch
   char cbuf[100];
   str += nsPrintfCString("line %p: count=%d state=%s ",
                          static_cast<const void*>(this), GetChildCount(),
                          StateToString(cbuf, sizeof(cbuf)));
   if (IsBlock() && !GetCarriedOutBEndMargin().IsZero()) {
     str += nsPrintfCString("bm=%d ", GetCarriedOutBEndMargin().get());
   }
   nsRect bounds = GetPhysicalBounds();
-  str += nsPrintfCString("{%d,%d,%d,%d} ", bounds.x, bounds.y, bounds.width,
-                         bounds.height);
+  str += nsPrintfCString("%s ", ToString(bounds).c_str());
   if (mWritingMode.IsVertical() || mWritingMode.IsBidiRTL()) {
     str += nsPrintfCString("wm=%s cs={%d,%d} logical-rect=%s ",
                            ToString(mWritingMode).c_str(), mContainerSize.width,
                            mContainerSize.height, ToString(mBounds).c_str());
   }
   if (mData &&
       (!mData->mOverflowAreas.VisualOverflow().IsEqualEdges(bounds) ||
        !mData->mOverflowAreas.ScrollableOverflow().IsEqualEdges(bounds))) {
-    str += nsPrintfCString("vis-overflow=%d,%d,%d,%d scr-overflow=%d,%d,%d,%d ",
-                           mData->mOverflowAreas.VisualOverflow().x,
-                           mData->mOverflowAreas.VisualOverflow().y,
-                           mData->mOverflowAreas.VisualOverflow().width,
-                           mData->mOverflowAreas.VisualOverflow().height,
-                           mData->mOverflowAreas.ScrollableOverflow().x,
-                           mData->mOverflowAreas.ScrollableOverflow().y,
-                           mData->mOverflowAreas.ScrollableOverflow().width,
-                           mData->mOverflowAreas.ScrollableOverflow().height);
+    str += nsPrintfCString(
+        "vis-overflow=%s scr-overflow=%s ",
+        ToString(mData->mOverflowAreas.VisualOverflow()).c_str(),
+        ToString(mData->mOverflowAreas.ScrollableOverflow()).c_str());
   }
   fprintf_stderr(out, "%s<\n", str.get());
 
   nsIFrame* frame = mFirstChild;
   int32_t n = GetChildCount();
   nsCString pfx(aPrefix);
   pfx += "  ";
   while (--n >= 0) {