<!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>[189567] 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/189567">189567</a></dd>
<dt>Author</dt> <dd>svillar@igalia.com</dd>
<dt>Date</dt> <dd>2015-09-10 04:58:24 -0700 (Thu, 10 Sep 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>min-width/height should default to auto for flexbox items
https://bugs.webkit.org/show_bug.cgi?id=146020
Reviewed by David Hyatt.
Based on Blink's <a href="http://trac.webkit.org/projects/webkit/changeset/193665">r193665</a>, <a href="http://trac.webkit.org/projects/webkit/changeset/194062">r194062</a>, <a href="http://trac.webkit.org/projects/webkit/changeset/194887">r194887</a> and <a href="http://trac.webkit.org/projects/webkit/changeset/195930">r195930</a> by <cbiesinger@chromium.org>.
Source/WebCore:
As specified here
http://dev.w3.org/csswg/css-flexbox/#min-size-auto the default
value of min-{width|height} is auto for flex items.
In case this patch breaks any website (as it's changing the
default value of those properties) the fix is likely to add:
min-width: 0;
min-height: 0;
to any relevant flexitems.
Test: css3/flexbox/min-size-auto.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::isFlexOrGrid): New helper method to identify grids and flexs.
(WebCore::ComputedStyleExtractor::propertyValue): Return auto
for flex items if min-width/height is auto.
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
* html/shadow/SliderThumbElement.cpp:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::constrainLogicalHeightByMinMax):
(WebCore::RenderBox::constrainContentBoxLogicalHeightByMinMax):
(WebCore::RenderBox::computeLogicalWidthInRegionUsing):
(WebCore::RenderBox::computeLogicalHeight):
(WebCore::RenderBox::computeLogicalHeightUsing):
(WebCore::RenderBox::computeContentLogicalHeight):
(WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing):
(WebCore::RenderBox::computeReplacedLogicalWidth):
(WebCore::RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth):
(WebCore::RenderBox::computeReplacedLogicalWidthUsing):
(WebCore::RenderBox::computeReplacedLogicalHeight):
(WebCore::RenderBox::computeReplacedLogicalHeightRespectingMinMaxHeight):
(WebCore::RenderBox::computeReplacedLogicalHeightUsing):
(WebCore::RenderBox::availableLogicalHeightUsing):
(WebCore::RenderBox::computePositionedLogicalWidth):
(WebCore::RenderBox::computePositionedLogicalWidthUsing):
(WebCore::RenderBox::computePositionedLogicalHeight):
(WebCore::RenderBox::computePositionedLogicalHeightUsing):
* rendering/RenderBox.h:
* rendering/RenderButton.h:
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
(WebCore::RenderFlexibleBox::mainAxisExtentIsDefinite):
(WebCore::RenderFlexibleBox::mainAxisLengthIsIndefinite):
(WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
(WebCore::RenderFlexibleBox::mainAxisOverflowForChild):
* rendering/RenderFlexibleBox.h:
(WebCore::RenderFlexibleBox::isFlexibleBoxImpl):
* rendering/RenderFullScreen.h:
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
* rendering/RenderMediaControlElements.h:
* rendering/RenderMenuList.cpp:
(WebCore::RenderMenuList::adjustInnerStyle): Do not longer set
the min-width explicitly.
* rendering/RenderMenuList.h:
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::calculateMaxColumnHeight):
* rendering/RenderNamedFlowFragment.cpp:
(WebCore::RenderNamedFlowFragment::maxPageLogicalHeight):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::computeReplacedLogicalWidth):
(WebCore::RenderReplaced::computeReplacedLogicalHeight):
* rendering/RenderSlider.h:
* rendering/RenderTextControl.h:
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::createInnerBlockStyle): Do not longer set
the min-width explicitly.
* rendering/mathml/RenderMathMLBlock.h:
* rendering/style/RenderStyle.h:
LayoutTests:
* TestExpectations: Removed passing flexbox tests.
* css3/flexbox/csswg/flex-flow-007.html: Added min-height: 0px.
* css3/flexbox/flexbox-baseline.html: Ditto.
* css3/flexbox/min-size-auto-expected.txt: Added.
* css3/flexbox/min-size-auto.html: Added.
* css3/flexbox/preferred-widths-orthogonal.html: Added min-height: 0px.
* fast/css/auto-min-size-expected.txt: Check default computed
styles for min-width/height for flex items.
* fast/css/auto-min-size.html: Ditto.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsTestExpectations">trunk/LayoutTests/TestExpectations</a></li>
<li><a href="#trunkLayoutTestscss3flexboxcsswgflexflow007html">trunk/LayoutTests/css3/flexbox/csswg/flex-flow-007.html</a></li>
<li><a href="#trunkLayoutTestscss3flexboxflexboxbaselinehtml">trunk/LayoutTests/css3/flexbox/flexbox-baseline.html</a></li>
<li><a href="#trunkLayoutTestscss3flexboxpreferredwidthsorthogonalhtml">trunk/LayoutTests/css3/flexbox/preferred-widths-orthogonal.html</a></li>
<li><a href="#trunkLayoutTestsfastcssautominsizeexpectedtxt">trunk/LayoutTests/fast/css/auto-min-size-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssautominsizehtml">trunk/LayoutTests/fast/css/auto-min-size.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssCSSComputedStyleDeclarationcpp">trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSParsercpp">trunk/Source/WebCore/css/CSSParser.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlshadowSliderThumbElementcpp">trunk/Source/WebCore/html/shadow/SliderThumbElement.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxcpp">trunk/Source/WebCore/rendering/RenderBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxh">trunk/Source/WebCore/rendering/RenderBox.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderButtonh">trunk/Source/WebCore/rendering/RenderButton.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderFlexibleBoxcpp">trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderFlexibleBoxh">trunk/Source/WebCore/rendering/RenderFlexibleBox.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderFullScreenh">trunk/Source/WebCore/rendering/RenderFullScreen.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderGridcpp">trunk/Source/WebCore/rendering/RenderGrid.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderMediaControlElementsh">trunk/Source/WebCore/rendering/RenderMediaControlElements.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderMenuListcpp">trunk/Source/WebCore/rendering/RenderMenuList.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderMenuListh">trunk/Source/WebCore/rendering/RenderMenuList.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderMultiColumnSetcpp">trunk/Source/WebCore/rendering/RenderMultiColumnSet.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderNamedFlowFragmentcpp">trunk/Source/WebCore/rendering/RenderNamedFlowFragment.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderReplacedcpp">trunk/Source/WebCore/rendering/RenderReplaced.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderSliderh">trunk/Source/WebCore/rendering/RenderSlider.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTextControlh">trunk/Source/WebCore/rendering/RenderTextControl.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTextControlSingleLinecpp">trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLBlockh">trunk/Source/WebCore/rendering/mathml/RenderMathMLBlock.h</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleRenderStyleh">trunk/Source/WebCore/rendering/style/RenderStyle.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestscss3flexboxminsizeautoexpectedtxt">trunk/LayoutTests/css3/flexbox/min-size-auto-expected.txt</a></li>
<li><a href="#trunkLayoutTestscss3flexboxminsizeautohtml">trunk/LayoutTests/css3/flexbox/min-size-auto.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (189566 => 189567)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-09-10 09:10:11 UTC (rev 189566)
+++ trunk/LayoutTests/ChangeLog        2015-09-10 11:58:24 UTC (rev 189567)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2015-09-10 Sergio Villar Senin <svillar@igalia.com>
+
+ min-width/height should default to auto for flexbox items
+ https://bugs.webkit.org/show_bug.cgi?id=146020
+
+ Reviewed by David Hyatt.
+
+ Based on Blink's r193665, r194062, r194887 and r195930 by <cbiesinger@chromium.org>.
+
+ * TestExpectations: Removed passing flexbox tests.
+ * css3/flexbox/csswg/flex-flow-007.html: Added min-height: 0px.
+ * css3/flexbox/flexbox-baseline.html: Ditto.
+ * css3/flexbox/min-size-auto-expected.txt: Added.
+ * css3/flexbox/min-size-auto.html: Added.
+ * css3/flexbox/preferred-widths-orthogonal.html: Added min-height: 0px.
+ * fast/css/auto-min-size-expected.txt: Check default computed
+ styles for min-width/height for flex items.
+ * fast/css/auto-min-size.html: Ditto.
+
</ins><span class="cx"> 2015-09-10 ChangSeok Oh <changseok.oh@collabora.com>
</span><span class="cx">
</span><span class="cx"> [GTK] Volume bar is broken
</span></span></pre></div>
<a id="trunkLayoutTestsTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/TestExpectations (189566 => 189567)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/TestExpectations        2015-09-10 09:10:11 UTC (rev 189566)
+++ trunk/LayoutTests/TestExpectations        2015-09-10 11:58:24 UTC (rev 189567)
</span><span class="lines">@@ -203,11 +203,7 @@
</span><span class="cx"> webkit.org/b/136754 css3/flexbox/csswg/flex-items-flexibility.html [ ImageOnlyFailure ]
</span><span class="cx"> webkit.org/b/136754 css3/flexbox/csswg/flex-lines/multi-line-wrap-reverse-column-reverse.html [ ImageOnlyFailure ]
</span><span class="cx"> webkit.org/b/136754 css3/flexbox/csswg/flex-lines/multi-line-wrap-with-column-reverse.html [ ImageOnlyFailure ]
</span><del>-webkit.org/b/136754 css3/flexbox/csswg/flex-margin-no-collapse.html [ ImageOnlyFailure ]
</del><span class="cx"> webkit.org/b/136754 css3/flexbox/csswg/flexbox-flex-wrap-flexing.html [ ImageOnlyFailure ]
</span><del>-webkit.org/b/136754 css3/flexbox/csswg/flexbox_flex-0-0-0.html [ ImageOnlyFailure ]
-webkit.org/b/136754 css3/flexbox/csswg/flexbox_flex-0-1-0.html [ ImageOnlyFailure ]
-webkit.org/b/136754 css3/flexbox/csswg/flexbox_flex-0-N-0.html [ ImageOnlyFailure ]
</del><span class="cx"> webkit.org/b/136754 css3/flexbox/csswg/flexbox_flex-natural-mixed-basis-auto.html [ ImageOnlyFailure ]
</span><span class="cx"> webkit.org/b/136754 css3/flexbox/csswg/flexbox_generated-container.html [ ImageOnlyFailure ]
</span><span class="cx"> webkit.org/b/136754 css3/flexbox/csswg/flexbox_justifycontent-center-overflow.html [ ImageOnlyFailure ]
</span></span></pre></div>
<a id="trunkLayoutTestscss3flexboxcsswgflexflow007html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/css3/flexbox/csswg/flex-flow-007.html (189566 => 189567)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/flexbox/csswg/flex-flow-007.html        2015-09-10 09:10:11 UTC (rev 189566)
+++ trunk/LayoutTests/css3/flexbox/csswg/flex-flow-007.html        2015-09-10 11:58:24 UTC (rev 189567)
</span><span class="lines">@@ -22,6 +22,9 @@
</span><span class="cx"> background-color: green;
</span><span class="cx"> height: 50px;
</span><span class="cx"> }
</span><ins>+ :not(#test) div {
+ min-height: 0px;
+ }
</ins><span class="cx"> </style>
</span><span class="cx"> <body>
</span><span class="cx"> <p>Test passes if there is a filled green square and no red, the number within square is '1 2 3 4' from top to bottom.</p>
</span></span></pre></div>
<a id="trunkLayoutTestscss3flexboxflexboxbaselinehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/css3/flexbox/flexbox-baseline.html (189566 => 189567)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/flexbox/flexbox-baseline.html        2015-09-10 09:10:11 UTC (rev 189566)
+++ trunk/LayoutTests/css3/flexbox/flexbox-baseline.html        2015-09-10 11:58:24 UTC (rev 189567)
</span><span class="lines">@@ -73,7 +73,7 @@
</span><span class="cx"> <div>
</span><span class="cx"> should align with the middle
</span><span class="cx"> <div class="inline-flexbox" style="width: 40px; height: 40px">
</span><del>- <div style="-webkit-writing-mode: vertical-rl; height: 20px; width: 40px; border-bottom: 1px solid black"></div>
</del><ins>+ <div style="-webkit-writing-mode: vertical-rl; height: 20px; width: 40px; border-bottom: 1px solid black; min-height: 0px;"></div>
</ins><span class="cx"> </div>
</span><span class="cx"> of the grey flexbox
</span><span class="cx"> </div>
</span><span class="lines">@@ -111,8 +111,8 @@
</span><span class="cx"> <div>
</span><span class="cx"> should align with the middle
</span><span class="cx"> <div class="inline-flexbox column" style="width: 40px; height: 40px;">
</span><del>- <div style="-webkit-writing-mode: vertical-rl; width: 40px; height: 20px; border-bottom: 1px solid black"></div>
- <div style="-webkit-writing-mode: vertical-rl; width: 40px; height: 20px"></div>
</del><ins>+ <div style="-webkit-writing-mode: vertical-rl; width: 40px; height: 20px; border-bottom: 1px solid black; min-height: 0px;"></div>
+ <div style="-webkit-writing-mode: vertical-rl; width: 40px; height: 20px; min-height: 0px;"></div>
</ins><span class="cx"> </div>
</span><span class="cx"> of the grey flexbox
</span><span class="cx"> </div>
</span></span></pre></div>
<a id="trunkLayoutTestscss3flexboxminsizeautoexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/css3/flexbox/min-size-auto-expected.txt (0 => 189567)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/flexbox/min-size-auto-expected.txt         (rev 0)
+++ trunk/LayoutTests/css3/flexbox/min-size-auto-expected.txt        2015-09-10 11:58:24 UTC (rev 189567)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+PASS successfullyParsed is true
+
+TEST COMPLETE
+PASS
+PASS
+PASS
+PASS
</ins><span class="cx">Property changes on: trunk/LayoutTests/css3/flexbox/min-size-auto-expected.txt
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestscss3flexboxminsizeautohtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/css3/flexbox/min-size-auto.html (0 => 189567)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/flexbox/min-size-auto.html         (rev 0)
+++ trunk/LayoutTests/css3/flexbox/min-size-auto.html        2015-09-10 11:58:24 UTC (rev 189567)
</span><span class="lines">@@ -0,0 +1,61 @@
</span><ins>+<!DOCTYPE html>
+<link href="resources/flexbox.css" rel="stylesheet">
+
+<script src="../../resources/js-test.js"></script>
+<script src="../../resources/check-layout.js"></script>
+
+<style>
+.flexbox {
+ width: 10px;
+ height: 10px;
+ background-color: grey;
+}
+
+.item {
+ background-color: red;
+ margin: 5px;
+}
+
+.child {
+ height: 100px;
+ width: 100px;
+ background-color: green;
+}
+
+.width-20 {
+ width: 20px;
+}
+
+.flex-basis-20 {
+ flex-basis: 20px;
+}
+
+</style>
+
+<body onload="checkLayout('.flexbox')">
+
+<div class="flexbox" data-expected-width="10">
+ <div class="item" data-expected-width="100">
+ <div class="child" data-expected-width="100"></div>
+ </div>
+</div>
+
+<div class="flexbox column" data-expected-height="10">
+ <div class="item" data-expected-height="100">
+ <div class="child" data-expected-height="100"></div>
+ </div>
+</div>
+
+<div class="flexbox" data-expected-width="10">
+ <div class="item width-20" data-expected-width="20">
+ <div class="child" data-expected-width="100"></div>
+ </div>
+</div>
+
+<div class="flexbox" data-expected-width="10">
+ <div class="item flex-basis-20" data-expected-width="100">
+ <div class="child" data-expected-width="100"></div>
+ </div>
+</div>
+
+</body>
</ins><span class="cx">Property changes on: trunk/LayoutTests/css3/flexbox/min-size-auto.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestscss3flexboxpreferredwidthsorthogonalhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/css3/flexbox/preferred-widths-orthogonal.html (189566 => 189567)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/flexbox/preferred-widths-orthogonal.html        2015-09-10 09:10:11 UTC (rev 189566)
+++ trunk/LayoutTests/css3/flexbox/preferred-widths-orthogonal.html        2015-09-10 11:58:24 UTC (rev 189567)
</span><span class="lines">@@ -72,7 +72,7 @@
</span><span class="cx"> <br class=clear>
</span><span class="cx">
</span><span class="cx"> <div class="flexbox vertical-lr" data-expected-height=115 data-expect-width=80>
</span><del>- <div class="horizontal-tb nested" data-expected-height=80 data-expect-width=50>
</del><ins>+ <div class="horizontal-tb nested" data-expected-height=80 data-expect-width=50 style="min-height: 0px;">
</ins><span class="cx"> <div class="vertical-lr nested" data-expected-height=80 data-expect-width=30>
</span><span class="cx"> <div></div>
</span><span class="cx"> <div></div>
</span><span class="lines">@@ -93,7 +93,7 @@
</span><span class="cx"> <br class=clear>
</span><span class="cx">
</span><span class="cx"> <div class="flexbox vertical-lr" data-expected-height=65 data-expect-width=70>
</span><del>- <div class="nested horizontal-tb" data-expected-height=30 data-expect-width=40>
</del><ins>+ <div class="nested horizontal-tb" data-expected-height=30 data-expect-width=40 style="min-height: 0px;">
</ins><span class="cx"> <div></div>
</span><span class="cx"> <div></div>
</span><span class="cx"> </div>
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssautominsizeexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/auto-min-size-expected.txt (189566 => 189567)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/auto-min-size-expected.txt        2015-09-10 09:10:11 UTC (rev 189566)
+++ trunk/LayoutTests/fast/css/auto-min-size-expected.txt        2015-09-10 11:58:24 UTC (rev 189567)
</span><span class="lines">@@ -1,17 +1,31 @@
</span><span class="cx"> PASS div.style.minWidth is ""
</span><span class="cx"> PASS getComputedStyle(div)["min-width"] is "0px"
</span><del>-PASS div.style.minWidth is ""
</del><ins>+PASS div.style.minWidth is "auto"
</ins><span class="cx"> PASS div.style.maxWidth is ""
</span><span class="cx"> PASS getComputedStyle(div).minWidth is "0px"
</span><span class="cx"> PASS div.style.minWidth is "0px"
</span><span class="cx"> PASS getComputedStyle(div)["min-width"] is "0px"
</span><span class="cx"> PASS div.style.minHeight is ""
</span><span class="cx"> PASS getComputedStyle(div)["min-height"] is "0px"
</span><del>-PASS div.style.minHeight is ""
</del><ins>+PASS div.style.minHeight is "auto"
</ins><span class="cx"> PASS div.style.maxHeight is ""
</span><span class="cx"> PASS getComputedStyle(div).minHeight is "0px"
</span><span class="cx"> PASS div.style.minHeight is "0px"
</span><span class="cx"> PASS getComputedStyle(div)["min-height"] is "0px"
</span><ins>+PASS flexitem.style.minWidth is ""
+PASS getComputedStyle(flexitem)["min-width"] is "auto"
+PASS flexitem.style.minWidth is "auto"
+PASS flexitem.style.maxWidth is ""
+PASS getComputedStyle(flexitem).minWidth is "auto"
+PASS flexitem.style.minWidth is "0px"
+PASS getComputedStyle(flexitem)["min-width"] is "0px"
+PASS flexitem.style.minHeight is ""
+PASS getComputedStyle(flexitem)["min-height"] is "auto"
+PASS flexitem.style.minHeight is "auto"
+PASS flexitem.style.maxHeight is ""
+PASS getComputedStyle(flexitem).minHeight is "auto"
+PASS flexitem.style.minHeight is "0px"
+PASS getComputedStyle(flexitem)["min-height"] is "0px"
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx">
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssautominsizehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/auto-min-size.html (189566 => 189567)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/auto-min-size.html        2015-09-10 09:10:11 UTC (rev 189566)
+++ trunk/LayoutTests/fast/css/auto-min-size.html        2015-09-10 11:58:24 UTC (rev 189567)
</span><span class="lines">@@ -1,6 +1,7 @@
</span><span class="cx"> <!DOCTYPE html>
</span><span class="cx"> <script src='../../resources/js-test-pre.js'></script>
</span><span class="cx"> <div id=foo></div>
</span><ins>+<div id="flexbox" style="display: flex;"><div id="flexitem"></div></div>
</ins><span class="cx"> <script>
</span><span class="cx"> div = document.getElementById('foo');
</span><span class="cx"> shouldBe('div.style.minWidth', '""');
</span><span class="lines">@@ -8,7 +9,7 @@
</span><span class="cx">
</span><span class="cx"> div.style.minWidth = 'auto';
</span><span class="cx"> div.style.maxWidth = 'auto';
</span><del>-shouldBe('div.style.minWidth', '""');
</del><ins>+shouldBe('div.style.minWidth', '"auto"');
</ins><span class="cx"> shouldBe('div.style.maxWidth', '""');
</span><span class="cx"> shouldBe('getComputedStyle(div).minWidth', '"0px"');
</span><span class="cx">
</span><span class="lines">@@ -21,7 +22,7 @@
</span><span class="cx">
</span><span class="cx"> div.style.minHeight = 'auto';
</span><span class="cx"> div.style.maxHeight = 'auto';
</span><del>-shouldBe('div.style.minHeight', '""');
</del><ins>+shouldBe('div.style.minHeight', '"auto"');
</ins><span class="cx"> shouldBe('div.style.maxHeight', '""');
</span><span class="cx"> shouldBe('getComputedStyle(div).minHeight', '"0px"');
</span><span class="cx">
</span><span class="lines">@@ -29,5 +30,31 @@
</span><span class="cx"> shouldBe('div.style.minHeight', '"0px"');
</span><span class="cx"> shouldBe('getComputedStyle(div)["min-height"]', '"0px"');
</span><span class="cx">
</span><ins>+var flexitem = document.getElementById("flexitem");
+shouldBe('flexitem.style.minWidth', '""');
+shouldBe('getComputedStyle(flexitem)["min-width"]', '"auto"');
+
+flexitem.style.minWidth = 'auto';
+flexitem.style.maxWidth = 'auto';
+shouldBe('flexitem.style.minWidth', '"auto"');
+shouldBe('flexitem.style.maxWidth', '""');
+shouldBe('getComputedStyle(flexitem).minWidth', '"auto"');
+
+flexitem.style.minWidth = 0;
+shouldBe('flexitem.style.minWidth', '"0px"');
+shouldBe('getComputedStyle(flexitem)["min-width"]', '"0px"');
+
+shouldBe('flexitem.style.minHeight', '""');
+shouldBe('getComputedStyle(flexitem)["min-height"]', '"auto"');
+
+flexitem.style.minHeight = 'auto';
+flexitem.style.maxHeight = 'auto';
+shouldBe('flexitem.style.minHeight', '"auto"');
+shouldBe('flexitem.style.maxHeight', '""');
+shouldBe('getComputedStyle(flexitem).minHeight', '"auto"');
+
+flexitem.style.minHeight = 0;
+shouldBe('flexitem.style.minHeight', '"0px"');
+shouldBe('getComputedStyle(flexitem)["min-height"]', '"0px"');
</ins><span class="cx"> </script>
</span><span class="cx"> <script src='../../resources/js-test-post.js'></script>
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (189566 => 189567)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-09-10 09:10:11 UTC (rev 189566)
+++ trunk/Source/WebCore/ChangeLog        2015-09-10 11:58:24 UTC (rev 189567)
</span><span class="lines">@@ -1,3 +1,85 @@
</span><ins>+2015-09-10 Sergio Villar Senin <svillar@igalia.com>
+
+ min-width/height should default to auto for flexbox items
+ https://bugs.webkit.org/show_bug.cgi?id=146020
+
+ Reviewed by David Hyatt.
+
+ Based on Blink's r193665, r194062, r194887 and r195930 by <cbiesinger@chromium.org>.
+
+ As specified here
+ http://dev.w3.org/csswg/css-flexbox/#min-size-auto the default
+ value of min-{width|height} is auto for flex items.
+
+ In case this patch breaks any website (as it's changing the
+ default value of those properties) the fix is likely to add:
+
+ min-width: 0;
+ min-height: 0;
+
+ to any relevant flexitems.
+
+ Test: css3/flexbox/min-size-auto.html
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::isFlexOrGrid): New helper method to identify grids and flexs.
+ (WebCore::ComputedStyleExtractor::propertyValue): Return auto
+ for flex items if min-width/height is auto.
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseValue):
+ * html/shadow/SliderThumbElement.cpp:
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::constrainLogicalHeightByMinMax):
+ (WebCore::RenderBox::constrainContentBoxLogicalHeightByMinMax):
+ (WebCore::RenderBox::computeLogicalWidthInRegionUsing):
+ (WebCore::RenderBox::computeLogicalHeight):
+ (WebCore::RenderBox::computeLogicalHeightUsing):
+ (WebCore::RenderBox::computeContentLogicalHeight):
+ (WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing):
+ (WebCore::RenderBox::computeReplacedLogicalWidth):
+ (WebCore::RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth):
+ (WebCore::RenderBox::computeReplacedLogicalWidthUsing):
+ (WebCore::RenderBox::computeReplacedLogicalHeight):
+ (WebCore::RenderBox::computeReplacedLogicalHeightRespectingMinMaxHeight):
+ (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
+ (WebCore::RenderBox::availableLogicalHeightUsing):
+ (WebCore::RenderBox::computePositionedLogicalWidth):
+ (WebCore::RenderBox::computePositionedLogicalWidthUsing):
+ (WebCore::RenderBox::computePositionedLogicalHeight):
+ (WebCore::RenderBox::computePositionedLogicalHeightUsing):
+ * rendering/RenderBox.h:
+ * rendering/RenderButton.h:
+ * rendering/RenderFlexibleBox.cpp:
+ (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
+ (WebCore::RenderFlexibleBox::mainAxisExtentIsDefinite):
+ (WebCore::RenderFlexibleBox::mainAxisLengthIsIndefinite):
+ (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
+ (WebCore::RenderFlexibleBox::mainAxisOverflowForChild):
+ * rendering/RenderFlexibleBox.h:
+ (WebCore::RenderFlexibleBox::isFlexibleBoxImpl):
+ * rendering/RenderFullScreen.h:
+ * rendering/RenderGrid.cpp:
+ (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
+ * rendering/RenderMediaControlElements.h:
+ * rendering/RenderMenuList.cpp:
+ (WebCore::RenderMenuList::adjustInnerStyle): Do not longer set
+ the min-width explicitly.
+ * rendering/RenderMenuList.h:
+ * rendering/RenderMultiColumnSet.cpp:
+ (WebCore::RenderMultiColumnSet::calculateMaxColumnHeight):
+ * rendering/RenderNamedFlowFragment.cpp:
+ (WebCore::RenderNamedFlowFragment::maxPageLogicalHeight):
+ * rendering/RenderReplaced.cpp:
+ (WebCore::RenderReplaced::computeReplacedLogicalWidth):
+ (WebCore::RenderReplaced::computeReplacedLogicalHeight):
+ * rendering/RenderSlider.h:
+ * rendering/RenderTextControl.h:
+ * rendering/RenderTextControlSingleLine.cpp:
+ (WebCore::RenderTextControlSingleLine::createInnerBlockStyle): Do not longer set
+ the min-width explicitly.
+ * rendering/mathml/RenderMathMLBlock.h:
+ * rendering/style/RenderStyle.h:
+
</ins><span class="cx"> 2015-09-10 ChangSeok Oh <changseok.oh@collabora.com>
</span><span class="cx">
</span><span class="cx"> [GTK] Volume bar is broken
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSComputedStyleDeclarationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (189566 => 189567)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2015-09-10 09:10:11 UTC (rev 189566)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2015-09-10 11:58:24 UTC (rev 189567)
</span><span class="lines">@@ -1899,6 +1899,11 @@
</span><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+inline static bool isFlexOrGrid(ContainerNode* element)
+{
+ return element && element->computedStyle() && element->computedStyle()->isDisplayFlexibleOrGridBox();
+}
+
</ins><span class="cx"> RefPtr<CSSValue> ComputedStyleExtractor::propertyValue(CSSPropertyID propertyID, EUpdateLayout updateLayout) const
</span><span class="cx"> {
</span><span class="cx"> Node* styledNode = this->styledNode();
</span><span class="lines">@@ -2492,14 +2497,18 @@
</span><span class="cx"> return zoomAdjustedPixelValueForLength(maxWidth, *style);
</span><span class="cx"> }
</span><span class="cx"> case CSSPropertyMinHeight:
</span><del>- // FIXME: For flex-items, min-height:auto should compute to min-content.
- if (style->minHeight().isAuto())
</del><ins>+ if (style->minHeight().isAuto()) {
+ if (isFlexOrGrid(styledNode->parentNode()))
+ return cssValuePool.createIdentifierValue(CSSValueAuto);
</ins><span class="cx"> return zoomAdjustedPixelValue(0, *style);
</span><ins>+ }
</ins><span class="cx"> return zoomAdjustedPixelValueForLength(style->minHeight(), *style);
</span><span class="cx"> case CSSPropertyMinWidth:
</span><del>- // FIXME: For flex-items, min-width:auto should compute to min-content.
- if (style->minWidth().isAuto())
</del><ins>+ if (style->minWidth().isAuto()) {
+ if (isFlexOrGrid(styledNode->parentNode()))
+ return cssValuePool.createIdentifierValue(CSSValueAuto);
</ins><span class="cx"> return zoomAdjustedPixelValue(0, *style);
</span><ins>+ }
</ins><span class="cx"> return zoomAdjustedPixelValueForLength(style->minWidth(), *style);
</span><span class="cx"> case CSSPropertyObjectFit:
</span><span class="cx"> return cssValuePool.createValue(style->objectFit());
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.cpp (189566 => 189567)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.cpp        2015-09-10 09:10:11 UTC (rev 189566)
+++ trunk/Source/WebCore/css/CSSParser.cpp        2015-09-10 11:58:24 UTC (rev 189567)
</span><span class="lines">@@ -2254,7 +2254,7 @@
</span><span class="cx"> case CSSPropertyWebkitMinLogicalWidth:
</span><span class="cx"> case CSSPropertyMinHeight:
</span><span class="cx"> case CSSPropertyWebkitMinLogicalHeight:
</span><del>- validPrimitive = isValidSize(valueWithCalculation);
</del><ins>+ validPrimitive = id == CSSValueAuto || isValidSize(valueWithCalculation);
</ins><span class="cx"> break;
</span><span class="cx">
</span><span class="cx"> case CSSPropertyWidth:
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlshadowSliderThumbElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/shadow/SliderThumbElement.cpp (189566 => 189567)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/shadow/SliderThumbElement.cpp        2015-09-10 09:10:11 UTC (rev 189566)
+++ trunk/Source/WebCore/html/shadow/SliderThumbElement.cpp        2015-09-10 11:58:24 UTC (rev 189567)
</span><span class="lines">@@ -121,6 +121,7 @@
</span><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> virtual void layout() override;
</span><ins>+ bool isFlexibleBoxImpl() const override { return true; }
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> void RenderSliderContainer::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues& computedValues) const
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (189566 => 189567)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBox.cpp        2015-09-10 09:10:11 UTC (rev 189566)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp        2015-09-10 11:58:24 UTC (rev 189567)
</span><span class="lines">@@ -646,10 +646,10 @@
</span><span class="cx"> {
</span><span class="cx"> const RenderStyle& styleToUse = style();
</span><span class="cx"> if (!styleToUse.logicalMaxHeight().isUndefined()) {
</span><del>- if (Optional<LayoutUnit> maxH = computeLogicalHeightUsing(styleToUse.logicalMaxHeight(), intrinsicContentHeight))
</del><ins>+ if (Optional<LayoutUnit> maxH = computeLogicalHeightUsing(MaxSize, styleToUse.logicalMaxHeight(), intrinsicContentHeight))
</ins><span class="cx"> logicalHeight = std::min(logicalHeight, maxH.value());
</span><span class="cx"> }
</span><del>- if (Optional<LayoutUnit> computedLogicalHeight = computeLogicalHeightUsing(styleToUse.logicalMinHeight(), intrinsicContentHeight))
</del><ins>+ if (Optional<LayoutUnit> computedLogicalHeight = computeLogicalHeightUsing(MinSize, styleToUse.logicalMinHeight(), intrinsicContentHeight))
</ins><span class="cx"> return std::max(logicalHeight, computedLogicalHeight.value());
</span><span class="cx"> return logicalHeight;
</span><span class="cx"> }
</span><span class="lines">@@ -658,10 +658,10 @@
</span><span class="cx"> {
</span><span class="cx"> const RenderStyle& styleToUse = style();
</span><span class="cx"> if (!styleToUse.logicalMaxHeight().isUndefined()) {
</span><del>- if (Optional<LayoutUnit> maxH = computeContentLogicalHeight(styleToUse.logicalMaxHeight(), intrinsicContentHeight))
</del><ins>+ if (Optional<LayoutUnit> maxH = computeContentLogicalHeight(MaxSize, styleToUse.logicalMaxHeight(), intrinsicContentHeight))
</ins><span class="cx"> logicalHeight = std::min(logicalHeight, maxH.value());
</span><span class="cx"> }
</span><del>- if (Optional<LayoutUnit> computedContentLogicalHeight = computeContentLogicalHeight(styleToUse.logicalMinHeight(), intrinsicContentHeight))
</del><ins>+ if (Optional<LayoutUnit> computedContentLogicalHeight = computeContentLogicalHeight(MinSize, styleToUse.logicalMinHeight(), intrinsicContentHeight))
</ins><span class="cx"> return std::max(logicalHeight, computedContentLogicalHeight.value());
</span><span class="cx"> return logicalHeight;
</span><span class="cx"> }
</span><span class="lines">@@ -2439,6 +2439,10 @@
</span><span class="cx"> LayoutUnit RenderBox::computeLogicalWidthInRegionUsing(SizeType widthType, Length logicalWidth, LayoutUnit availableLogicalWidth,
</span><span class="cx"> const RenderBlock* cb, RenderRegion* region) const
</span><span class="cx"> {
</span><ins>+ ASSERT(widthType == MinSize || widthType == MainOrPreferredSize || !logicalWidth.isAuto());
+ if (widthType == MinSize && logicalWidth.isAuto())
+ return adjustBorderBoxLogicalWidthForBoxSizing(0);
+
</ins><span class="cx"> if (!logicalWidth.isIntrinsicOrAuto()) {
</span><span class="cx"> // FIXME: If the containing block flow is perpendicular to our direction we need to use the available logical height instead.
</span><span class="cx"> return adjustBorderBoxLogicalWidthForBoxSizing(valueForLength(logicalWidth, availableLogicalWidth));
</span><span class="lines">@@ -2755,7 +2759,7 @@
</span><span class="cx"> LayoutUnit heightResult;
</span><span class="cx"> if (checkMinMaxHeight) {
</span><span class="cx"> LayoutUnit intrinsicHeight = computedValues.m_extent - borderAndPaddingLogicalHeight();
</span><del>- heightResult = computeLogicalHeightUsing(style().logicalHeight(), intrinsicHeight).valueOr(computedValues.m_extent);
</del><ins>+ heightResult = computeLogicalHeightUsing(MainOrPreferredSize, style().logicalHeight(), intrinsicHeight).valueOr(computedValues.m_extent);
</ins><span class="cx"> heightResult = constrainLogicalHeightByMinMax(heightResult, intrinsicHeight);
</span><span class="cx"> } else {
</span><span class="cx"> // The only times we don't check min/max height are when a fixed length has
</span><span class="lines">@@ -2794,16 +2798,16 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Optional<LayoutUnit> RenderBox::computeLogicalHeightUsing(const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const
</del><ins>+Optional<LayoutUnit> RenderBox::computeLogicalHeightUsing(SizeType heightType, const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const
</ins><span class="cx"> {
</span><del>- if (Optional<LayoutUnit> logicalHeight = computeContentAndScrollbarLogicalHeightUsing(height, intrinsicContentHeight))
</del><ins>+ if (Optional<LayoutUnit> logicalHeight = computeContentAndScrollbarLogicalHeightUsing(heightType, height, intrinsicContentHeight))
</ins><span class="cx"> return adjustBorderBoxLogicalHeightForBoxSizing(logicalHeight.value());
</span><span class="cx"> return Nullopt;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Optional<LayoutUnit> RenderBox::computeContentLogicalHeight(const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const
</del><ins>+Optional<LayoutUnit> RenderBox::computeContentLogicalHeight(SizeType heightType, const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const
</ins><span class="cx"> {
</span><del>- if (Optional<LayoutUnit> heightIncludingScrollbar = computeContentAndScrollbarLogicalHeightUsing(height, intrinsicContentHeight))
</del><ins>+ if (Optional<LayoutUnit> heightIncludingScrollbar = computeContentAndScrollbarLogicalHeightUsing(heightType, height, intrinsicContentHeight))
</ins><span class="cx"> return std::max<LayoutUnit>(0, adjustContentBoxLogicalHeightForBoxSizing(heightIncludingScrollbar) - scrollbarLogicalHeight());
</span><span class="cx"> return Nullopt;
</span><span class="cx"> }
</span><span class="lines">@@ -2820,8 +2824,10 @@
</span><span class="cx"> return LayoutUnit(0);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Optional<LayoutUnit> RenderBox::computeContentAndScrollbarLogicalHeightUsing(const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const
</del><ins>+Optional<LayoutUnit> RenderBox::computeContentAndScrollbarLogicalHeightUsing(SizeType heightType, const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const
</ins><span class="cx"> {
</span><ins>+ if (height.isAuto())
+ return heightType == MinSize ? Optional<LayoutUnit>(0) : Nullopt;
</ins><span class="cx"> // FIXME: The CSS sizing spec is considering changing what min-content/max-content should resolve to.
</span><span class="cx"> // If that happens, this code will have to change.
</span><span class="cx"> if (height.isIntrinsic())
</span><span class="lines">@@ -2940,18 +2946,22 @@
</span><span class="cx">
</span><span class="cx"> LayoutUnit RenderBox::computeReplacedLogicalWidth(ShouldComputePreferred shouldComputePreferred) const
</span><span class="cx"> {
</span><del>- return computeReplacedLogicalWidthRespectingMinMaxWidth(computeReplacedLogicalWidthUsing(style().logicalWidth()), shouldComputePreferred);
</del><ins>+ return computeReplacedLogicalWidthRespectingMinMaxWidth(computeReplacedLogicalWidthUsing(MainOrPreferredSize, style().logicalWidth()), shouldComputePreferred);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> LayoutUnit RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth(LayoutUnit logicalWidth, ShouldComputePreferred shouldComputePreferred) const
</span><span class="cx"> {
</span><del>- LayoutUnit minLogicalWidth = (shouldComputePreferred == ComputePreferred && style().logicalMinWidth().isPercentOrCalculated()) || style().logicalMinWidth().isUndefined() ? logicalWidth : computeReplacedLogicalWidthUsing(style().logicalMinWidth());
- LayoutUnit maxLogicalWidth = (shouldComputePreferred == ComputePreferred && style().logicalMaxWidth().isPercentOrCalculated()) || style().logicalMaxWidth().isUndefined() ? logicalWidth : computeReplacedLogicalWidthUsing(style().logicalMaxWidth());
</del><ins>+ LayoutUnit minLogicalWidth = (shouldComputePreferred == ComputePreferred && style().logicalMinWidth().isPercentOrCalculated()) || style().logicalMinWidth().isUndefined() ? logicalWidth : computeReplacedLogicalWidthUsing(MinSize, style().logicalMinWidth());
+ LayoutUnit maxLogicalWidth = (shouldComputePreferred == ComputePreferred && style().logicalMaxWidth().isPercentOrCalculated()) || style().logicalMaxWidth().isUndefined() ? logicalWidth : computeReplacedLogicalWidthUsing(MaxSize, style().logicalMaxWidth());
</ins><span class="cx"> return std::max(minLogicalWidth, std::min(logicalWidth, maxLogicalWidth));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-LayoutUnit RenderBox::computeReplacedLogicalWidthUsing(Length logicalWidth) const
</del><ins>+LayoutUnit RenderBox::computeReplacedLogicalWidthUsing(SizeType widthType, Length logicalWidth) const
</ins><span class="cx"> {
</span><ins>+ ASSERT(widthType == MinSize || widthType == MainOrPreferredSize || !logicalWidth.isAuto());
+ if (widthType == MinSize && logicalWidth.isAuto())
+ return adjustContentBoxLogicalWidthForBoxSizing(0);
+
</ins><span class="cx"> switch (logicalWidth.type()) {
</span><span class="cx"> case Fixed:
</span><span class="cx"> return adjustContentBoxLogicalWidthForBoxSizing(logicalWidth.value());
</span><span class="lines">@@ -2992,18 +3002,22 @@
</span><span class="cx">
</span><span class="cx"> LayoutUnit RenderBox::computeReplacedLogicalHeight() const
</span><span class="cx"> {
</span><del>- return computeReplacedLogicalHeightRespectingMinMaxHeight(computeReplacedLogicalHeightUsing(style().logicalHeight()));
</del><ins>+ return computeReplacedLogicalHeightRespectingMinMaxHeight(computeReplacedLogicalHeightUsing(MainOrPreferredSize, style().logicalHeight()));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> LayoutUnit RenderBox::computeReplacedLogicalHeightRespectingMinMaxHeight(LayoutUnit logicalHeight) const
</span><span class="cx"> {
</span><del>- LayoutUnit minLogicalHeight = computeReplacedLogicalHeightUsing(style().logicalMinHeight());
- LayoutUnit maxLogicalHeight = style().logicalMaxHeight().isUndefined() ? logicalHeight : computeReplacedLogicalHeightUsing(style().logicalMaxHeight());
</del><ins>+ LayoutUnit minLogicalHeight = computeReplacedLogicalHeightUsing(MinSize, style().logicalMinHeight());
+ LayoutUnit maxLogicalHeight = style().logicalMaxHeight().isUndefined() ? logicalHeight : computeReplacedLogicalHeightUsing(MaxSize, style().logicalMaxHeight());
</ins><span class="cx"> return std::max(minLogicalHeight, std::min(logicalHeight, maxLogicalHeight));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-LayoutUnit RenderBox::computeReplacedLogicalHeightUsing(Length logicalHeight) const
</del><ins>+LayoutUnit RenderBox::computeReplacedLogicalHeightUsing(SizeType heightType, Length logicalHeight) const
</ins><span class="cx"> {
</span><ins>+ ASSERT(heightType == MinSize || heightType == MainOrPreferredSize || !logicalHeight.isAuto());
+ if (heightType == MinSize && logicalHeight.isAuto())
+ return adjustContentBoxLogicalHeightForBoxSizing(Optional<LayoutUnit>(0));
+
</ins><span class="cx"> switch (logicalHeight.type()) {
</span><span class="cx"> case Fixed:
</span><span class="cx"> return adjustContentBoxLogicalHeightForBoxSizing(LayoutUnit(logicalHeight.value()));
</span><span class="lines">@@ -3086,7 +3100,7 @@
</span><span class="cx"> return adjustContentBoxLogicalHeightForBoxSizing(valueForLength(h, availableHeight));
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (Optional<LayoutUnit> heightIncludingScrollbar = computeContentAndScrollbarLogicalHeightUsing(h, Nullopt))
</del><ins>+ if (Optional<LayoutUnit> heightIncludingScrollbar = computeContentAndScrollbarLogicalHeightUsing(MainOrPreferredSize, h, Nullopt))
</ins><span class="cx"> return std::max<LayoutUnit>(0, adjustContentBoxLogicalHeightForBoxSizing(heightIncludingScrollbar) - scrollbarLogicalHeight());
</span><span class="cx">
</span><span class="cx"> // FIXME: Check logicalTop/logicalBottom here to correctly handle vertical writing-mode.
</span><span class="lines">@@ -3362,7 +3376,7 @@
</span><span class="cx"> computeInlineStaticDistance(logicalLeftLength, logicalRightLength, this, containerBlock, containerLogicalWidth, region);
</span><span class="cx">
</span><span class="cx"> // Calculate constraint equation values for 'width' case.
</span><del>- computePositionedLogicalWidthUsing(style().logicalWidth(), containerBlock, containerDirection,
</del><ins>+ computePositionedLogicalWidthUsing(MainOrPreferredSize, style().logicalWidth(), containerBlock, containerDirection,
</ins><span class="cx"> containerLogicalWidth, bordersPlusPadding,
</span><span class="cx"> logicalLeftLength, logicalRightLength, marginLogicalLeft, marginLogicalRight,
</span><span class="cx"> computedValues);
</span><span class="lines">@@ -3371,7 +3385,7 @@
</span><span class="cx"> if (!style().logicalMaxWidth().isUndefined()) {
</span><span class="cx"> LogicalExtentComputedValues maxValues;
</span><span class="cx">
</span><del>- computePositionedLogicalWidthUsing(style().logicalMaxWidth(), containerBlock, containerDirection,
</del><ins>+ computePositionedLogicalWidthUsing(MaxSize, style().logicalMaxWidth(), containerBlock, containerDirection,
</ins><span class="cx"> containerLogicalWidth, bordersPlusPadding,
</span><span class="cx"> logicalLeftLength, logicalRightLength, marginLogicalLeft, marginLogicalRight,
</span><span class="cx"> maxValues);
</span><span class="lines">@@ -3388,7 +3402,7 @@
</span><span class="cx"> if (!style().logicalMinWidth().isZero() || style().logicalMinWidth().isIntrinsic()) {
</span><span class="cx"> LogicalExtentComputedValues minValues;
</span><span class="cx">
</span><del>- computePositionedLogicalWidthUsing(style().logicalMinWidth(), containerBlock, containerDirection,
</del><ins>+ computePositionedLogicalWidthUsing(MinSize, style().logicalMinWidth(), containerBlock, containerDirection,
</ins><span class="cx"> containerLogicalWidth, bordersPlusPadding,
</span><span class="cx"> logicalLeftLength, logicalRightLength, marginLogicalLeft, marginLogicalRight,
</span><span class="cx"> minValues);
</span><span class="lines">@@ -3433,12 +3447,15 @@
</span><span class="cx"> logicalLeftPos += (child->isHorizontalWritingMode() ? containerBlock->borderLeft() : containerBlock->borderTop());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void RenderBox::computePositionedLogicalWidthUsing(Length logicalWidth, const RenderBoxModelObject* containerBlock, TextDirection containerDirection,
</del><ins>+void RenderBox::computePositionedLogicalWidthUsing(SizeType widthType, Length logicalWidth, const RenderBoxModelObject* containerBlock, TextDirection containerDirection,
</ins><span class="cx"> LayoutUnit containerLogicalWidth, LayoutUnit bordersPlusPadding,
</span><span class="cx"> Length logicalLeft, Length logicalRight, Length marginLogicalLeft, Length marginLogicalRight,
</span><span class="cx"> LogicalExtentComputedValues& computedValues) const
</span><span class="cx"> {
</span><del>- if (logicalWidth.isIntrinsic())
</del><ins>+ ASSERT(widthType == MinSize || widthType == MainOrPreferredSize || !logicalWidth.isAuto());
+ if (widthType == MinSize && logicalWidth.isAuto())
+ logicalWidth = Length(0, Fixed);
+ else if (logicalWidth.isIntrinsic())
</ins><span class="cx"> logicalWidth = Length(computeIntrinsicLogicalWidthUsing(logicalWidth, containerLogicalWidth, bordersPlusPadding) - bordersPlusPadding, Fixed);
</span><span class="cx">
</span><span class="cx"> // 'left' and 'right' cannot both be 'auto' because one would of been
</span><span class="lines">@@ -3678,7 +3695,7 @@
</span><span class="cx">
</span><span class="cx"> // Calculate constraint equation values for 'height' case.
</span><span class="cx"> LayoutUnit logicalHeight = computedValues.m_extent;
</span><del>- computePositionedLogicalHeightUsing(styleToUse.logicalHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding, logicalHeight,
</del><ins>+ computePositionedLogicalHeightUsing(MainOrPreferredSize, styleToUse.logicalHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding, logicalHeight,
</ins><span class="cx"> logicalTopLength, logicalBottomLength, marginBefore, marginAfter,
</span><span class="cx"> computedValues);
</span><span class="cx">
</span><span class="lines">@@ -3689,7 +3706,7 @@
</span><span class="cx"> if (!styleToUse.logicalMaxHeight().isUndefined()) {
</span><span class="cx"> LogicalExtentComputedValues maxValues;
</span><span class="cx">
</span><del>- computePositionedLogicalHeightUsing(styleToUse.logicalMaxHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding, logicalHeight,
</del><ins>+ computePositionedLogicalHeightUsing(MaxSize, styleToUse.logicalMaxHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding, logicalHeight,
</ins><span class="cx"> logicalTopLength, logicalBottomLength, marginBefore, marginAfter,
</span><span class="cx"> maxValues);
</span><span class="cx">
</span><span class="lines">@@ -3705,7 +3722,7 @@
</span><span class="cx"> if (!styleToUse.logicalMinHeight().isZero() || styleToUse.logicalMinHeight().isIntrinsic()) {
</span><span class="cx"> LogicalExtentComputedValues minValues;
</span><span class="cx">
</span><del>- computePositionedLogicalHeightUsing(styleToUse.logicalMinHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding, logicalHeight,
</del><ins>+ computePositionedLogicalHeightUsing(MinSize, styleToUse.logicalMinHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding, logicalHeight,
</ins><span class="cx"> logicalTopLength, logicalBottomLength, marginBefore, marginAfter,
</span><span class="cx"> minValues);
</span><span class="cx">
</span><span class="lines">@@ -3761,11 +3778,15 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void RenderBox::computePositionedLogicalHeightUsing(Length logicalHeightLength, const RenderBoxModelObject* containerBlock,
</del><ins>+void RenderBox::computePositionedLogicalHeightUsing(SizeType heightType, Length logicalHeightLength, const RenderBoxModelObject* containerBlock,
</ins><span class="cx"> LayoutUnit containerLogicalHeight, LayoutUnit bordersPlusPadding, LayoutUnit logicalHeight,
</span><span class="cx"> Length logicalTop, Length logicalBottom, Length marginBefore, Length marginAfter,
</span><span class="cx"> LogicalExtentComputedValues& computedValues) const
</span><span class="cx"> {
</span><ins>+ ASSERT(heightType == MinSize || heightType == MainOrPreferredSize || !logicalHeightLength.isAuto());
+ if (heightType == MinSize && logicalHeightLength.isAuto())
+ logicalHeightLength = Length(0, Fixed);
+
</ins><span class="cx"> // 'top' and 'bottom' cannot both be 'auto' because 'top would of been
</span><span class="cx"> // converted to the static position in computePositionedLogicalHeight()
</span><span class="cx"> ASSERT(!(logicalTop.isAuto() && logicalBottom.isAuto()));
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBox.h (189566 => 189567)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBox.h        2015-09-10 09:10:11 UTC (rev 189566)
+++ trunk/Source/WebCore/rendering/RenderBox.h        2015-09-10 11:58:24 UTC (rev 189567)
</span><span class="lines">@@ -421,12 +421,12 @@
</span><span class="cx"> LayoutUnit shrinkLogicalWidthToAvoidFloats(LayoutUnit childMarginStart, LayoutUnit childMarginEnd, const RenderBlock* cb, RenderRegion*) const;
</span><span class="cx">
</span><span class="cx"> LayoutUnit computeLogicalWidthInRegionUsing(SizeType, Length logicalWidth, LayoutUnit availableLogicalWidth, const RenderBlock* containingBlock, RenderRegion*) const;
</span><del>- Optional<LayoutUnit> computeLogicalHeightUsing(const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const;
- Optional<LayoutUnit> computeContentLogicalHeight(const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const;
- Optional<LayoutUnit> computeContentAndScrollbarLogicalHeightUsing(const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const;
- LayoutUnit computeReplacedLogicalWidthUsing(Length width) const;
</del><ins>+ Optional<LayoutUnit> computeLogicalHeightUsing(SizeType, const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const;
+ Optional<LayoutUnit> computeContentLogicalHeight(SizeType, const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const;
+ Optional<LayoutUnit> computeContentAndScrollbarLogicalHeightUsing(SizeType, const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const;
+ LayoutUnit computeReplacedLogicalWidthUsing(SizeType, Length width) const;
</ins><span class="cx"> LayoutUnit computeReplacedLogicalWidthRespectingMinMaxWidth(LayoutUnit logicalWidth, ShouldComputePreferred = ComputeActual) const;
</span><del>- LayoutUnit computeReplacedLogicalHeightUsing(Length height) const;
</del><ins>+ LayoutUnit computeReplacedLogicalHeightUsing(SizeType, Length height) const;
</ins><span class="cx"> LayoutUnit computeReplacedLogicalHeightRespectingMinMaxHeight(LayoutUnit logicalHeight) const;
</span><span class="cx">
</span><span class="cx"> virtual LayoutUnit computeReplacedLogicalWidth(ShouldComputePreferred = ComputeActual) const;
</span><span class="lines">@@ -687,11 +687,11 @@
</span><span class="cx"> LayoutUnit viewLogicalHeightForPercentages() const;
</span><span class="cx">
</span><span class="cx"> void computePositionedLogicalHeight(LogicalExtentComputedValues&) const;
</span><del>- void computePositionedLogicalWidthUsing(Length logicalWidth, const RenderBoxModelObject* containerBlock, TextDirection containerDirection,
</del><ins>+ void computePositionedLogicalWidthUsing(SizeType, Length logicalWidth, const RenderBoxModelObject* containerBlock, TextDirection containerDirection,
</ins><span class="cx"> LayoutUnit containerLogicalWidth, LayoutUnit bordersPlusPadding,
</span><span class="cx"> Length logicalLeft, Length logicalRight, Length marginLogicalLeft, Length marginLogicalRight,
</span><span class="cx"> LogicalExtentComputedValues&) const;
</span><del>- void computePositionedLogicalHeightUsing(Length logicalHeightLength, const RenderBoxModelObject* containerBlock,
</del><ins>+ void computePositionedLogicalHeightUsing(SizeType, Length logicalHeightLength, const RenderBoxModelObject* containerBlock,
</ins><span class="cx"> LayoutUnit containerLogicalHeight, LayoutUnit bordersPlusPadding, LayoutUnit logicalHeight,
</span><span class="cx"> Length logicalTop, Length logicalBottom, Length marginLogicalTop, Length marginLogicalBottom,
</span><span class="cx"> LogicalExtentComputedValues&) const;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderButtonh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderButton.h (189566 => 189567)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderButton.h        2015-09-10 09:10:11 UTC (rev 189566)
+++ trunk/Source/WebCore/rendering/RenderButton.h        2015-09-10 11:58:24 UTC (rev 189567)
</span><span class="lines">@@ -76,6 +76,8 @@
</span><span class="cx">
</span><span class="cx"> void timerFired();
</span><span class="cx">
</span><ins>+ bool isFlexibleBoxImpl() const override { return true; }
+
</ins><span class="cx"> RenderTextFragment* m_buttonText;
</span><span class="cx"> RenderBlock* m_inner;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderFlexibleBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp (189566 => 189567)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp        2015-09-10 09:10:11 UTC (rev 189566)
+++ trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp        2015-09-10 11:58:24 UTC (rev 189567)
</span><span class="lines">@@ -455,7 +455,7 @@
</span><span class="cx"> // We don't have to check for "auto" here - computeContentLogicalHeight will just return Nullopt for that case anyway.
</span><span class="cx"> if (size.isIntrinsic())
</span><span class="cx"> child.layoutIfNeeded();
</span><del>- return child.computeContentLogicalHeight(size, child.logicalHeight() - child.borderAndPaddingLogicalHeight());
</del><ins>+ return child.computeContentLogicalHeight(sizeType, size, child.logicalHeight() - child.borderAndPaddingLogicalHeight());
</ins><span class="cx"> }
</span><span class="cx"> // FIXME: Figure out how this should work for regions and pass in the appropriate values.
</span><span class="cx"> RenderRegion* region = nullptr;
</span><span class="lines">@@ -646,6 +646,16 @@
</span><span class="cx"> return isHorizontalFlow() ? child.horizontalBorderAndPaddingExtent() : child.verticalBorderAndPaddingExtent();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+bool RenderFlexibleBox::mainAxisExtentIsDefinite() const
+{
+ return isColumnFlow() ? hasDefiniteLogicalHeight() : hasDefiniteLogicalWidth();
+}
+
+bool RenderFlexibleBox::mainAxisLengthIsIndefinite(const Length& flexBasis) const
+{
+ return flexBasis.isAuto() || (flexBasis.isPercentOrCalculated() && !mainAxisExtentIsDefinite());
+}
+
</ins><span class="cx"> LayoutUnit RenderFlexibleBox::mainAxisScrollbarExtentForChild(RenderBox& child) const
</span><span class="cx"> {
</span><span class="cx"> return isHorizontalFlow() ? child.verticalScrollbarWidth() : child.horizontalScrollbarHeight();
</span><span class="lines">@@ -845,12 +855,34 @@
</span><span class="cx"> LayoutUnit RenderFlexibleBox::adjustChildSizeForMinAndMax(RenderBox& child, LayoutUnit childSize)
</span><span class="cx"> {
</span><span class="cx"> Length max = isHorizontalFlow() ? child.style().maxWidth() : child.style().maxHeight();
</span><del>- if (max.isSpecifiedOrIntrinsic())
- childSize = std::min(childSize, computeMainAxisExtentForChild(child, MaxSize, max).valueOr(childSize));
</del><ins>+ Optional<LayoutUnit> maxExtent = Nullopt;
+ if (max.isSpecifiedOrIntrinsic()) {
+ maxExtent = computeMainAxisExtentForChild(child, MaxSize, max);
+ childSize = std::min(childSize, maxExtent.valueOr(childSize));
+ }
</ins><span class="cx">
</span><span class="cx"> Length min = isHorizontalFlow() ? child.style().minWidth() : child.style().minHeight();
</span><span class="cx"> if (min.isSpecifiedOrIntrinsic())
</span><span class="cx"> return std::max(childSize, computeMainAxisExtentForChild(child, MinSize, min).valueOr(childSize));
</span><ins>+
+ if (!isFlexibleBoxImpl() && min.isAuto() && mainAxisOverflowForChild(child) == OVISIBLE) {
+ // This is the implementation of CSS flexbox section 4.5 which defines the minimum size of "pure" flex
+ // items. For any other item the value should be 0, this also includes RenderFlexibleBox's derived clases
+ // (RenderButton, RenderFullScreen...) because that's just an implementation detail.
+ LayoutUnit contentSize = computeMainAxisExtentForChild(child, MinSize, Length(MinContent)).valueOr(0);
+ ASSERT(computeMainAxisExtentForChild(child, MinSize, Length(MinContent)));
+ contentSize = std::min(contentSize, maxExtent.valueOr(contentSize));
+
+ Length mainSize = isHorizontalFlow() ? child.style().width() : child.style().height();
+ if (!mainAxisLengthIsIndefinite(mainSize)) {
+ LayoutUnit resolvedMainSize = computeMainAxisExtentForChild(child, MainOrPreferredSize, mainSize).valueOr(0);
+ ASSERT(computeMainAxisExtentForChild(child, MainOrPreferredSize, mainSize));
+ LayoutUnit specifiedSize = std::min(resolvedMainSize, maxExtent.valueOr(resolvedMainSize));
+
+ return std::max(childSize, std::min(specifiedSize, contentSize));
+ }
+ return std::max(childSize, contentSize);
+ }
</ins><span class="cx"> return childSize;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1050,6 +1082,13 @@
</span><span class="cx"> child.updateLogicalHeight();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+EOverflow RenderFlexibleBox::mainAxisOverflowForChild(RenderBox& child) const
+{
+ if (isHorizontalFlow())
+ return child.style().overflowX();
+ return child.style().overflowY();
+}
+
</ins><span class="cx"> void RenderFlexibleBox::layoutAndPlaceChildren(LayoutUnit& crossAxisOffset, const OrderedFlexItemList& children, const Vector<LayoutUnit>& childSizes, LayoutUnit availableFreeSpace, bool relayoutChildren, Vector<LineContext>& lineContexts)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(childSizes.size() == children.size());
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderFlexibleBoxh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderFlexibleBox.h (189566 => 189567)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderFlexibleBox.h        2015-09-10 09:10:11 UTC (rev 189566)
+++ trunk/Source/WebCore/rendering/RenderFlexibleBox.h        2015-09-10 11:58:24 UTC (rev 189567)
</span><span class="lines">@@ -122,6 +122,7 @@
</span><span class="cx"> LayoutUnit mainAxisBorderAndPaddingExtentForChild(RenderBox& child) const;
</span><span class="cx"> LayoutUnit mainAxisScrollbarExtentForChild(RenderBox& child) const;
</span><span class="cx"> LayoutUnit preferredMainAxisContentExtentForChild(RenderBox& child, bool hasInfiniteLineLength);
</span><ins>+ EOverflow mainAxisOverflowForChild(RenderBox&) const;
</ins><span class="cx">
</span><span class="cx"> void layoutFlexItems(bool relayoutChildren, Vector<LineContext>&);
</span><span class="cx"> LayoutUnit autoMarginOffsetInMainAxis(const OrderedFlexItemList&, LayoutUnit& availableFreeSpace);
</span><span class="lines">@@ -157,6 +158,11 @@
</span><span class="cx"> void flipForRightToLeftColumn();
</span><span class="cx"> void flipForWrapReverse(const Vector<LineContext>&, LayoutUnit crossAxisStartEdge);
</span><span class="cx">
</span><ins>+ bool mainAxisExtentIsDefinite() const;
+ bool mainAxisLengthIsIndefinite(const Length& flexBasis) const;
+
+ virtual bool isFlexibleBoxImpl() const { return false; };
+
</ins><span class="cx"> mutable OrderIterator m_orderIterator;
</span><span class="cx"> int m_numberOfInFlowChildrenOnFirstLine;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderFullScreenh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderFullScreen.h (189566 => 189567)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderFullScreen.h        2015-09-10 09:10:11 UTC (rev 189566)
+++ trunk/Source/WebCore/rendering/RenderFullScreen.h        2015-09-10 11:58:24 UTC (rev 189567)
</span><span class="lines">@@ -48,6 +48,7 @@
</span><span class="cx"> private:
</span><span class="cx"> virtual bool isRenderFullScreen() const override { return true; }
</span><span class="cx"> virtual void willBeDestroyed() override;
</span><ins>+ bool isFlexibleBoxImpl() const override { return true; }
</ins><span class="cx">
</span><span class="cx"> protected:
</span><span class="cx"> RenderBlock* m_placeholder;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderGridcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderGrid.cpp (189566 => 189567)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderGrid.cpp        2015-09-10 09:10:11 UTC (rev 189566)
+++ trunk/Source/WebCore/rendering/RenderGrid.cpp        2015-09-10 11:58:24 UTC (rev 189567)
</span><span class="lines">@@ -452,7 +452,7 @@
</span><span class="cx"> ASSERT(trackLength.isSpecified());
</span><span class="cx"> if (direction == ForColumns)
</span><span class="cx"> return valueForLength(trackLength, logicalWidth() - borderAndPaddingLogicalWidth());
</span><del>- return valueForLength(trackLength, computeContentLogicalHeight(style().logicalHeight(), Nullopt).valueOr(0));
</del><ins>+ return valueForLength(trackLength, computeContentLogicalHeight(MainOrPreferredSize, style().logicalHeight(), Nullopt).valueOr(0));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> double RenderGrid::computeNormalizedFractionBreadth(Vector<GridTrack>& tracks, const GridSpan& tracksSpan, GridTrackSizingDirection direction, LayoutUnit spaceToFill) const
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderMediaControlElementsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderMediaControlElements.h (189566 => 189567)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderMediaControlElements.h        2015-09-10 09:10:11 UTC (rev 189566)
+++ trunk/Source/WebCore/rendering/RenderMediaControlElements.h        2015-09-10 11:58:24 UTC (rev 189567)
</span><span class="lines">@@ -52,6 +52,7 @@
</span><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> virtual void layout() override;
</span><ins>+ bool isFlexibleBoxImpl() const override { return true; }
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> // ----------------------------
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderMenuListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderMenuList.cpp (189566 => 189567)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderMenuList.cpp        2015-09-10 09:10:11 UTC (rev 189566)
+++ trunk/Source/WebCore/rendering/RenderMenuList.cpp        2015-09-10 11:58:24 UTC (rev 189567)
</span><span class="lines">@@ -113,7 +113,6 @@
</span><span class="cx"> innerStyle.setFlexGrow(1);
</span><span class="cx"> innerStyle.setFlexShrink(1);
</span><span class="cx"> // min-width: 0; is needed for correct shrinking.
</span><del>- // FIXME: Remove this line when https://bugs.webkit.org/show_bug.cgi?id=111790 is fixed.
</del><span class="cx"> innerStyle.setMinWidth(Length(0, Fixed));
</span><span class="cx"> // Use margin:auto instead of align-items:center to get safe centering, i.e.
</span><span class="cx"> // when the content overflows, treat it the same as align-items: flex-start.
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderMenuListh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderMenuList.h (189566 => 189567)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderMenuList.h        2015-09-10 09:10:11 UTC (rev 189566)
+++ trunk/Source/WebCore/rendering/RenderMenuList.h        2015-09-10 11:58:24 UTC (rev 189567)
</span><span class="lines">@@ -136,6 +136,8 @@
</span><span class="cx">
</span><span class="cx"> void didUpdateActiveOption(int optionIndex);
</span><span class="cx">
</span><ins>+ bool isFlexibleBoxImpl() const override { return true; }
+
</ins><span class="cx"> RenderText* m_buttonText;
</span><span class="cx"> RenderBlock* m_innerBlock;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderMultiColumnSetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderMultiColumnSet.cpp (189566 => 189567)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderMultiColumnSet.cpp        2015-09-10 09:10:11 UTC (rev 189566)
+++ trunk/Source/WebCore/rendering/RenderMultiColumnSet.cpp        2015-09-10 11:58:24 UTC (rev 189567)
</span><span class="lines">@@ -415,7 +415,7 @@
</span><span class="cx"> LayoutUnit availableHeight = multiColumnFlowThread()->columnHeightAvailable();
</span><span class="cx"> LayoutUnit maxColumnHeight = availableHeight ? availableHeight : RenderFlowThread::maxLogicalHeight();
</span><span class="cx"> if (!multicolStyle.logicalMaxHeight().isUndefined())
</span><del>- maxColumnHeight = std::min(maxColumnHeight, multicolBlock->computeContentLogicalHeight(multicolStyle.logicalMaxHeight(), Nullopt).valueOr(maxColumnHeight));
</del><ins>+ maxColumnHeight = std::min(maxColumnHeight, multicolBlock->computeContentLogicalHeight(MaxSize, multicolStyle.logicalMaxHeight(), Nullopt).valueOr(maxColumnHeight));
</ins><span class="cx"> return heightAdjustedForSetOffset(maxColumnHeight);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderNamedFlowFragmentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderNamedFlowFragment.cpp (189566 => 189567)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderNamedFlowFragment.cpp        2015-09-10 09:10:11 UTC (rev 189566)
+++ trunk/Source/WebCore/rendering/RenderNamedFlowFragment.cpp        2015-09-10 11:58:24 UTC (rev 189567)
</span><span class="lines">@@ -185,7 +185,7 @@
</span><span class="cx"> ASSERT(parent());
</span><span class="cx">
</span><span class="cx"> const RenderStyle& styleToUse = parent()->style();
</span><del>- return styleToUse.logicalMaxHeight().isUndefined() ? RenderFlowThread::maxLogicalHeight() : downcast<RenderBlock>(*parent()).computeReplacedLogicalHeightUsing(styleToUse.logicalMaxHeight());
</del><ins>+ return styleToUse.logicalMaxHeight().isUndefined() ? RenderFlowThread::maxLogicalHeight() : downcast<RenderBlock>(*parent()).computeReplacedLogicalHeightUsing(MaxSize, styleToUse.logicalMaxHeight());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> LayoutRect RenderNamedFlowFragment::flowThreadPortionRectForClipping(bool isFirstRegionInRange, bool isLastRegionInRange) const
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderReplacedcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderReplaced.cpp (189566 => 189567)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderReplaced.cpp        2015-09-10 09:10:11 UTC (rev 189566)
+++ trunk/Source/WebCore/rendering/RenderReplaced.cpp        2015-09-10 11:58:24 UTC (rev 189567)
</span><span class="lines">@@ -383,7 +383,7 @@
</span><span class="cx"> LayoutUnit RenderReplaced::computeReplacedLogicalWidth(ShouldComputePreferred shouldComputePreferred) const
</span><span class="cx"> {
</span><span class="cx"> if (style().logicalWidth().isSpecified() || style().logicalWidth().isIntrinsic())
</span><del>- return computeReplacedLogicalWidthRespectingMinMaxWidth(computeReplacedLogicalWidthUsing(style().logicalWidth()), shouldComputePreferred);
</del><ins>+ return computeReplacedLogicalWidthRespectingMinMaxWidth(computeReplacedLogicalWidthUsing(MainOrPreferredSize, style().logicalWidth()), shouldComputePreferred);
</ins><span class="cx">
</span><span class="cx"> RenderBox* contentRenderer = embeddedContentBox();
</span><span class="cx">
</span><span class="lines">@@ -418,7 +418,7 @@
</span><span class="cx"> // 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' = width of containing block
</span><span class="cx"> LayoutUnit logicalWidth;
</span><span class="cx"> if (RenderBlock* blockWithWidth = firstContainingBlockWithLogicalWidth(this))
</span><del>- logicalWidth = blockWithWidth->computeReplacedLogicalWidthRespectingMinMaxWidth(blockWithWidth->computeReplacedLogicalWidthUsing(blockWithWidth->style().logicalWidth()), shouldComputePreferred);
</del><ins>+ logicalWidth = blockWithWidth->computeReplacedLogicalWidthRespectingMinMaxWidth(blockWithWidth->computeReplacedLogicalWidthUsing(MainOrPreferredSize, blockWithWidth->style().logicalWidth()), shouldComputePreferred);
</ins><span class="cx"> else
</span><span class="cx"> logicalWidth = containingBlock()->availableLogicalWidth();
</span><span class="cx">
</span><span class="lines">@@ -448,7 +448,7 @@
</span><span class="cx"> {
</span><span class="cx"> // 10.5 Content height: the 'height' property: http://www.w3.org/TR/CSS21/visudet.html#propdef-height
</span><span class="cx"> if (hasReplacedLogicalHeight())
</span><del>- return computeReplacedLogicalHeightRespectingMinMaxHeight(computeReplacedLogicalHeightUsing(style().logicalHeight()));
</del><ins>+ return computeReplacedLogicalHeightRespectingMinMaxHeight(computeReplacedLogicalHeightUsing(MainOrPreferredSize, style().logicalHeight()));
</ins><span class="cx">
</span><span class="cx"> RenderBox* contentRenderer = embeddedContentBox();
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderSliderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderSlider.h (189566 => 189567)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderSlider.h        2015-09-10 09:10:11 UTC (rev 189566)
+++ trunk/Source/WebCore/rendering/RenderSlider.h        2015-09-10 11:58:24 UTC (rev 189567)
</span><span class="lines">@@ -49,6 +49,8 @@
</span><span class="cx"> virtual void computePreferredLogicalWidths() override;
</span><span class="cx"> virtual bool requiresForcedStyleRecalcPropagation() const override { return true; }
</span><span class="cx"> virtual void layout() override;
</span><ins>+
+ bool isFlexibleBoxImpl() const override { return true; }
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTextControlh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTextControl.h (189566 => 189567)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTextControl.h        2015-09-10 09:10:11 UTC (rev 189566)
+++ trunk/Source/WebCore/rendering/RenderTextControl.h        2015-09-10 11:58:24 UTC (rev 189567)
</span><span class="lines">@@ -105,6 +105,8 @@
</span><span class="cx"> virtual Optional<int> firstLineBaseline() const override { return RenderBlock::firstLineBaseline(); }
</span><span class="cx"> virtual Optional<int> inlineBlockBaseline(LineDirectionMode direction) const override { return RenderBlock::inlineBlockBaseline(direction); }
</span><span class="cx">
</span><ins>+private:
+ bool isFlexibleBoxImpl() const override { return true; }
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTextControlSingleLinecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp (189566 => 189567)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp        2015-09-10 09:10:11 UTC (rev 189566)
+++ trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp        2015-09-10 11:58:24 UTC (rev 189567)
</span><span class="lines">@@ -355,7 +355,6 @@
</span><span class="cx">
</span><span class="cx"> innerBlockStyle.get().setFlexGrow(1);
</span><span class="cx"> // min-width: 0; is needed for correct shrinking.
</span><del>- // FIXME: Remove this line when https://bugs.webkit.org/show_bug.cgi?id=111790 is fixed.
</del><span class="cx"> innerBlockStyle.get().setMinWidth(Length(0, Fixed));
</span><span class="cx"> innerBlockStyle.get().setDisplay(BLOCK);
</span><span class="cx"> innerBlockStyle.get().setDirection(LTR);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLBlockh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLBlock.h (189566 => 189567)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLBlock.h        2015-09-10 09:10:11 UTC (rev 189566)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLBlock.h        2015-09-10 11:58:24 UTC (rev 189567)
</span><span class="lines">@@ -67,6 +67,7 @@
</span><span class="cx"> private:
</span><span class="cx"> virtual bool isRenderMathMLBlock() const override final { return true; }
</span><span class="cx"> virtual const char* renderName() const override;
</span><ins>+ bool isFlexibleBoxImpl() const override { return true; }
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> class RenderMathMLTable final : public RenderTable {
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStyleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (189566 => 189567)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyle.h        2015-09-10 09:10:11 UTC (rev 189566)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h        2015-09-10 11:58:24 UTC (rev 189567)
</span><span class="lines">@@ -1903,7 +1903,7 @@
</span><span class="cx"> static float initialLetterSpacing() { return 0; }
</span><span class="cx"> static Length initialWordSpacing() { return Length(Fixed); }
</span><span class="cx"> static Length initialSize() { return Length(); }
</span><del>- static Length initialMinSize() { return Length(Fixed); }
</del><ins>+ static Length initialMinSize() { return Length(); }
</ins><span class="cx"> static Length initialMaxSize() { return Length(Undefined); }
</span><span class="cx"> static Length initialOffset() { return Length(); }
</span><span class="cx"> static Length initialMargin() { return Length(Fixed); }
</span></span></pre>
</div>
</div>
</body>
</html>