Title: [287205] trunk/Source/WebCore
Revision
287205
Author
[email protected]
Date
2021-12-17 13:51:19 -0800 (Fri, 17 Dec 2021)

Log Message

[LFC][IFC] Use the inline box's direction to decide if start/end decorations should be applied on first/last box
https://bugs.webkit.org/show_bug.cgi?id=234423

Reviewed by Antti Koivisto.

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (287204 => 287205)


--- trunk/Source/WebCore/ChangeLog	2021-12-17 21:39:12 UTC (rev 287204)
+++ trunk/Source/WebCore/ChangeLog	2021-12-17 21:51:19 UTC (rev 287205)
@@ -1,5 +1,15 @@
 2021-12-17  Alan Bujtas  <[email protected]>
 
+        [LFC][IFC] Use the inline box's direction to decide if start/end decorations should be applied on first/last box
+        https://bugs.webkit.org/show_bug.cgi?id=234423
+
+        Reviewed by Antti Koivisto.
+
+        * layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp:
+        (WebCore::Layout::InlineDisplayContentBuilder::adjustVisualGeometryForDisplayBox):
+
+2021-12-17  Alan Bujtas  <[email protected]>
+
         [LFC][IFC] Adjust the box geometry for atomic/generic inline level boxes in bidi content
         https://bugs.webkit.org/show_bug.cgi?id=234419
 

Modified: trunk/Source/WebCore/layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp (287204 => 287205)


--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp	2021-12-17 21:39:12 UTC (rev 287204)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp	2021-12-17 21:51:19 UTC (rev 287205)
@@ -484,7 +484,8 @@
     auto beforeInlineBoxContent = [&] {
         auto logicalRect = lineBox.logicalBorderBoxForInlineBox(layoutBox, boxGeometry);
         auto visualRect = InlineRect { lineBoxLogicalTop + logicalRect.top(), contentRightInVisualOrder, { }, logicalRect.height() };
-        if (!isFirstBox)
+        auto shouldApplyLeftSide = (isLeftToRightDirection && isFirstBox) || (!isLeftToRightDirection && isLastBox);
+        if (!shouldApplyLeftSide)
             return displayBox.setRect(visualRect, visualRect);
 
         contentRightInVisualOrder += marginLeft(boxGeometry, isLeftToRightDirection);
@@ -498,7 +499,8 @@
         adjustVisualGeometryForDisplayBox(childDisplayBoxNodeIndex, contentRightInVisualOrder, lineBoxLogicalTop, displayBoxTree, boxes, lineBox, isFirstLastIndexesMap);
 
     auto afterInlineBoxContent = [&] {
-        if (!isLastBox)
+        auto shouldApplyRightSide = (isLeftToRightDirection && isLastBox) || (!isLeftToRightDirection && isFirstBox);
+        if (!shouldApplyRightSide)
             return displayBox.setRight(contentRightInVisualOrder);
 
         contentRightInVisualOrder += borderRight(boxGeometry, isLeftToRightDirection) + paddingRight(boxGeometry, isLeftToRightDirection);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to