Title: [273555] trunk/Source/WebCore
Revision
273555
Author
za...@apple.com
Date
2021-02-26 06:48:42 -0800 (Fri, 26 Feb 2021)

Log Message

[LFC][IFC] Include the inline box in the enclosing geometry only once
https://bugs.webkit.org/show_bug.cgi?id=222454

Reviewed by Antti Koivisto.

* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (273554 => 273555)


--- trunk/Source/WebCore/ChangeLog	2021-02-26 14:19:40 UTC (rev 273554)
+++ trunk/Source/WebCore/ChangeLog	2021-02-26 14:48:42 UTC (rev 273555)
@@ -1,3 +1,13 @@
+2021-02-26  Zalan Bujtas  <za...@apple.com>
+
+        [LFC][IFC] Include the inline box in the enclosing geometry only once
+        https://bugs.webkit.org/show_bug.cgi?id=222454
+
+        Reviewed by Antti Koivisto.
+
+        * layout/inlineformatting/InlineFormattingContext.cpp:
+        (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
+
 2021-02-26  Imanol Fernandez  <ifernan...@igalia.com>
 
         Fix clang compilation error in PlatformXR::ViewData initialization

Modified: trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp (273554 => 273555)


--- trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp	2021-02-26 14:19:40 UTC (rev 273554)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp	2021-02-26 14:48:42 UTC (rev 273555)
@@ -535,8 +535,12 @@
             }
             if (lineRun.isInlineBoxEnd()) {
                 inlineBoxEndSet.add(&layoutBox);
-                auto inlineBoxLogicalRect = lineBox.logicalBorderBoxForInlineBox(layoutBox, formattingState.boxGeometry(layoutBox));
-                enclosingTopAndBottom.bottom = std::max(enclosingTopAndBottom.bottom, inlineBoxLogicalRect.bottom());
+                if (!inlineBoxStartSet.contains(&layoutBox)) {
+                    // An inline box can span multiple lines. Use the [inline box end] signal to include it in the enclosing geometry
+                    // only when it starts at a previous line.
+                    auto inlineBoxLogicalRect = lineBox.logicalBorderBoxForInlineBox(layoutBox, formattingState.boxGeometry(layoutBox));
+                    enclosingTopAndBottom.bottom = std::max(enclosingTopAndBottom.bottom, inlineBoxLogicalRect.bottom());
+                }
                 continue;
             }
             ASSERT(lineRun.isWordBreakOpportunity());
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to