Title: [271782] trunk/Source/WebCore
Revision
271782
Author
[email protected]
Date
2021-01-24 09:59:48 -0800 (Sun, 24 Jan 2021)

Log Message

[LFC][IFC] Ceil inline level box's width and height values when converting from float to LayoutUnit
https://bugs.webkit.org/show_bug.cgi?id=220898

Reviewed by Antti Koivisto.

It ensures that the inline level box always encloses the content.

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (271781 => 271782)


--- trunk/Source/WebCore/ChangeLog	2021-01-23 22:11:28 UTC (rev 271781)
+++ trunk/Source/WebCore/ChangeLog	2021-01-24 17:59:48 UTC (rev 271782)
@@ -1,3 +1,15 @@
+2021-01-24  Zalan Bujtas  <[email protected]>
+
+        [LFC][IFC] Ceil inline level box's width and height values when converting from float to LayoutUnit
+        https://bugs.webkit.org/show_bug.cgi?id=220898
+
+        Reviewed by Antti Koivisto.
+
+        It ensures that the inline level box always encloses the content.
+
+        * layout/inlineformatting/InlineFormattingContext.cpp:
+        (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
+
 2021-01-23  Eric Carlson  <[email protected]>
 
         [iOS] Set background playback restriction for WebAudio

Modified: trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp (271781 => 271782)


--- trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp	2021-01-23 22:11:28 UTC (rev 271781)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp	2021-01-24 17:59:48 UTC (rev 271782)
@@ -525,7 +525,8 @@
             auto& boxGeometry = formattingState.boxGeometry(layoutBox);
             // Inline boxes may or may not be wrapped and have runs on multiple lines (e.g. <span>first line<br>second line<br>third line</span>)
             auto inlineBoxMarginRect = lineBox.logicalMarginRectForInlineLevelBox(layoutBox, boxGeometry);
-            auto logicalRect = Rect { LayoutPoint { inlineBoxMarginRect.topLeft() }, LayoutSize { inlineBoxMarginRect.size() } };
+            auto inlineBoxSize = LayoutSize { LayoutUnit::fromFloatCeil(inlineBoxMarginRect.width()), LayoutUnit::fromFloatCeil(inlineBoxMarginRect.height()) };
+            auto logicalRect = Rect { LayoutPoint { inlineBoxMarginRect.topLeft() }, inlineBoxSize };
             logicalRect.moveBy(LayoutPoint { lineBoxLogicalRect.topLeft() });
             if (inlineBoxStartSet.contains(&layoutBox)) {
                 // This inline box showed up first on this line.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to