Title: [285495] trunk
Revision
285495
Author
za...@apple.com
Date
2021-11-09 06:35:50 -0800 (Tue, 09 Nov 2021)

Log Message

Rendering bug with height: min-content, position: absolute, and box-sizing: border-box
https://bugs.webkit.org/show_bug.cgi?id=232816
<rdar://problem/85154265>

Reviewed by Antti Koivisto.

Source/WebCore:

After r199895, computeIntrinsicLogicalContentHeightUsing started returning the inflated height (content height + border + padding)
as content height for border-box box sizing. While some of the callers expect this inflated height, computePositionedLogicalHeightUsing
needs the actual content height. This is also similar to what we do with the width values.

Test: fast/block/out-of-flow-intrinsic-height.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::computePositionedLogicalHeightUsing const):

LayoutTests:

* fast/block/out-of-flow-intrinsic-height-expected.html: Added.
* fast/block/out-of-flow-intrinsic-height.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (285494 => 285495)


--- trunk/LayoutTests/ChangeLog	2021-11-09 14:31:38 UTC (rev 285494)
+++ trunk/LayoutTests/ChangeLog	2021-11-09 14:35:50 UTC (rev 285495)
@@ -1,3 +1,14 @@
+2021-11-09  Alan Bujtas  <za...@apple.com>
+
+        Rendering bug with height: min-content, position: absolute, and box-sizing: border-box
+        https://bugs.webkit.org/show_bug.cgi?id=232816
+        <rdar://problem/85154265>
+
+        Reviewed by Antti Koivisto.
+
+        * fast/block/out-of-flow-intrinsic-height-expected.html: Added.
+        * fast/block/out-of-flow-intrinsic-height.html: Added.
+
 2021-11-09  Commit Queue  <commit-qu...@webkit.org>
 
         Unreviewed, reverting r285486.

Added: trunk/LayoutTests/fast/block/out-of-flow-intrinsic-height-expected.html (0 => 285495)


--- trunk/LayoutTests/fast/block/out-of-flow-intrinsic-height-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/block/out-of-flow-intrinsic-height-expected.html	2021-11-09 14:35:50 UTC (rev 285495)
@@ -0,0 +1,8 @@
+<style>
+div {
+  width: 220px;
+  height: 220px;
+  background-color: green;
+}
+</style>
+<div></div>

Added: trunk/LayoutTests/fast/block/out-of-flow-intrinsic-height.html (0 => 285495)


--- trunk/LayoutTests/fast/block/out-of-flow-intrinsic-height.html	                        (rev 0)
+++ trunk/LayoutTests/fast/block/out-of-flow-intrinsic-height.html	2021-11-09 14:35:50 UTC (rev 285495)
@@ -0,0 +1,24 @@
+<style>
+.test {
+  width: 220px;
+  height: min-content;
+  border: 100px solid green;
+  position: absolute;
+  box-sizing: border-box;
+}
+.content {
+  width: 20px;
+  height: 20px;
+  background-color: green;
+}
+
+.fail {
+  position: absolute;
+  width: 220px;
+  height: 220px;
+  background-color: red;
+}
+</style>
+<!-- PASS if no red -->
+<div class=fail></div>
+<div class=test><div class=content></div></div>

Modified: trunk/Source/WebCore/ChangeLog (285494 => 285495)


--- trunk/Source/WebCore/ChangeLog	2021-11-09 14:31:38 UTC (rev 285494)
+++ trunk/Source/WebCore/ChangeLog	2021-11-09 14:35:50 UTC (rev 285495)
@@ -1,3 +1,20 @@
+2021-11-09  Alan Bujtas  <za...@apple.com>
+
+        Rendering bug with height: min-content, position: absolute, and box-sizing: border-box
+        https://bugs.webkit.org/show_bug.cgi?id=232816
+        <rdar://problem/85154265>
+
+        Reviewed by Antti Koivisto.
+
+        After r199895, computeIntrinsicLogicalContentHeightUsing started returning the inflated height (content height + border + padding)
+        as content height for border-box box sizing. While some of the callers expect this inflated height, computePositionedLogicalHeightUsing
+        needs the actual content height. This is also similar to what we do with the width values.
+
+        Test: fast/block/out-of-flow-intrinsic-height.html
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::computePositionedLogicalHeightUsing const):
+
 2021-11-09  Commit Queue  <commit-qu...@webkit.org>
 
         Unreviewed, reverting r285436.

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (285494 => 285495)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2021-11-09 14:31:38 UTC (rev 285494)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2021-11-09 14:35:50 UTC (rev 285495)
@@ -4343,7 +4343,7 @@
         logicalHeightIsAuto = false;
     } else {
         if (logicalHeightLength.isIntrinsic())
-            resolvedLogicalHeight = computeIntrinsicLogicalContentHeightUsing(logicalHeightLength, contentLogicalHeight, bordersPlusPadding).value();
+            resolvedLogicalHeight = adjustContentBoxLogicalHeightForBoxSizing(computeIntrinsicLogicalContentHeightUsing(logicalHeightLength, contentLogicalHeight, bordersPlusPadding).value());
         else if (fromAspectRatio) {
             resolvedLogicalHeight = blockSizeFromAspectRatio(horizontalBorderAndPaddingExtent(), verticalBorderAndPaddingExtent(), LayoutUnit(style().logicalAspectRatio()), style().boxSizingForAspectRatio(), logicalWidth());
             resolvedLogicalHeight = std::max(LayoutUnit(), resolvedLogicalHeight - bordersPlusPadding);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to