Title: [285782] trunk/Source/WebCore
Revision
285782
Author
za...@apple.com
Date
2021-11-13 15:04:43 -0800 (Sat, 13 Nov 2021)

Log Message

[LFC][Integration] Bring showRenderTree for IFC integration back
https://bugs.webkit.org/show_bug.cgi?id=233000

Reviewed by Antti Koivisto.

Currently showRenderTree comes back blank for IFC content.

* layout/integration/LayoutIntegrationBoxTree.cpp:
(WebCore::LayoutIntegration::showInlineContent):
* layout/integration/LayoutIntegrationBoxTree.h:
* layout/integration/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::outputLineTree const):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (285781 => 285782)


--- trunk/Source/WebCore/ChangeLog	2021-11-13 23:04:06 UTC (rev 285781)
+++ trunk/Source/WebCore/ChangeLog	2021-11-13 23:04:43 UTC (rev 285782)
@@ -1,5 +1,20 @@
 2021-11-13  Alan Bujtas  <za...@apple.com>
 
+        [LFC][Integration] Bring showRenderTree for IFC integration back
+        https://bugs.webkit.org/show_bug.cgi?id=233000
+
+        Reviewed by Antti Koivisto.
+
+        Currently showRenderTree comes back blank for IFC content.
+
+        * layout/integration/LayoutIntegrationBoxTree.cpp:
+        (WebCore::LayoutIntegration::showInlineContent):
+        * layout/integration/LayoutIntegrationBoxTree.h:
+        * layout/integration/LayoutIntegrationLineLayout.cpp:
+        (WebCore::LayoutIntegration::LineLayout::outputLineTree const):
+
+2021-11-13  Alan Bujtas  <za...@apple.com>
+
         [LFC][IFC] Inline box end (opaque to bidi) should get the bidi level from its adjacent content
         https://bugs.webkit.org/show_bug.cgi?id=233082
 

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationBoxTree.cpp (285781 => 285782)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationBoxTree.cpp	2021-11-13 23:04:06 UTC (rev 285781)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationBoxTree.cpp	2021-11-13 23:04:43 UTC (rev 285782)
@@ -248,8 +248,79 @@
     return const_cast<BoxTree&>(*this).rendererForLayoutBox(box);
 }
 
+#if ENABLE(TREE_DEBUGGING)
+void showInlineContent(TextStream& stream, const InlineContent& inlineContent, size_t depth)
+{
+    auto& lines = inlineContent.lines;
+    auto& boxes = inlineContent.boxes;
+
+    for (size_t lineIndex = 0; lineIndex < lines.size(); ++lineIndex) {
+        auto addSpacing = [&] {
+            size_t printedCharacters = 0;
+            stream << "-------- --";
+            while (++printedCharacters <= depth * 2)
+                stream << " ";
+
+        };
+        addSpacing();
+        auto& line = lines[lineIndex];
+        stream << "line at (" << line.lineBoxLeft() << "," << line.lineBoxTop() << ") size (" << line.lineBoxRight() - line.lineBoxLeft() << "x" << line.lineBoxBottom() - line.lineBoxTop() << ") baseline (" << line.baseline() << ") enclosing top (" << line.enclosingContentTop() << ") bottom (" << line.enclosingContentBottom() << ")";
+        stream.nextLine();
+
+        addSpacing();
+        stream << "  Inline level boxes:";
+        stream.nextLine();
+
+        auto outputInlineLevelBox = [&](const auto& inlineLevelBox) {
+            addSpacing();
+            stream << "    ";
+            auto logicalRect = inlineLevelBox.logicalRect();
+            auto& layoutBox = inlineLevelBox.layoutBox();
+            if (layoutBox.isAtomicInlineLevelBox())
+                stream << "Atomic inline level box";
+            else if (layoutBox.isLineBreakBox())
+                stream << "Line break box";
+            else if (layoutBox.isInlineBox())
+                stream << "Inline box";
+            else
+                stream << "Generic inline level box";
+            stream
+                << " at (" << logicalRect.left() << "," << logicalRect.top() << ")"
+                << " size (" << logicalRect.width() << "x" << logicalRect.height() << ")";
+            stream.nextLine();
+        };
+        for (auto& box : boxes) {
+            if (box.lineIndex() != lineIndex)
+                continue;
+            if (!box.layoutBox().isInlineLevelBox())
+                continue;
+            outputInlineLevelBox(box);
+        }
+
+        addSpacing();
+        stream << "  Runs:";
+        stream.nextLine();
+        for (auto& box : boxes) {
+            if (box.lineIndex() != lineIndex)
+                continue;
+            addSpacing();
+            stream << "    ";
+            if (box.text())
+                stream << "text box";
+            else
+                stream << "box box";
+            stream << " at (" << box.logicalLeft() << "," << box.logicalTop() << ") size " << box.logicalWidth() << "x" << box.logicalHeight();
+            if (box.text())
+                stream << " box(" << box.text()->start() << ", " << box.text()->end() << ")";
+            stream.nextLine();
+        }
+
+    }
 }
+#endif
+
 }
+}
 
 #endif
 

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationBoxTree.h (285781 => 285782)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationBoxTree.h	2021-11-13 23:04:06 UTC (rev 285781)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationBoxTree.h	2021-11-13 23:04:43 UTC (rev 285782)
@@ -77,6 +77,9 @@
     HashMap<CheckedRef<const Layout::Box>, RenderObject*> m_boxToRendererMap;
 };
 
+#if ENABLE(TREE_DEBUGGING)
+void showInlineContent(TextStream&, const InlineContent&, size_t depth);
+#endif
 }
 }
 

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp (285781 => 285782)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp	2021-11-13 23:04:06 UTC (rev 285781)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp	2021-11-13 23:04:43 UTC (rev 285782)
@@ -634,7 +634,7 @@
 #if ENABLE(TREE_DEBUGGING)
 void LineLayout::outputLineTree(WTF::TextStream& stream, size_t depth) const
 {
-    showInlineTreeAndRuns(stream, m_layoutState, rootLayoutBox(), depth);
+    showInlineContent(stream, *m_inlineContent, depth);
 }
 #endif
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to