<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[277717] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/277717">277717</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2021-05-19 04:54:13 -0700 (Wed, 19 May 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>https://bugs.webkit.org/show_bug.cgi?id=225964
Fix flex-aspect-ratio-002+004.html

Patch by Rob Buis <rbuis@igalia.com> on 2021-05-19
Reviewed by Sergio Villar Senin.

LayoutTests/imported/w3c:

Import tests.

* web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-002.html:
* web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-004.html:

Source/WebCore:

Flex should not do transferred size suggestion for non-replaced aspect-ratio items:
https://drafts.csswg.org/css-flexbox-1/#min-size-auto

Tests: imported/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-002.html
       imported/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-004.html

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsssizingaspectratioflexaspectratio002html">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-002.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsssizingaspectratioflexaspectratio004html">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-004.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderFlexibleBoxcpp">trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (277716 => 277717)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog 2021-05-19 05:21:57 UTC (rev 277716)
+++ trunk/LayoutTests/imported/w3c/ChangeLog    2021-05-19 11:54:13 UTC (rev 277717)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2021-05-19  Rob Buis  <rbuis@igalia.com>
+
+        https://bugs.webkit.org/show_bug.cgi?id=225964
+        Fix flex-aspect-ratio-002+004.html
+
+        Reviewed by Sergio Villar Senin.
+
+        Import tests.
+
+        * web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-002.html:
+        * web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-004.html:
+
</ins><span class="cx"> 2021-05-18  Keith Miller  <keith_miller@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Temporarily revert r276592 as it breaks some native apps
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsssizingaspectratioflexaspectratio002html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-002.html (277716 => 277717)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-002.html 2021-05-19 05:21:57 UTC (rev 277716)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-002.html    2021-05-19 11:54:13 UTC (rev 277717)
</span><span class="lines">@@ -2,6 +2,7 @@
</span><span class="cx"> <title>CSS aspect-ratio: Row flexbox min-width</title>
</span><span class="cx"> <link rel="author" title="Google LLC" href="https://www.google.com/">
</span><span class="cx"> <link rel="help" href="https://drafts.csswg.org/css-sizing-4/#aspect-ratio">
</span><ins>+<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#aspect-ratio-minimum">
</ins><span class="cx"> <link rel="help" href="https://drafts.csswg.org/css-flexbox/#min-size-auto">
</span><span class="cx"> <link rel="match" href="../../reference/ref-filled-green-100px-square.xht" />
</span><span class="cx"> 
</span><span class="lines">@@ -8,9 +9,9 @@
</span><span class="cx"> <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
</span><span class="cx"> 
</span><span class="cx"> <div style="display: flex;">
</span><del>-  <!-- transferred size: 100px. content size suggestion: 200px.
-       min-width: min(100, 200). -->
-  <div style="background: green; height: 100px; aspect-ratio: 1/1; flex-basis: 0;">
-    <div style="width: 200px;"></div>
</del><ins>+  <!-- No transferred size suggestion since the flex item is non-replaced.
+       Content size suggestion is 100px. -->
+  <div style="background: green; height: 100px; aspect-ratio: 1/2; flex-basis: 0;">
+    <div style="width: 100px;"></div>
</ins><span class="cx">   </div>
</span><span class="cx"> </div>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsssizingaspectratioflexaspectratio004html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-004.html (277716 => 277717)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-004.html 2021-05-19 05:21:57 UTC (rev 277716)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-004.html    2021-05-19 11:54:13 UTC (rev 277717)
</span><span class="lines">@@ -2,6 +2,7 @@
</span><span class="cx"> <title>CSS aspect-ratio: Column flexbox min-height</title>
</span><span class="cx"> <link rel="author" title="Google LLC" href="https://www.google.com/">
</span><span class="cx"> <link rel="help" href="https://drafts.csswg.org/css-sizing-4/#aspect-ratio">
</span><ins>+<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#aspect-ratio-minimum">
</ins><span class="cx"> <link rel="help" href="https://drafts.csswg.org/css-flexbox/#min-size-auto">
</span><span class="cx"> <link rel="match" href="../../reference/ref-filled-green-100px-square.xht" />
</span><span class="cx"> 
</span><span class="lines">@@ -8,9 +9,9 @@
</span><span class="cx"> <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
</span><span class="cx"> 
</span><span class="cx"> <div style="display: flex; flex-direction: column;">
</span><del>-  <!-- transferred size: 100px. content size suggestion: 200px.
-       min-height: min(100, 200). -->
-  <div style="background: green; width: 100px; aspect-ratio: 1/1; flex-basis: 0;">
-    <div style="height: 200px;"></div>
</del><ins>+  <!-- No transferred size suggestion since the flex item is non-replaced.
+       Content size suggestion is 100px. -->
+  <div style="background: green; width: 100px; aspect-ratio: 2/1; flex-basis: 0;">
+    <div style="height: 100px;"></div>
</ins><span class="cx">   </div>
</span><span class="cx"> </div>
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (277716 => 277717)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-05-19 05:21:57 UTC (rev 277716)
+++ trunk/Source/WebCore/ChangeLog      2021-05-19 11:54:13 UTC (rev 277717)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2021-05-19  Rob Buis  <rbuis@igalia.com>
+
+        https://bugs.webkit.org/show_bug.cgi?id=225964
+        Fix flex-aspect-ratio-002+004.html
+
+        Reviewed by Sergio Villar Senin.
+
+        Flex should not do transferred size suggestion for non-replaced aspect-ratio items:
+        https://drafts.csswg.org/css-flexbox-1/#min-size-auto
+
+        Tests: imported/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-002.html
+               imported/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-004.html
+
+
+        * rendering/RenderFlexibleBox.cpp:
+        (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
+
</ins><span class="cx"> 2021-05-18  Cameron McCormack  <heycam@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Record gradient and pattern filled canvas text in the correct coordinate system.
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderFlexibleBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp (277716 => 277717)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp     2021-05-19 05:21:57 UTC (rev 277716)
+++ trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp        2021-05-19 11:54:13 UTC (rev 277717)
</span><span class="lines">@@ -1225,7 +1225,7 @@
</span><span class="cx">         // ensure it's valid through the virtual calls of computeIntrinsicLogicalContentHeightUsing.
</span><span class="cx">         LayoutUnit contentSize;
</span><span class="cx">         Length childCrossSizeLength = crossSizeLengthForChild(MainOrPreferredSize, child);
</span><del>-        if (useChildAspectRatio(child))
</del><ins>+        if (child.isRenderReplaced() && useChildAspectRatio(child))
</ins><span class="cx">             contentSize = computeMainSizeFromAspectRatioUsing(child, childCrossSizeLength);
</span><span class="cx">         else
</span><span class="cx">             contentSize = computeMainAxisExtentForChild(child, MinSize, Length(LengthType::MinContent)).valueOr(0);
</span><span class="lines">@@ -1242,7 +1242,7 @@
</span><span class="cx">             return std::max(childSize, std::min(specifiedSize, contentSize));
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (useChildAspectRatio(child) || childCrossSizeShouldUseContainerCrossSize(child)) {
</del><ins>+        if (child.isRenderReplaced() && (useChildAspectRatio(child) || childCrossSizeShouldUseContainerCrossSize(child))) {
</ins><span class="cx">             LayoutUnit transferredSize = computeMainSizeFromAspectRatioUsing(child, childCrossSizeLength);
</span><span class="cx">             transferredSize = adjustChildSizeForAspectRatioCrossAxisMinAndMax(child, transferredSize);
</span><span class="cx">             return std::max(childSize, std::min(transferredSize, contentSize));
</span></span></pre>
</div>
</div>

</body>
</html>