Title: [289376] trunk/Source/WebCore
Revision
289376
Author
[email protected]
Date
2022-02-08 07:55:58 -0800 (Tue, 08 Feb 2022)

Log Message

[LFC][IFC] Add support for ideographic baseline on atomic inline level boxes
https://bugs.webkit.org/show_bug.cgi?id=236258

Reviewed by Antti Koivisto.

This is in preparation for adding vertical writing mode support (now we pass all the replaced tests under imported/w3c/web-platform-tests/css/css-writing-modes).

* layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:
(WebCore::Layout::LineBoxBuilder::adjustIdeographicBaselineIfApplicable): see RenderBox::baselinePosition() for the math.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (289375 => 289376)


--- trunk/Source/WebCore/ChangeLog	2022-02-08 15:06:53 UTC (rev 289375)
+++ trunk/Source/WebCore/ChangeLog	2022-02-08 15:55:58 UTC (rev 289376)
@@ -1,5 +1,17 @@
 2022-02-08  Alan Bujtas  <[email protected]>
 
+        [LFC][IFC] Add support for ideographic baseline on atomic inline level boxes
+        https://bugs.webkit.org/show_bug.cgi?id=236258
+
+        Reviewed by Antti Koivisto.
+
+        This is in preparation for adding vertical writing mode support (now we pass all the replaced tests under imported/w3c/web-platform-tests/css/css-writing-modes).
+
+        * layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:
+        (WebCore::Layout::LineBoxBuilder::adjustIdeographicBaselineIfApplicable): see RenderBox::baselinePosition() for the math.
+
+2022-02-08  Alan Bujtas  <[email protected]>
+
         [LFC][IFC] Take writing direction into account when applying RenderBlockFlow end padding quirk
         https://bugs.webkit.org/show_bug.cgi?id=236280
 

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


--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp	2022-02-08 15:06:53 UTC (rev 289375)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp	2022-02-08 15:55:58 UTC (rev 289376)
@@ -380,6 +380,11 @@
         else if (inlineLevelBox.isLineBreakBox()) {
             auto& parentInlineBox = lineBox.inlineLevelBoxForLayoutBox(inlineLevelBox.layoutBox().parent());
             setBaselineAndLayoutBounds(inlineLevelBox, layoutBoundsMetricsForInlineBox(parentInlineBox, IdeographicBaseline));
+        } else if (inlineLevelBox.isAtomicInlineLevelBox()) {
+            auto alphabeticBaseline = inlineLevelBox.ascent();
+            InlineLayoutUnit ideographicBaseline = roundToInt(alphabeticBaseline / 2);
+            // Move the baseline position but keep the same logical height.
+            setBaselineAndLayoutBounds(inlineLevelBox, { ideographicBaseline, inlineLevelBox.layoutBounds().descent + (alphabeticBaseline - ideographicBaseline) });
         }
     }
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to