Title: [289542] trunk/Source/WebCore
Revision
289542
Author
[email protected]
Date
2022-02-10 09:28:00 -0800 (Thu, 10 Feb 2022)

Log Message

[LFC][IFC] Prepare InlineDisplayContentBuilder::adjustVisualGeometryForDisplayBox for supporting vertical writing mode
https://bugs.webkit.org/show_bug.cgi?id=236400

Reviewed by Antti Koivisto.

This is just a small cleanup patch to make the vertical writing mode code easier to adopt.

* layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:
(WebCore::Layout::InlineDisplayContentBuilder::adjustVisualGeometryForDisplayBox):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (289541 => 289542)


--- trunk/Source/WebCore/ChangeLog	2022-02-10 17:04:20 UTC (rev 289541)
+++ trunk/Source/WebCore/ChangeLog	2022-02-10 17:28:00 UTC (rev 289542)
@@ -1,3 +1,15 @@
+2022-02-10  Alan Bujtas  <[email protected]>
+
+        [LFC][IFC] Prepare InlineDisplayContentBuilder::adjustVisualGeometryForDisplayBox for supporting vertical writing mode
+        https://bugs.webkit.org/show_bug.cgi?id=236400
+
+        Reviewed by Antti Koivisto.
+
+        This is just a small cleanup patch to make the vertical writing mode code easier to adopt.
+
+        * layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:
+        (WebCore::Layout::InlineDisplayContentBuilder::adjustVisualGeometryForDisplayBox):
+
 2022-02-10  Tyler Wilcock  <[email protected]>
 
         AX: Log more information when the wrapper or the wrapper's backing object is detached

Modified: trunk/Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp (289541 => 289542)


--- trunk/Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp	2022-02-10 17:04:20 UTC (rev 289541)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp	2022-02-10 17:28:00 UTC (rev 289542)
@@ -473,13 +473,12 @@
             auto isLeftToRightDirection = layoutBox.parent().style().isLeftToRightDirection();
             auto& boxGeometry = formattingState().boxGeometry(layoutBox);
             auto boxMarginLeft = marginLeftInInlineDirection(boxGeometry, isLeftToRightDirection);
-            auto boxMarginRight = marginRightInInlineDirection(boxGeometry, isLeftToRightDirection);
 
             auto borderBoxLeft = LayoutUnit { contentRightInInlineDirectionVisualOrder + boxMarginLeft };
             boxGeometry.setLogicalLeft(borderBoxLeft);
             displayBox.setLeft(borderBoxLeft);
 
-            contentRightInInlineDirectionVisualOrder += boxMarginLeft + displayBox.width() + boxMarginRight;
+            contentRightInInlineDirectionVisualOrder += boxGeometry.marginBoxWidth();
         } else {
             auto wordSpacingMargin = displayBox.isWordSeparator() ? layoutBox.style().fontCascade().wordSpacing() : 0.0f;
             displayBox.setLeft(contentRightInInlineDirectionVisualOrder + wordSpacingMargin);
@@ -501,7 +500,8 @@
             return displayBox.setRect(visualRect, visualRect);
 
         contentRightInInlineDirectionVisualOrder += marginLeftInInlineDirection(boxGeometry, isLeftToRightDirection);
-        auto visualRectWithMarginLeft = InlineRect { visualRect.top(), contentRightInInlineDirectionVisualOrder, visualRect.width(), visualRect.height() };
+        auto visualRectWithMarginLeft = visualRect;
+        visualRectWithMarginLeft.setLeft(contentRightInInlineDirectionVisualOrder);
         displayBox.setRect(visualRectWithMarginLeft, visualRectWithMarginLeft);
         contentRightInInlineDirectionVisualOrder += borderLeftInInlineDirection(boxGeometry, isLeftToRightDirection) + paddingLeftInInlineDirection(boxGeometry, isLeftToRightDirection);
     };
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to