Title: [272724] trunk/Source/WebCore
Revision
272724
Author
[email protected]
Date
2021-02-11 06:46:56 -0800 (Thu, 11 Feb 2021)

Log Message

[LFC][IFC] Inline boxes have incorrect content box height/width values
https://bugs.webkit.org/show_bug.cgi?id=221739

Reviewed by Antti Koivisto.

Do not include horizontal and vertical padding and borders when computing the content box size.

* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
* layout/inlineformatting/InlineLineBox.cpp:
(WebCore::Layout::LineBox::logicalRectForInlineBox const):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (272723 => 272724)


--- trunk/Source/WebCore/ChangeLog	2021-02-11 14:44:10 UTC (rev 272723)
+++ trunk/Source/WebCore/ChangeLog	2021-02-11 14:46:56 UTC (rev 272724)
@@ -1,3 +1,17 @@
+2021-02-11  Zalan Bujtas  <[email protected]>
+
+        [LFC][IFC] Inline boxes have incorrect content box height/width values
+        https://bugs.webkit.org/show_bug.cgi?id=221739
+
+        Reviewed by Antti Koivisto.
+
+        Do not include horizontal and vertical padding and borders when computing the content box size.
+
+        * layout/inlineformatting/InlineFormattingContext.cpp:
+        (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
+        * layout/inlineformatting/InlineLineBox.cpp:
+        (WebCore::Layout::LineBox::logicalRectForInlineBox const):
+
 2021-02-11  Sergio Villar Senin  <[email protected]>
 
         Non unified build fixes for mid February 2021

Modified: trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp (272723 => 272724)


--- trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp	2021-02-11 14:44:10 UTC (rev 272723)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp	2021-02-11 14:46:56 UTC (rev 272724)
@@ -562,8 +562,9 @@
                 // This inline box showed up first on this line.
                 logicalRect.moveHorizontally(boxGeometry.marginStart());
                 boxGeometry.setLogicalTopLeft(logicalRect.topLeft());
-                boxGeometry.setContentBoxHeight(logicalRect.height());
-                auto contentBoxWidth = logicalRect.width();
+                auto contentBoxHeight = logicalRect.height() - (boxGeometry.verticalBorder() + boxGeometry.verticalPadding().valueOr(0_lu));
+                boxGeometry.setContentBoxHeight(contentBoxHeight);
+                auto contentBoxWidth = logicalRect.width() - (boxGeometry.horizontalBorder() + boxGeometry.horizontalPadding().valueOr(0_lu));
                 if (inlineBoxEndSet.contains(&layoutBox)) {
                     // This is a single line inline box.
                     contentBoxWidth -= std::max(0_lu, boxGeometry.marginStart()) + std::max(0_lu, boxGeometry.marginEnd());

Modified: trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.cpp (272723 => 272724)


--- trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.cpp	2021-02-11 14:44:10 UTC (rev 272723)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.cpp	2021-02-11 14:46:56 UTC (rev 272724)
@@ -149,6 +149,7 @@
     auto verticalBorderAndPadding = boxGeometry.verticalBorder() + boxGeometry.verticalPadding().valueOr(0_lu);
     logicalRect.expandVertically(verticalBorderAndPadding);
     logicalRect.moveVertically(-(boxGeometry.borderTop() + boxGeometry.paddingTop().valueOr(0_lu)));
+    // This is essentially margin box rect without the vertical margins.
     return logicalRect;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to