Title: [289709] trunk/Source/WebCore
Revision
289709
Author
[email protected]
Date
2022-02-13 06:48:03 -0800 (Sun, 13 Feb 2022)

Log Message

[LFC][IFC] Baseline value is always logical
https://bugs.webkit.org/show_bug.cgi?id=236549

Reviewed by Antti Koivisto.

Callers expect the baseline value to be always logical.

* layout/integration/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::firstLineBaseline const):
(WebCore::LayoutIntegration::LineLayout::lastLineBaseline const):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (289708 => 289709)


--- trunk/Source/WebCore/ChangeLog	2022-02-13 14:39:59 UTC (rev 289708)
+++ trunk/Source/WebCore/ChangeLog	2022-02-13 14:48:03 UTC (rev 289709)
@@ -1,3 +1,16 @@
+2022-02-13  Alan Bujtas  <[email protected]>
+
+        [LFC][IFC] Baseline value is always logical
+        https://bugs.webkit.org/show_bug.cgi?id=236549
+
+        Reviewed by Antti Koivisto.
+
+        Callers expect the baseline value to be always logical.
+
+        * layout/integration/LayoutIntegrationLineLayout.cpp:
+        (WebCore::LayoutIntegration::LineLayout::firstLineBaseline const):
+        (WebCore::LayoutIntegration::LineLayout::lastLineBaseline const):
+
 2022-02-13  Philippe Normand  <[email protected]>
 
         Unreviewed, fix build when ATSPI is disabled

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp (289708 => 289709)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp	2022-02-13 14:39:59 UTC (rev 289708)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp	2022-02-13 14:48:03 UTC (rev 289709)
@@ -426,7 +426,12 @@
     }
 
     auto& firstLine = m_inlineContent->lines.first();
-    return LayoutUnit { firstLine.lineBoxTop() + firstLine.baseline() };
+    if (rootLayoutBox().style().isHorizontalWritingMode())
+        return LayoutUnit { firstLine.lineBoxTop() + firstLine.baseline() };
+
+    // See LineLayout::lastLineBaseline below for more info.
+    auto lineLogicalTop = flow().logicalHeight() - firstLine.lineBoxRight();
+    return LayoutUnit { lineLogicalTop + firstLine.baseline() };
 }
 
 LayoutUnit LineLayout::lastLineBaseline() const
@@ -437,7 +442,15 @@
     }
 
     auto& lastLine = m_inlineContent->lines.last();
-    return LayoutUnit { lastLine.lineBoxTop() + lastLine.baseline() };
+    if (rootLayoutBox().style().isHorizontalWritingMode())
+        return LayoutUnit { lastLine.lineBoxTop() + lastLine.baseline() };
+
+    // FIXME: We should set the computed height on the root's box geometry (in RenderBlockFlow) so that
+    // we could call m_layoutState.geometryForRootBox().borderBoxHeight() instead.
+
+    // Line is always visual coordinates while logicalHeight is not (i.e. this translate to "box visual width" - "line visual right")
+    auto lineLogicalTop = flow().logicalHeight() - lastLine.lineBoxRight();
+    return LayoutUnit { lineLogicalTop + lastLine.baseline() };
 }
 
 void LineLayout::adjustForPagination()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to