Title: [288418] trunk/Source/WebCore
Revision
288418
Author
[email protected]
Date
2022-01-23 08:25:32 -0800 (Sun, 23 Jan 2022)

Log Message

[LFC][IFC] LineLayout::contentLogicalHeight should always return the logical height
https://bugs.webkit.org/show_bug.cgi?id=235488

Reviewed by Antti Koivisto.

The display boxes/lines always have visual geometries and in case of vertical writing mode it means that the
content stretches in horiztonal direction (left to right/right to left).

This is in preparation for supporting vertical writing mode.

* layout/integration/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::contentLogicalHeight const):
(WebCore::LayoutIntegration::LineLayout::adjustForPagination):
* layout/integration/LayoutIntegrationLineLayout.h:
(WebCore::LayoutIntegration::LineLayout::isPaginated const):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (288417 => 288418)


--- trunk/Source/WebCore/ChangeLog	2022-01-23 14:48:40 UTC (rev 288417)
+++ trunk/Source/WebCore/ChangeLog	2022-01-23 16:25:32 UTC (rev 288418)
@@ -1,5 +1,23 @@
 2022-01-23  Alan Bujtas  <[email protected]>
 
+        [LFC][IFC] LineLayout::contentLogicalHeight should always return the logical height
+        https://bugs.webkit.org/show_bug.cgi?id=235488
+
+        Reviewed by Antti Koivisto.
+
+        The display boxes/lines always have visual geometries and in case of vertical writing mode it means that the
+        content stretches in horiztonal direction (left to right/right to left).
+
+        This is in preparation for supporting vertical writing mode.
+
+        * layout/integration/LayoutIntegrationLineLayout.cpp:
+        (WebCore::LayoutIntegration::LineLayout::contentLogicalHeight const):
+        (WebCore::LayoutIntegration::LineLayout::adjustForPagination):
+        * layout/integration/LayoutIntegrationLineLayout.h:
+        (WebCore::LayoutIntegration::LineLayout::isPaginated const):
+
+2022-01-23  Alan Bujtas  <[email protected]>
+
         [LFC][IFC] Enable unicode-bidi: plaintext for IFC
         https://bugs.webkit.org/show_bug.cgi?id=235429
 

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp (288417 => 288418)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp	2022-01-23 14:48:40 UTC (rev 288417)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp	2022-01-23 16:25:32 UTC (rev 288418)
@@ -359,13 +359,14 @@
 
 LayoutUnit LineLayout::contentLogicalHeight() const
 {
-    if (m_paginatedHeight)
-        return *m_paginatedHeight;
     if (!m_inlineContent)
         return { };
 
     auto& lines = m_inlineContent->lines;
-    return LayoutUnit { lines.last().lineBoxBottom() - lines.first().lineBoxTop() + m_inlineContent->clearGapAfterLastLine };
+    auto flippedContentHeightForWritingMode = rootLayoutBox().style().isHorizontalWritingMode()
+        ? lines.last().lineBoxBottom() - lines.first().lineBoxTop()
+        : lines.last().lineBoxRight() - lines.first().lineBoxLeft();
+    return LayoutUnit { flippedContentHeightForWritingMode + m_inlineContent->clearGapAfterLastLine };
 }
 
 size_t LineLayout::lineCount() const
@@ -404,13 +405,10 @@
 {
     auto paginedInlineContent = adjustLinePositionsForPagination(*m_inlineContent, flow());
     if (paginedInlineContent.ptr() == m_inlineContent) {
-        m_paginatedHeight = { };
+        m_isPaginatedContent = false;
         return;
     }
-
-    auto& lines = paginedInlineContent->lines;
-    m_paginatedHeight = LayoutUnit { lines.last().lineBoxBottom() - lines.first().lineBoxTop() };
-
+    m_isPaginatedContent = true;
     m_inlineContent = WTFMove(paginedInlineContent);
 }
 

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.h (288417 => 288418)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.h	2022-01-23 14:48:40 UTC (rev 288417)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.h	2022-01-23 16:25:32 UTC (rev 288418)
@@ -95,7 +95,7 @@
     void collectOverflow();
 
     const InlineContent* inlineContent() const { return m_inlineContent.get(); }
-    bool isPaginated() const { return !!m_paginatedHeight; }
+    bool isPaginated() const { return m_isPaginatedContent; }
 
     void paint(PaintInfo&, const LayoutPoint& paintOffset);
     bool hitTest(const HitTestRequest&, HitTestResult&, const HitTestLocation&, const LayoutPoint& accumulatedOffset, HitTestAction);
@@ -143,7 +143,7 @@
     // FIXME: This should be part of LayoutState.
     std::unique_ptr<Layout::InlineDamage> m_lineDamage;
     RefPtr<InlineContent> m_inlineContent;
-    std::optional<LayoutUnit> m_paginatedHeight;
+    bool m_isPaginatedContent { false };
 };
 
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to