Title: [270891] trunk
Revision
270891
Author
[email protected]
Date
2020-12-16 08:13:18 -0800 (Wed, 16 Dec 2020)

Log Message

[LFC][BFC] Non-quantitative values such as auto and min-content are not influenced by the box-sizing property
https://bugs.webkit.org/show_bug.cgi?id=219944

Reviewed by Antti Koivisto.
Source/WebCore:

See https://www.w3.org/TR/css-sizing-3/#box-sizing

Test: fast/layoutformattingcontext/max-content-and-box-sizing-simple.html

* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::computedWidth):

LayoutTests:

Need to fix it in RenderBox first to be able to geometry-test it (webkit.org/b/219687).

* fast/layoutformattingcontext/max-content-and-box-sizing-simple-expected.html: Added.
* fast/layoutformattingcontext/max-content-and-box-sizing-simple.html: Added.
* platform/mac-wk2/TestExpectations:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (270890 => 270891)


--- trunk/LayoutTests/ChangeLog	2020-12-16 16:12:13 UTC (rev 270890)
+++ trunk/LayoutTests/ChangeLog	2020-12-16 16:13:18 UTC (rev 270891)
@@ -1,3 +1,16 @@
+2020-12-16  Zalan Bujtas  <[email protected]>
+
+        [LFC][BFC] Non-quantitative values such as auto and min-content are not influenced by the box-sizing property
+        https://bugs.webkit.org/show_bug.cgi?id=219944
+
+        Reviewed by Antti Koivisto.
+        
+        Need to fix it in RenderBox first to be able to geometry-test it (webkit.org/b/219687).
+
+        * fast/layoutformattingcontext/max-content-and-box-sizing-simple-expected.html: Added.
+        * fast/layoutformattingcontext/max-content-and-box-sizing-simple.html: Added.
+        * platform/mac-wk2/TestExpectations:
+
 2020-12-16  Antti Koivisto  <[email protected]>
 
         Remove simpleUserAgentStyleSheet (to fix flaky fast/lists/001.html and fast/lists/001-vertical.html)

Added: trunk/LayoutTests/fast/layoutformattingcontext/max-content-and-box-sizing-simple-expected.html (0 => 270891)


--- trunk/LayoutTests/fast/layoutformattingcontext/max-content-and-box-sizing-simple-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/layoutformattingcontext/max-content-and-box-sizing-simple-expected.html	2020-12-16 16:13:18 UTC (rev 270891)
@@ -0,0 +1,9 @@
+<!-- webkit-test-runner [ LayoutFormattingContextEnabled=true LayoutFormattingContextIntegrationEnabled=false ] -->
+<style>
+div {
+  position: absolute;
+  padding: 1px;
+  border: 1px solid green;
+}
+</style>
+<div>PASS if there's only one line here (no wrapping).</div>

Added: trunk/LayoutTests/fast/layoutformattingcontext/max-content-and-box-sizing-simple.html (0 => 270891)


--- trunk/LayoutTests/fast/layoutformattingcontext/max-content-and-box-sizing-simple.html	                        (rev 0)
+++ trunk/LayoutTests/fast/layoutformattingcontext/max-content-and-box-sizing-simple.html	2020-12-16 16:13:18 UTC (rev 270891)
@@ -0,0 +1,11 @@
+<!-- webkit-test-runner [ LayoutFormattingContextEnabled=true LayoutFormattingContextIntegrationEnabled=false ] -->
+<style>
+div {
+  position: absolute;
+  box-sizing: border-box; 
+  width: max-content;
+  padding: 1px;
+  border: 1px solid green;
+}
+</style>
+<div>PASS if there's only one line here (no wrapping).</div>

Modified: trunk/LayoutTests/platform/mac/TestExpectations (270890 => 270891)


--- trunk/LayoutTests/platform/mac/TestExpectations	2020-12-16 16:12:13 UTC (rev 270890)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2020-12-16 16:13:18 UTC (rev 270891)
@@ -2256,3 +2256,5 @@
 webkit.org/b/219225 http/tests/inspector/dom/disconnect-dom-tree-after-main-frame-navigation.html [ Pass Failure ]
 
 webkit.org/b/219907 imported/w3c/web-platform-tests/server-timing/service_worker_idl.html [ Pass Failure ]
+
+webkit.org/b/219687 fast/layoutformattingcontext/max-content-and-box-sizing-simple.html [ ImageOnlyFailure ]

Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (270890 => 270891)


--- trunk/LayoutTests/platform/mac-wk2/TestExpectations	2020-12-16 16:12:13 UTC (rev 270890)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations	2020-12-16 16:13:18 UTC (rev 270891)
@@ -1316,3 +1316,4 @@
 webkit.org/b/217054 fast/layoutformattingcontext/horizontal-sizing-with-trailing-letter-spacing.html [ Skip ]
 webkit.org/b/219322 fast/layoutformattingcontext/table-simple-border-collapse.html [ ImageOnlyFailure ]
 webkit.org/b/219322 fast/layoutformattingcontext/table-simple-border-collapse2.html [ ImageOnlyFailure ]
+webkit.org/b/219687 fast/layoutformattingcontext/max-content-and-box-sizing-simple.html [ Skip ]

Modified: trunk/Source/WebCore/ChangeLog (270890 => 270891)


--- trunk/Source/WebCore/ChangeLog	2020-12-16 16:12:13 UTC (rev 270890)
+++ trunk/Source/WebCore/ChangeLog	2020-12-16 16:13:18 UTC (rev 270891)
@@ -1,3 +1,17 @@
+2020-12-16  Zalan Bujtas  <[email protected]>
+
+        [LFC][BFC] Non-quantitative values such as auto and min-content are not influenced by the box-sizing property
+        https://bugs.webkit.org/show_bug.cgi?id=219944
+
+        Reviewed by Antti Koivisto.
+
+        See https://www.w3.org/TR/css-sizing-3/#box-sizing
+
+        Test: fast/layoutformattingcontext/max-content-and-box-sizing-simple.html
+
+        * layout/FormattingContextGeometry.cpp:
+        (WebCore::Layout::FormattingContext::Geometry::computedWidth):
+
 2020-12-16  Andy Estes  <[email protected]>
 
         [Mac] Disable the WebM format reader in configurations where the plug-in will fail to load

Modified: trunk/Source/WebCore/layout/FormattingContextGeometry.cpp (270890 => 270891)


--- trunk/Source/WebCore/layout/FormattingContextGeometry.cpp	2020-12-16 16:12:13 UTC (rev 270890)
+++ trunk/Source/WebCore/layout/FormattingContextGeometry.cpp	2020-12-16 16:13:18 UTC (rev 270891)
@@ -161,7 +161,9 @@
 Optional<LayoutUnit> FormattingContext::Geometry::computedWidth(const Box& layoutBox, LayoutUnit containingBlockWidth)
 {
     if (auto computedWidth = computedWidthValue(layoutBox, WidthType::Normal, containingBlockWidth)) {
-        if (layoutBox.style().boxSizing() == BoxSizing::ContentBox)
+        auto& style = layoutBox.style();
+        // Non-quantitative values such as auto and min-content are not influenced by the box-sizing property.
+        if (style.boxSizing() == BoxSizing::ContentBox || style.width().isIntrinsicOrAuto())
             return computedWidth;
         auto& boxGeometry = formattingContext().geometryForBox(layoutBox);
         return *computedWidth - (boxGeometry.horizontalBorder() + boxGeometry.horizontalPadding().valueOr(0));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to