Title: [269064] trunk/Source/WebCore
Revision
269064
Author
[email protected]
Date
2020-10-27 12:40:15 -0700 (Tue, 27 Oct 2020)

Log Message

showRenderTree should output line vertical geometry.
https://bugs.webkit.org/show_bug.cgi?id=218252

Reviewed by Antti Koivisto.

In addition to the root inlinebox geometry, we should also print the line vertical geometry as they
could be very different in certain cases.

<div style="line-height: 100px;">
  text
  <img src="" style="width: 50px; height: 50px;">
</div>

would produce something these:

Line: (top: 5 bottom: 59) with leading (top: 0 bottom: 100)
RootInlineBox at (0,41) size 51.76x18 (0x137faef70) renderer->(0x137faec00)

* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::outputLineBox const):
* rendering/RootInlineBox.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (269063 => 269064)


--- trunk/Source/WebCore/ChangeLog	2020-10-27 19:33:13 UTC (rev 269063)
+++ trunk/Source/WebCore/ChangeLog	2020-10-27 19:40:15 UTC (rev 269064)
@@ -1,3 +1,27 @@
+2020-10-27  Zalan Bujtas  <[email protected]>
+
+        showRenderTree should output line vertical geometry.
+        https://bugs.webkit.org/show_bug.cgi?id=218252
+
+        Reviewed by Antti Koivisto.
+
+        In addition to the root inlinebox geometry, we should also print the line vertical geometry as they
+        could be very different in certain cases.
+
+        <div style="line-height: 100px;">
+          text
+          <img src="" style="width: 50px; height: 50px;">
+        </div>
+
+        would produce something these:
+
+        Line: (top: 5 bottom: 59) with leading (top: 0 bottom: 100)
+        RootInlineBox at (0,41) size 51.76x18 (0x137faef70) renderer->(0x137faec00)
+
+        * rendering/RootInlineBox.cpp:
+        (WebCore::RootInlineBox::outputLineBox const):
+        * rendering/RootInlineBox.h:
+
 2020-10-27  Tetsuharu Ohzeki  <[email protected]>
 
         Accessory bar next/previous buttons do not work on inputs in shadow roots

Modified: trunk/Source/WebCore/rendering/RootInlineBox.cpp (269063 => 269064)


--- trunk/Source/WebCore/rendering/RootInlineBox.cpp	2020-10-27 19:33:13 UTC (rev 269063)
+++ trunk/Source/WebCore/rendering/RootInlineBox.cpp	2020-10-27 19:40:15 UTC (rev 269064)
@@ -1110,6 +1110,18 @@
 }
 
 #if ENABLE(TREE_DEBUGGING)
+
+void RootInlineBox::outputLineBox(WTF::TextStream& stream, bool mark, int depth) const
+{
+    stream << "-------- --";
+    int printedCharacters = 0;
+    while (++printedCharacters <= depth * 2)
+        stream << " ";
+    stream << "Line: (top: " << lineTop() << " bottom: " << lineBottom() << ") with leading (top: " << lineTopWithLeading() << " bottom: " << lineBottomWithLeading() << ")";
+    stream.nextLine();
+    InlineBox::outputLineBox(stream, mark, depth);
+}
+
 const char* RootInlineBox::boxName() const
 {
     return "RootInlineBox";

Modified: trunk/Source/WebCore/rendering/RootInlineBox.h (269063 => 269064)


--- trunk/Source/WebCore/rendering/RootInlineBox.h	2020-10-27 19:33:13 UTC (rev 269063)
+++ trunk/Source/WebCore/rendering/RootInlineBox.h	2020-10-27 19:40:15 UTC (rev 269064)
@@ -194,6 +194,7 @@
     virtual bool isTrailingFloatsRootInlineBox() const { return false; }
 
 #if ENABLE(TREE_DEBUGGING)
+    void outputLineBox(WTF::TextStream&, bool mark, int depth) const final;
     const char* boxName() const final;
 #endif
 private:
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to