Title: [281645] trunk/Source/WebCore
Revision
281645
Author
[email protected]
Date
2021-08-26 12:31:45 -0700 (Thu, 26 Aug 2021)

Log Message

[IFC] Use the inline run list in showRenderTree to print inline level box information
https://bugs.webkit.org/show_bug.cgi?id=228070

Reviewed by Antti Koivisto.

showInlineTreeAndRuns is the last client of the InlineFormattingState::lineBoxes.
Let's use the inline run list instead to print the inline level box geometry information. It provides slightly less
information than before but it is sufficient for now.

This is in preparation for keeping the inline box structure private to the layout code.

* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::showInlineTreeAndRuns):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (281644 => 281645)


--- trunk/Source/WebCore/ChangeLog	2021-08-26 19:30:32 UTC (rev 281644)
+++ trunk/Source/WebCore/ChangeLog	2021-08-26 19:31:45 UTC (rev 281645)
@@ -1,3 +1,19 @@
+2021-08-26  Alan Bujtas  <[email protected]>
+
+        [IFC] Use the inline run list in showRenderTree to print inline level box information
+        https://bugs.webkit.org/show_bug.cgi?id=228070
+
+        Reviewed by Antti Koivisto.
+
+        showInlineTreeAndRuns is the last client of the InlineFormattingState::lineBoxes.
+        Let's use the inline run list instead to print the inline level box geometry information. It provides slightly less
+        information than before but it is sufficient for now.
+
+        This is in preparation for keeping the inline box structure private to the layout code.
+
+        * layout/layouttree/LayoutTreeBuilder.cpp:
+        (WebCore::Layout::showInlineTreeAndRuns):
+
 2021-08-26  Michael Catanzaro  <[email protected]>
 
         [FreeType] Avoid yucky strong alias computations in font fallback code

Modified: trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp (281644 => 281645)


--- trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp	2021-08-26 19:30:32 UTC (rev 281644)
+++ trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp	2021-08-26 19:31:45 UTC (rev 281645)
@@ -387,7 +387,7 @@
 {
     auto& inlineFormattingState = layoutState.establishedInlineFormattingState(inlineFormattingRoot);
     auto& lines = inlineFormattingState.lines();
-    auto& lineBoxes = inlineFormattingState.lineBoxes();
+    auto& lineRuns = inlineFormattingState.lineRuns();
 
     for (size_t lineIndex = 0; lineIndex < lines.size(); ++lineIndex) {
         auto addSpacing = [&] {
@@ -408,42 +408,36 @@
         stream << "  Inline level boxes:";
         stream.nextLine();
 
-        auto& lineBox = lineBoxes[lineIndex];
-        auto outputInlineLevelBox = [&](const auto& inlineLevelBox) {
+        auto outputInlineLevelBox = [&](const auto& inlineLevelBoxRun) {
             addSpacing();
             stream << "    ";
-            auto logicalRect = InlineRect { };
-            auto& layoutBox = inlineLevelBox.layoutBox();
-            if (inlineLevelBox.isRootInlineBox()) {
-                stream << "Root inline box";
-                logicalRect = lineBox.logicalRectForRootInlineBox();
-            } else if (inlineLevelBox.isAtomicInlineLevelBox()) {
+            auto logicalRect = inlineLevelBoxRun.logicalRect();
+            auto& layoutBox = inlineLevelBoxRun.layoutBox();
+            if (layoutBox.isAtomicInlineLevelBox())
                 stream << "Atomic inline level box";
-                logicalRect = lineBox.logicalBorderBoxForAtomicInlineLevelBox(layoutBox, layoutState.geometryForBox(layoutBox));
-            } else if (inlineLevelBox.isLineBreakBox()) {
+            else if (layoutBox.isLineBreakBox())
                 stream << "Line break box";
-                logicalRect = lineBox.logicalRectForLineBreakBox(layoutBox);
-            } else if (inlineLevelBox.isInlineBox()) {
+            else if (layoutBox.isInlineBox())
                 stream << "Inline box";
-                logicalRect = lineBox.logicalBorderBoxForInlineBox(layoutBox, layoutState.geometryForBox(layoutBox));
-            } else
+            else
                 stream << "Generic inline level box";
             stream
                 << " at (" << logicalRect.left() << "," << logicalRect.top() << ")"
-                << " size (" << logicalRect.width() << "x" << logicalRect.height() << ")"
-                << " baseline (" << logicalRect.top() + inlineLevelBox.baseline() << ")"
-                << " ascent (" << inlineLevelBox.baseline() << "/" << inlineLevelBox.layoutBounds().ascent << ")"
-                << " descent (" << inlineLevelBox.descent().value_or(0.0f) << "/" << inlineLevelBox.layoutBounds().descent << ")";
+                << " size (" << logicalRect.width() << "x" << logicalRect.height() << ")";
             stream.nextLine();
         };
-        outputInlineLevelBox(lineBox.rootInlineBox());
-        for (auto& inlineLevelBox : lineBox.nonRootInlineLevelBoxes())
-            outputInlineLevelBox(inlineLevelBox);
+        for (auto& run : lineRuns) {
+            if (run.lineIndex() != lineIndex)
+                continue;
+            if (!run.layoutBox().isInlineLevelBox())
+                continue;
+            outputInlineLevelBox(run);
+        }
 
         addSpacing();
         stream << "  Runs:";
         stream.nextLine();
-        for (auto& run : inlineFormattingState.lineRuns()) {
+        for (auto& run : lineRuns) {
             if (run.lineIndex() != lineIndex)
                 continue;
             addSpacing();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to