Title: [273719] trunk/Source/WebCore
Revision
273719
Author
[email protected]
Date
2021-03-01 19:37:19 -0800 (Mon, 01 Mar 2021)

Log Message

[LFC][IFC] Do not try to run simplified alignment when line-height is set
https://bugs.webkit.org/show_bug.cgi?id=222559

Reviewed by Antti Koivisto.

* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::LineBoxBuilder::LineBoxBuilder):
(WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (273718 => 273719)


--- trunk/Source/WebCore/ChangeLog	2021-03-02 02:14:51 UTC (rev 273718)
+++ trunk/Source/WebCore/ChangeLog	2021-03-02 03:37:19 UTC (rev 273719)
@@ -1,3 +1,14 @@
+2021-03-01  Zalan Bujtas  <[email protected]>
+
+        [LFC][IFC] Do not try to run simplified alignment when line-height is set
+        https://bugs.webkit.org/show_bug.cgi?id=222559
+
+        Reviewed by Antti Koivisto.
+
+        * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
+        (WebCore::Layout::LineBoxBuilder::LineBoxBuilder):
+        (WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes):
+
 2021-03-01  Chris Fleizach  <[email protected]>
 
         AX: VoiceOver announces grid as having "0 columns" and VoiceOver cannot enter the grid

Modified: trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp (273718 => 273719)


--- trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp	2021-03-02 02:14:51 UTC (rev 273718)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp	2021-03-02 03:37:19 UTC (rev 273719)
@@ -148,7 +148,8 @@
 
 LineBoxBuilder::LineBoxBuilder(const InlineFormattingContext& inlineFormattingContext)
     : m_inlineFormattingContext(inlineFormattingContext)
-    , m_useSimplifiedVerticalAlignment(inlineFormattingContext.layoutState().inStandardsMode())
+    // FIXME: Add fast path support for line-height content.
+    , m_useSimplifiedVerticalAlignment(inlineFormattingContext.layoutState().inStandardsMode() && rootBox().style().lineHeight().isNegative())
 {
 }
 
@@ -206,6 +207,8 @@
         InlineLayoutUnit lineBoxTop { 0 };
         InlineLayoutUnit lineBoxBottom { 0 };
         InlineLayoutUnit rootInlineBoxTop { 0 };
+
+        InlineLayoutUnit lineBoxHeight() const { return lineBoxBottom - lineBoxTop; }
     };
     auto& rootInlineBox = lineBox.rootInlineBox();
     setVerticalGeometryForInlineBox(rootInlineBox);
@@ -369,22 +372,11 @@
     }
 
     lineBox.setHasContent(lineHasContent);
-    if (!lineHasContent) {
-        // We should always be able to exercise the fast path when the line has no content at all.
-        m_useSimplifiedVerticalAlignment = true;
-    } else if (m_useSimplifiedVerticalAlignment) {
-        // FIXME: Add fast path support for line-height content.
-        m_useSimplifiedVerticalAlignment = rootBox().style().lineHeight().isNegative();
-    }
-
+    // We should always be able to exercise the fast path when the line has no content at all, even in non-standards mode or with line-height set.
+    m_useSimplifiedVerticalAlignment = m_useSimplifiedVerticalAlignment || !lineHasContent;
     if (m_useSimplifiedVerticalAlignment) {
-        if (!lineHasContent) {
-            simplifiedVerticalAlignment.rootInlineBoxTop = -rootInlineBox.baseline();
-            simplifiedVerticalAlignment.lineBoxTop = { };
-            simplifiedVerticalAlignment.lineBoxBottom = { };
-        }
-        rootInlineBox.setLogicalTop(simplifiedVerticalAlignment.rootInlineBoxTop);
-        lineBox.setLogicalHeight(simplifiedVerticalAlignment.lineBoxBottom - simplifiedVerticalAlignment.lineBoxTop);
+        rootInlineBox.setLogicalTop(lineHasContent ? simplifiedVerticalAlignment.rootInlineBoxTop : -rootInlineBox.baseline());
+        lineBox.setLogicalHeight(lineHasContent ? simplifiedVerticalAlignment.lineBoxHeight() : InlineLayoutUnit());
     }
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to