Title: [287248] trunk/Source/WebCore
Revision
287248
Author
[email protected]
Date
2021-12-19 15:55:29 -0800 (Sun, 19 Dec 2021)

Log Message

[LFC][IFC] Add support for RTL text-indent
https://bugs.webkit.org/show_bug.cgi?id=234461

Reviewed by Antti Koivisto.

See https://drafts.csswg.org/css-text/#text-indent-property

* layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:
(WebCore::Layout::LineBoxBuilder::build):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (287247 => 287248)


--- trunk/Source/WebCore/ChangeLog	2021-12-19 20:43:24 UTC (rev 287247)
+++ trunk/Source/WebCore/ChangeLog	2021-12-19 23:55:29 UTC (rev 287248)
@@ -1,3 +1,15 @@
+2021-12-19  Alan Bujtas  <[email protected]>
+
+        [LFC][IFC] Add support for RTL text-indent
+        https://bugs.webkit.org/show_bug.cgi?id=234461
+
+        Reviewed by Antti Koivisto.
+
+        See https://drafts.csswg.org/css-text/#text-indent-property
+
+        * layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:
+        (WebCore::Layout::LineBoxBuilder::build):
+
 2021-12-19  Wenson Hsieh  <[email protected]>
 
         Add client layer plumbing for classifying modal container controls

Modified: trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp (287247 => 287248)


--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp	2021-12-19 20:43:24 UTC (rev 287247)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp	2021-12-19 23:55:29 UTC (rev 287248)
@@ -112,7 +112,14 @@
     auto lineBoxLogicalHeight = constructAndAlignInlineLevelBoxes(lineBox, lineContent.runs, lineIndex);
 
     auto line = [&] {
-        auto lineBoxLogicalRect = InlineRect { lineContent.lineLogicalTopLeft, lineContent.lineLogicalWidth, lineBoxLogicalHeight };
+        auto physicalLeft = lineContent.lineLogicalTopLeft.x();
+        if (!rootStyle.isLeftToRightDirection()) {
+            // https://drafts.csswg.org/css-text/#text-indent-property
+            // Since text-indent only initiates margin start, we just need to pull the linebox back to the left.
+            physicalLeft -= lineContent.lineMarginStart;
+        }
+        // FIXME: Use physical geometry here.
+        auto lineBoxLogicalRect = InlineRect { lineContent.lineLogicalTopLeft.y(), physicalLeft, lineContent.lineLogicalWidth, lineBoxLogicalHeight };
         auto scrollableOverflowRect = lineBoxLogicalRect;
         auto& rootInlineBox = lineBox.rootInlineBox();
         auto enclosingTopAndBottom = InlineDisplay::Line::EnclosingTopAndBottom { lineBoxLogicalRect.top() + rootInlineBox.logicalTop(), lineBoxLogicalRect.top() + rootInlineBox.logicalBottom() };
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to