<!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>[285045] 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/285045">285045</a></dd>
<dt>Author</dt> <dd>ysuzuki@apple.com</dd>
<dt>Date</dt> <dd>2021-10-29 13:17:26 -0700 (Fri, 29 Oct 2021)</dd>
</dl>
<h3>Log Message</h3>
<pre>Unreviewed, revert <a href="http://trac.webkit.org/projects/webkit/changeset/284440">r284440</a>, <a href="http://trac.webkit.org/projects/webkit/changeset/284397">r284397</a>, <a href="http://trac.webkit.org/projects/webkit/changeset/284359">r284359</a>
LayoutTests/imported/w3c:
* web-platform-tests/css/css-flexbox/parsing/flex-basis-computed-expected.txt:
* web-platform-tests/css/css-flexbox/parsing/flex-basis-valid-expected.txt:
* web-platform-tests/css/css-flexbox/parsing/flex-shorthand-expected.txt:
Source/WebCore:
<a href="http://trac.webkit.org/projects/webkit/changeset/284359">r284359</a> causes Twitter using CPU 100%.
We reverted <a href="http://trac.webkit.org/projects/webkit/changeset/284440">r284440</a> and <a href="http://trac.webkit.org/projects/webkit/changeset/284397">r284397</a> too since they rely on <a href="http://trac.webkit.org/projects/webkit/changeset/284359">r284359</a> change.
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::init):
* css/CSSProperties.json:
* css/LengthFunctions.cpp:
(WebCore::valueForLength):
(WebCore::floatValueForLength):
* css/LengthFunctions.h:
(WebCore::minimumValueForLength):
* css/calc/CSSCalcValue.cpp:
(WebCore::createCSS):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFlexBasis):
(WebCore::CSSPropertyParser::consumeFlex):
* platform/Length.cpp:
(WebCore::operator<<):
* platform/Length.h:
(WebCore::Length::initialize):
(WebCore::Length::isContent const): Deleted.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeReplacedLogicalWidthUsing const):
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
(WebCore::RenderFlexibleBox::childMainSizeIsDefinite):
(WebCore::RenderFlexibleBox::childHasComputableAspectRatioAndCrossSizeIsConsideredDefinite):
(WebCore::RenderFlexibleBox::computeInnerFlexBaseSizeForChild):
(WebCore::RenderFlexibleBox::computeFlexItemMinMaxSizes):
(WebCore::RenderFlexibleBox::constructFlexItem):
(WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
(WebCore::RenderFlexibleBox::applyStretchAlignmentToChild):
(WebCore::ScopedUnboundedBoxWithFlexBasisAsChildMainSize::ScopedUnboundedBoxWithFlexBasisAsChildMainSize): Deleted.
(WebCore::ScopedUnboundedBoxWithFlexBasisAsChildMainSize::~ScopedUnboundedBoxWithFlexBasisAsChildMainSize): Deleted.
(WebCore::RenderFlexibleBox::computeFlexBaseSizeForChild): Deleted.
* rendering/RenderFlexibleBox.h:
* style/StyleBuilderConverter.h:
(WebCore::Style::BuilderConverter::convertLengthSizing):
Source/WebKit:
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<Length>::encode):
(IPC::ArgumentCoder<Length>::decode):
LayoutTests:
* TestExpectations:</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="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssflexboxparsingflexbasiscomputedexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/parsing/flex-basis-computed-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssflexboxparsingflexbasisvalidexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/parsing/flex-basis-valid-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssflexboxparsingflexshorthandexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/parsing/flex-shorthand-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssCSSPrimitiveValuecpp">trunk/Source/WebCore/css/CSSPrimitiveValue.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSPropertiesjson">trunk/Source/WebCore/css/CSSProperties.json</a></li>
<li><a href="#trunkSourceWebCorecssLengthFunctionscpp">trunk/Source/WebCore/css/LengthFunctions.cpp</a></li>
<li><a href="#trunkSourceWebCorecssLengthFunctionsh">trunk/Source/WebCore/css/LengthFunctions.h</a></li>
<li><a href="#trunkSourceWebCorecsscalcCSSCalcValuecpp">trunk/Source/WebCore/css/calc/CSSCalcValue.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSPropertyParsercpp">trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformLengthcpp">trunk/Source/WebCore/platform/Length.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformLengthh">trunk/Source/WebCore/platform/Length.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxcpp">trunk/Source/WebCore/rendering/RenderBox.cpp</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="#trunkSourceWebCorestyleStyleBuilderConverterh">trunk/Source/WebCore/style/StyleBuilderConverter.h</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitSharedWebCoreArgumentCoderscpp">trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (285044 => 285045)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog 2021-10-29 19:28:34 UTC (rev 285044)
+++ trunk/LayoutTests/ChangeLog 2021-10-29 20:17:26 UTC (rev 285045)
</span><span class="lines">@@ -1,3 +1,9 @@
</span><ins>+2021-10-29 Yusuke Suzuki <ysuzuki@apple.com>
+
+ Unreviewed, revert r284440, r284397, r284359
+
+ * TestExpectations:
+
</ins><span class="cx"> 2021-10-29 Ayumi Kojima <ayumi_kojima@apple.com>
</span><span class="cx">
</span><span class="cx"> [ BigSur wk1 Debug arm64 ] inspector/audit/run-accessibility.html is a flaky timeout.
</span></span></pre></div>
<a id="trunkLayoutTestsTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/TestExpectations (285044 => 285045)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/TestExpectations 2021-10-29 19:28:34 UTC (rev 285044)
+++ trunk/LayoutTests/TestExpectations 2021-10-29 20:17:26 UTC (rev 285045)
</span><span class="lines">@@ -4188,7 +4188,9 @@
</span><span class="cx"> webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/vertical-alignment-srl-034.xht [ ImageOnlyFailure ]
</span><span class="cx"> webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/vertical-alignment-srl-040.xht [ ImageOnlyFailure ]
</span><span class="cx">
</span><ins>+webkit.org/b/219343 imported/w3c/web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-column-012.html [ ImageOnlyFailure ]
</ins><span class="cx"> webkit.org/b/219343 imported/w3c/web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-column-015.html [ ImageOnlyFailure ]
</span><ins>+webkit.org/b/219343 imported/w3c/web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-row-007.html [ ImageOnlyFailure ]
</ins><span class="cx"> webkit.org/b/219343 imported/w3c/web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-row-010.html [ ImageOnlyFailure ]
</span><span class="cx"> webkit.org/b/219343 imported/w3c/web-platform-tests/css/css-flexbox/aspect-ratio-intrinsic-size-005.html [ ImageOnlyFailure ]
</span><span class="cx">
</span><span class="lines">@@ -4214,6 +4216,7 @@
</span><span class="cx"> webkit.org/b/221473 imported/w3c/web-platform-tests/css/css-flexbox/table-as-item-inflexible-in-column-1.html [ ImageOnlyFailure ]
</span><span class="cx"> webkit.org/b/221473 imported/w3c/web-platform-tests/css/css-flexbox/table-as-item-inflexible-in-column-2.html [ ImageOnlyFailure ]
</span><span class="cx"> webkit.org/b/221473 imported/w3c/web-platform-tests/css/css-flexbox/table-as-item-inflexible-in-row-2.html [ ImageOnlyFailure ]
</span><ins>+webkit.org/b/221473 imported/w3c/web-platform-tests/css/css-flexbox/table-as-item-min-height-1.html [ ImageOnlyFailure ]
</ins><span class="cx">
</span><span class="cx"> # SVGs as flex items.
</span><span class="cx"> webkit.org/b/221474 imported/w3c/web-platform-tests/css/css-flexbox/svg-root-as-flex-item-002.html [ ImageOnlyFailure ]
</span><span class="lines">@@ -4234,6 +4237,17 @@
</span><span class="cx"> webkit.org/b/221478 imported/w3c/web-platform-tests/css/css-flexbox/dynamic-baseline-change.html [ ImageOnlyFailure ]
</span><span class="cx"> webkit.org/b/221478 imported/w3c/web-platform-tests/css/css-flexbox/synthesize-vrl-baseline.html [ ImageOnlyFailure ]
</span><span class="cx">
</span><ins>+# flex-basis:content.
+webkit.org/b/221479 imported/w3c/web-platform-tests/css/css-flexbox/flexbox-flex-basis-content-001a.html [ ImageOnlyFailure ]
+webkit.org/b/221479 imported/w3c/web-platform-tests/css/css-flexbox/flexbox-flex-basis-content-001b.html [ ImageOnlyFailure ]
+webkit.org/b/221479 imported/w3c/web-platform-tests/css/css-flexbox/flexbox-flex-basis-content-002a.html [ ImageOnlyFailure ]
+webkit.org/b/221479 imported/w3c/web-platform-tests/css/css-flexbox/flexbox-flex-basis-content-002b.html [ ImageOnlyFailure ]
+webkit.org/b/221479 imported/w3c/web-platform-tests/css/css-flexbox/flexbox-flex-basis-content-003a.html [ ImageOnlyFailure ]
+webkit.org/b/221479 imported/w3c/web-platform-tests/css/css-flexbox/flexbox-flex-basis-content-004a.html [ ImageOnlyFailure ]
+
+# flex-basis with %.
+webkit.org/b/ imported/w3c/web-platform-tests/css/css-flexbox/flex-basis-011.html [ ImageOnlyFailure ]
+
</ins><span class="cx"> # Flex item's min|max content contributions
</span><span class="cx"> webkit.org/b/230747 imported/w3c/web-platform-tests/css/css-flexbox/flex-container-max-content-001.html [ ImageOnlyFailure ]
</span><span class="cx"> webkit.org/b/230747 imported/w3c/web-platform-tests/css/css-flexbox/flex-container-min-content-001.html [ ImageOnlyFailure ]
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (285044 => 285045)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog 2021-10-29 19:28:34 UTC (rev 285044)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2021-10-29 20:17:26 UTC (rev 285045)
</span><span class="lines">@@ -1,3 +1,11 @@
</span><ins>+2021-10-29 Yusuke Suzuki <ysuzuki@apple.com>
+
+ Unreviewed, revert r284440, r284397, r284359
+
+ * web-platform-tests/css/css-flexbox/parsing/flex-basis-computed-expected.txt:
+ * web-platform-tests/css/css-flexbox/parsing/flex-basis-valid-expected.txt:
+ * web-platform-tests/css/css-flexbox/parsing/flex-shorthand-expected.txt:
+
</ins><span class="cx"> 2021-10-29 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> [ iOS ] imported/w3c/web-platform-tests/dom/events/scrolling/iframe-chains.html is missing its results
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssflexboxparsingflexbasiscomputedexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/parsing/flex-basis-computed-expected.txt (285044 => 285045)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/parsing/flex-basis-computed-expected.txt 2021-10-29 19:28:34 UTC (rev 285044)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/parsing/flex-basis-computed-expected.txt 2021-10-29 20:17:26 UTC (rev 285045)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> PASS Property flex-basis value '1px'
</span><span class="cx"> PASS Property flex-basis value '400%'
</span><span class="cx"> PASS Property flex-basis value 'auto'
</span><del>-PASS Property flex-basis value 'content'
</del><ins>+FAIL Property flex-basis value 'content' assert_true: 'content' is a supported value for flex-basis. expected true got false
</ins><span class="cx"> FAIL Property flex-basis value 'fit-content' assert_true: 'fit-content' is a supported value for flex-basis. expected true got false
</span><span class="cx"> FAIL Property flex-basis value 'min-content' assert_true: 'min-content' is a supported value for flex-basis. expected true got false
</span><span class="cx"> FAIL Property flex-basis value 'max-content' assert_true: 'max-content' is a supported value for flex-basis. expected true got false
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssflexboxparsingflexbasisvalidexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/parsing/flex-basis-valid-expected.txt (285044 => 285045)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/parsing/flex-basis-valid-expected.txt 2021-10-29 19:28:34 UTC (rev 285044)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/parsing/flex-basis-valid-expected.txt 2021-10-29 20:17:26 UTC (rev 285045)
</span><span class="lines">@@ -6,5 +6,5 @@
</span><span class="cx"> FAIL e.style['flex-basis'] = "fit-content" should set the property value assert_not_equals: property should be set got disallowed value ""
</span><span class="cx"> FAIL e.style['flex-basis'] = "min-content" should set the property value assert_not_equals: property should be set got disallowed value ""
</span><span class="cx"> FAIL e.style['flex-basis'] = "max-content" should set the property value assert_not_equals: property should be set got disallowed value ""
</span><del>-PASS e.style['flex-basis'] = "content" should set the property value
</del><ins>+FAIL e.style['flex-basis'] = "content" should set the property value assert_not_equals: property should be set got disallowed value ""
</ins><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssflexboxparsingflexshorthandexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/parsing/flex-shorthand-expected.txt (285044 => 285045)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/parsing/flex-shorthand-expected.txt 2021-10-29 19:28:34 UTC (rev 285044)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/parsing/flex-shorthand-expected.txt 2021-10-29 20:17:26 UTC (rev 285045)
</span><span class="lines">@@ -23,10 +23,10 @@
</span><span class="cx"> PASS e.style['flex'] = "8 auto" should set flex-grow
</span><span class="cx"> PASS e.style['flex'] = "8 auto" should set flex-shrink
</span><span class="cx"> PASS e.style['flex'] = "8 auto" should not set unrelated longhands
</span><del>-PASS e.style['flex'] = "content" should set flex-basis
-PASS e.style['flex'] = "content" should set flex-grow
-PASS e.style['flex'] = "content" should set flex-shrink
-PASS e.style['flex'] = "content" should not set unrelated longhands
</del><ins>+FAIL e.style['flex'] = "content" should set flex-basis assert_equals: flex-basis should be canonical expected "content" but got ""
+FAIL e.style['flex'] = "content" should set flex-grow assert_equals: flex-grow should be canonical expected "1" but got ""
+FAIL e.style['flex'] = "content" should set flex-shrink assert_equals: flex-shrink should be canonical expected "1" but got ""
+FAIL e.style['flex'] = "content" should not set unrelated longhands assert_true: expected true got false
</ins><span class="cx"> FAIL e.style['flex'] = "0 fit-content" should set flex-basis assert_equals: flex-basis should be canonical expected "fit-content" but got ""
</span><span class="cx"> FAIL e.style['flex'] = "0 fit-content" should set flex-grow assert_equals: flex-grow should be canonical expected "0" but got ""
</span><span class="cx"> FAIL e.style['flex'] = "0 fit-content" should set flex-shrink assert_equals: flex-shrink should be canonical expected "1" but got ""
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (285044 => 285045)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog 2021-10-29 19:28:34 UTC (rev 285044)
+++ trunk/Source/WebCore/ChangeLog 2021-10-29 20:17:26 UTC (rev 285045)
</span><span class="lines">@@ -1,3 +1,47 @@
</span><ins>+2021-10-29 Yusuke Suzuki <ysuzuki@apple.com>
+
+ Unreviewed, revert r284440, r284397, r284359
+
+ r284359 causes Twitter using CPU 100%.
+ We reverted r284440 and r284397 too since they rely on r284359 change.
+
+ * css/CSSPrimitiveValue.cpp:
+ (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+ (WebCore::CSSPrimitiveValue::init):
+ * css/CSSProperties.json:
+ * css/LengthFunctions.cpp:
+ (WebCore::valueForLength):
+ (WebCore::floatValueForLength):
+ * css/LengthFunctions.h:
+ (WebCore::minimumValueForLength):
+ * css/calc/CSSCalcValue.cpp:
+ (WebCore::createCSS):
+ * css/parser/CSSPropertyParser.cpp:
+ (WebCore::consumeFlexBasis):
+ (WebCore::CSSPropertyParser::consumeFlex):
+ * platform/Length.cpp:
+ (WebCore::operator<<):
+ * platform/Length.h:
+ (WebCore::Length::initialize):
+ (WebCore::Length::isContent const): Deleted.
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::computeReplacedLogicalWidthUsing const):
+ * rendering/RenderFlexibleBox.cpp:
+ (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
+ (WebCore::RenderFlexibleBox::childMainSizeIsDefinite):
+ (WebCore::RenderFlexibleBox::childHasComputableAspectRatioAndCrossSizeIsConsideredDefinite):
+ (WebCore::RenderFlexibleBox::computeInnerFlexBaseSizeForChild):
+ (WebCore::RenderFlexibleBox::computeFlexItemMinMaxSizes):
+ (WebCore::RenderFlexibleBox::constructFlexItem):
+ (WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
+ (WebCore::RenderFlexibleBox::applyStretchAlignmentToChild):
+ (WebCore::ScopedUnboundedBoxWithFlexBasisAsChildMainSize::ScopedUnboundedBoxWithFlexBasisAsChildMainSize): Deleted.
+ (WebCore::ScopedUnboundedBoxWithFlexBasisAsChildMainSize::~ScopedUnboundedBoxWithFlexBasisAsChildMainSize): Deleted.
+ (WebCore::RenderFlexibleBox::computeFlexBaseSizeForChild): Deleted.
+ * rendering/RenderFlexibleBox.h:
+ * style/StyleBuilderConverter.h:
+ (WebCore::Style::BuilderConverter::convertLengthSizing):
+
</ins><span class="cx"> 2021-10-29 Sihui Liu <sihui_liu@apple.com>
</span><span class="cx">
</span><span class="cx"> Release FileSystemStorageHandle when it is not in use
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPrimitiveValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPrimitiveValue.cpp (285044 => 285045)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPrimitiveValue.cpp 2021-10-29 19:28:34 UTC (rev 285044)
+++ trunk/Source/WebCore/css/CSSPrimitiveValue.cpp 2021-10-29 20:17:26 UTC (rev 285045)
</span><span class="lines">@@ -37,7 +37,6 @@
</span><span class="cx"> #include "Counter.h"
</span><span class="cx"> #include "DeprecatedCSSOMPrimitiveValue.h"
</span><span class="cx"> #include "FontCascade.h"
</span><del>-#include "Length.h"
</del><span class="cx"> #include "Node.h"
</span><span class="cx"> #include "Pair.h"
</span><span class="cx"> #include "Rect.h"
</span><span class="lines">@@ -315,7 +314,6 @@
</span><span class="cx"> {
</span><span class="cx"> switch (length.type()) {
</span><span class="cx"> case LengthType::Auto:
</span><del>- case LengthType::Content:
</del><span class="cx"> case LengthType::Intrinsic:
</span><span class="cx"> case LengthType::MinIntrinsic:
</span><span class="cx"> case LengthType::MinContent:
</span><span class="lines">@@ -371,10 +369,6 @@
</span><span class="cx"> setPrimitiveUnitType(CSSUnitType::CSS_VALUE_ID);
</span><span class="cx"> m_value.valueID = CSSValueAuto;
</span><span class="cx"> return;
</span><del>- case LengthType::Content:
- setPrimitiveUnitType(CSSUnitType::CSS_VALUE_ID);
- m_value.valueID = CSSValueContent;
- return;
</del><span class="cx"> case LengthType::Fixed:
</span><span class="cx"> setPrimitiveUnitType(CSSUnitType::CSS_PX);
</span><span class="cx"> m_value.num = length.value();
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPropertiesjson"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSProperties.json (285044 => 285045)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSProperties.json 2021-10-29 19:28:34 UTC (rev 285044)
+++ trunk/Source/WebCore/css/CSSProperties.json 2021-10-29 20:17:26 UTC (rev 285045)
</span><span class="lines">@@ -5630,7 +5630,7 @@
</span><span class="cx"> "aliases": [
</span><span class="cx"> "-webkit-flex-basis"
</span><span class="cx"> ],
</span><del>- "converter": "LengthSizing"
</del><ins>+ "converter": "LengthOrAuto"
</ins><span class="cx"> },
</span><span class="cx"> "specification": {
</span><span class="cx"> "category": "css-flexbox",
</span></span></pre></div>
<a id="trunkSourceWebCorecssLengthFunctionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/LengthFunctions.cpp (285044 => 285045)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/LengthFunctions.cpp 2021-10-29 19:28:34 UTC (rev 285044)
+++ trunk/Source/WebCore/css/LengthFunctions.cpp 2021-10-29 20:17:26 UTC (rev 285045)
</span><span class="lines">@@ -49,7 +49,6 @@
</span><span class="cx"> case LengthType::Relative:
</span><span class="cx"> case LengthType::Intrinsic:
</span><span class="cx"> case LengthType::MinIntrinsic:
</span><del>- case LengthType::Content:
</del><span class="cx"> case LengthType::MinContent:
</span><span class="cx"> case LengthType::MaxContent:
</span><span class="cx"> case LengthType::FitContent:
</span><span class="lines">@@ -77,7 +76,6 @@
</span><span class="cx"> case LengthType::Relative:
</span><span class="cx"> case LengthType::Intrinsic:
</span><span class="cx"> case LengthType::MinIntrinsic:
</span><del>- case LengthType::Content:
</del><span class="cx"> case LengthType::MinContent:
</span><span class="cx"> case LengthType::MaxContent:
</span><span class="cx"> case LengthType::FitContent:
</span><span class="lines">@@ -104,7 +102,6 @@
</span><span class="cx"> case LengthType::Relative:
</span><span class="cx"> case LengthType::Intrinsic:
</span><span class="cx"> case LengthType::MinIntrinsic:
</span><del>- case LengthType::Content:
</del><span class="cx"> case LengthType::MinContent:
</span><span class="cx"> case LengthType::MaxContent:
</span><span class="cx"> case LengthType::FitContent:
</span></span></pre></div>
<a id="trunkSourceWebCorecssLengthFunctionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/LengthFunctions.h (285044 => 285045)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/LengthFunctions.h 2021-10-29 19:28:34 UTC (rev 285044)
+++ trunk/Source/WebCore/css/LengthFunctions.h 2021-10-29 20:17:26 UTC (rev 285045)
</span><span class="lines">@@ -59,7 +59,6 @@
</span><span class="cx"> return LayoutUnit(length.nonNanCalculatedValue(maximumValue));
</span><span class="cx"> case LengthType::FillAvailable:
</span><span class="cx"> case LengthType::Auto:
</span><del>- case LengthType::Content:
</del><span class="cx"> return 0;
</span><span class="cx"> case LengthType::Relative:
</span><span class="cx"> case LengthType::Intrinsic:
</span></span></pre></div>
<a id="trunkSourceWebCorecsscalcCSSCalcValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/calc/CSSCalcValue.cpp (285044 => 285045)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/calc/CSSCalcValue.cpp 2021-10-29 19:28:34 UTC (rev 285044)
+++ trunk/Source/WebCore/css/calc/CSSCalcValue.cpp 2021-10-29 20:17:26 UTC (rev 285045)
</span><span class="lines">@@ -264,7 +264,6 @@
</span><span class="cx"> case LengthType::Calculated:
</span><span class="cx"> return createCSS(length.calculationValue().expression(), style);
</span><span class="cx"> case LengthType::Auto:
</span><del>- case LengthType::Content:
</del><span class="cx"> case LengthType::Intrinsic:
</span><span class="cx"> case LengthType::MinIntrinsic:
</span><span class="cx"> case LengthType::MinContent:
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSPropertyParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp (285044 => 285045)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp 2021-10-29 19:28:34 UTC (rev 285044)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp 2021-10-29 20:17:26 UTC (rev 285045)
</span><span class="lines">@@ -2241,7 +2241,7 @@
</span><span class="cx"> static RefPtr<CSSValue> consumeFlexBasis(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</span><span class="cx"> {
</span><span class="cx"> // FIXME: Support intrinsic dimensions too.
</span><del>- if (range.peek().id() == CSSValueAuto || range.peek().id() == CSSValueContent)
</del><ins>+ if (range.peek().id() == CSSValueAuto)
</ins><span class="cx"> return consumeIdent(range);
</span><span class="cx"> return consumeLengthOrPercent(range, cssParserMode, ValueRange::NonNegative);
</span><span class="cx"> }
</span><span class="lines">@@ -5237,7 +5237,7 @@
</span><span class="cx"> else
</span><span class="cx"> return false;
</span><span class="cx"> } else if (!flexBasis) {
</span><del>- if (m_range.peek().id() == CSSValueAuto || m_range.peek().id() == CSSValueContent)
</del><ins>+ if (m_range.peek().id() == CSSValueAuto)
</ins><span class="cx"> flexBasis = consumeIdent(m_range);
</span><span class="cx"> if (!flexBasis)
</span><span class="cx"> flexBasis = consumeLengthOrPercent(m_range, m_context.mode, ValueRange::NonNegative);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformLengthcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/Length.cpp (285044 => 285045)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/Length.cpp 2021-10-29 19:28:34 UTC (rev 285044)
+++ trunk/Source/WebCore/platform/Length.cpp 2021-10-29 20:17:26 UTC (rev 285045)
</span><span class="lines">@@ -370,7 +370,6 @@
</span><span class="cx"> case LengthType::FillAvailable: ts << "fill-available"; break;
</span><span class="cx"> case LengthType::FitContent: ts << "fit-content"; break;
</span><span class="cx"> case LengthType::Calculated: ts << "calc"; break;
</span><del>- case LengthType::Content: ts << "content"; break;
</del><span class="cx"> case LengthType::Undefined: ts << "undefined"; break;
</span><span class="cx"> }
</span><span class="cx"> return ts;
</span><span class="lines">@@ -380,7 +379,6 @@
</span><span class="cx"> {
</span><span class="cx"> switch (length.type()) {
</span><span class="cx"> case LengthType::Auto:
</span><del>- case LengthType::Content:
</del><span class="cx"> case LengthType::Undefined:
</span><span class="cx"> ts << length.type();
</span><span class="cx"> break;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformLengthh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/Length.h (285044 => 285045)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/Length.h 2021-10-29 19:28:34 UTC (rev 285044)
+++ trunk/Source/WebCore/platform/Length.h 2021-10-29 20:17:26 UTC (rev 285045)
</span><span class="lines">@@ -47,7 +47,6 @@
</span><span class="cx"> FillAvailable,
</span><span class="cx"> FitContent,
</span><span class="cx"> Calculated,
</span><del>- Content,
</del><span class="cx"> Undefined
</span><span class="cx"> };
</span><span class="cx">
</span><span class="lines">@@ -104,7 +103,6 @@
</span><span class="cx"> bool isFillAvailable() const;
</span><span class="cx"> bool isFitContent() const;
</span><span class="cx"> bool isMinIntrinsic() const;
</span><del>- bool isContent() const;
</del><span class="cx">
</span><span class="cx"> bool hasQuirk() const;
</span><span class="cx"> void setHasQuirk(bool);
</span><span class="lines">@@ -238,7 +236,6 @@
</span><span class="cx">
</span><span class="cx"> switch (m_type) {
</span><span class="cx"> case LengthType::Auto:
</span><del>- case LengthType::Content:
</del><span class="cx"> case LengthType::Undefined:
</span><span class="cx"> m_intValue = 0;
</span><span class="cx"> break;
</span><span class="lines">@@ -271,7 +268,6 @@
</span><span class="cx">
</span><span class="cx"> switch (m_type) {
</span><span class="cx"> case LengthType::Auto:
</span><del>- case LengthType::Content:
</del><span class="cx"> case LengthType::Undefined:
</span><span class="cx"> m_intValue = 0;
</span><span class="cx"> break;
</span><span class="lines">@@ -515,11 +511,6 @@
</span><span class="cx"> return type() == LengthType::MinIntrinsic;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline bool Length::isContent() const
-{
- return type() == LengthType::Content;
-}
-
</del><span class="cx"> Length convertTo100PercentMinusLength(const Length&);
</span><span class="cx">
</span><span class="cx"> WTF::TextStream& operator<<(WTF::TextStream&, Length);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (285044 => 285045)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBox.cpp 2021-10-29 19:28:34 UTC (rev 285044)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp 2021-10-29 20:17:26 UTC (rev 285045)
</span><span class="lines">@@ -3346,7 +3346,6 @@
</span><span class="cx"> case LengthType::Intrinsic:
</span><span class="cx"> case LengthType::MinIntrinsic:
</span><span class="cx"> case LengthType::Auto:
</span><del>- case LengthType::Content:
</del><span class="cx"> case LengthType::Relative:
</span><span class="cx"> case LengthType::Undefined:
</span><span class="cx"> return intrinsicLogicalWidth();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderFlexibleBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp (285044 => 285045)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp 2021-10-29 19:28:34 UTC (rev 285044)
+++ trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp 2021-10-29 20:17:26 UTC (rev 285045)
</span><span class="lines">@@ -34,12 +34,9 @@
</span><span class="cx"> #include "FlexibleBoxAlgorithm.h"
</span><span class="cx"> #include "HitTestResult.h"
</span><span class="cx"> #include "LayoutRepainter.h"
</span><del>-#include "Length.h"
-#include "RenderBox.h"
</del><span class="cx"> #include "RenderChildIterator.h"
</span><span class="cx"> #include "RenderLayer.h"
</span><span class="cx"> #include "RenderLayoutState.h"
</span><del>-#include "RenderObjectEnums.h"
</del><span class="cx"> #include "RenderStyleConstants.h"
</span><span class="cx"> #include "RenderView.h"
</span><span class="cx"> #include "WritingMode.h"
</span><span class="lines">@@ -631,7 +628,13 @@
</span><span class="cx"> // horizontal flow and horizontal writing mode, or vertical flow and vertical
</span><span class="cx"> // writing mode. Otherwise we need the logical height.
</span><span class="cx"> if (!mainAxisIsChildInlineAxis(child)) {
</span><del>- child.layoutIfNeeded();
</del><ins>+ // We don't have to check for "auto" here - computeContentLogicalHeight
+ // will just return a null Optional for that case anyway. It's safe to access
+ // scrollbarLogicalHeight here because ComputeNextFlexLine will have
+ // already forced layout on the child. We previously did a layout out the child
+ // if necessary (see ComputeNextFlexLine and the call to
+ // childHasIntrinsicMainAxisSize) so we can be sure that the two height
+ // calls here will return up-to-date data.
</ins><span class="cx"> std::optional<LayoutUnit> height = child.computeContentLogicalHeight(sizeType, size, cachedChildIntrinsicContentLogicalHeight(child));
</span><span class="cx"> if (!height)
</span><span class="cx"> return height;
</span><span class="lines">@@ -918,7 +921,7 @@
</span><span class="cx">
</span><span class="cx"> bool RenderFlexibleBox::childMainSizeIsDefinite(const RenderBox& child, const Length& flexBasis)
</span><span class="cx"> {
</span><del>- if (flexBasis.isAuto() || flexBasis.isContent())
</del><ins>+ if (flexBasis.isAuto())
</ins><span class="cx"> return false;
</span><span class="cx"> if (isColumnFlow() && (flexBasis.isIntrinsic() || flexBasis.type() == LengthType::Intrinsic))
</span><span class="cx"> return false;
</span><span class="lines">@@ -936,8 +939,7 @@
</span><span class="cx">
</span><span class="cx"> bool RenderFlexibleBox::childHasComputableAspectRatioAndCrossSizeIsConsideredDefinite(const RenderBox& child)
</span><span class="cx"> {
</span><del>- auto flexBasis = flexBasisForChild(child);
- return childHasComputableAspectRatio(child) && (flexBasis.isContent() || flexBasis.isAuto())
</del><ins>+ return childHasComputableAspectRatio(child)
</ins><span class="cx"> && (childCrossSizeIsDefinite(child, crossSizeLengthForChild(MainOrPreferredSize, child)) || childCrossSizeShouldUseContainerCrossSize(child));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -998,88 +1000,29 @@
</span><span class="cx"> m_intrinsicSizeAlongMainAxis.remove(&child);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-// This is a RAII class that is used to temporarily set the flex basis as the child size in the main axis. Apart from that
-// the min|max-size restrictions are ignored for this computation. See https://drafts.csswg.org/css-flexbox/#algo-main-item
-// for further details.
-class ScopedUnboundedBoxWithFlexBasisAsChildMainSize {
-public:
- ScopedUnboundedBoxWithFlexBasisAsChildMainSize(RenderBox& child, Length flexBasis, bool mainAxisIsInlineAxis)
- : m_child(child)
- , m_isHorizontalWritingModeInParallelFlow(mainAxisIsInlineAxis == child.isHorizontalWritingMode())
- , m_mainAxisIsInlineAxis(mainAxisIsInlineAxis)
- {
- if (m_isHorizontalWritingModeInParallelFlow) {
- m_originalMinSize = m_child.style().minWidth();
- m_originalMaxSize = m_child.style().maxWidth();
- m_child.mutableStyle().setMinWidth(RenderStyle::initialMinSize());
- m_child.mutableStyle().setMaxWidth(RenderStyle::initialMaxSize());
- } else {
- m_originalMinSize = m_child.style().minHeight();
- m_originalMaxSize = m_child.style().maxHeight();
- m_child.mutableStyle().setMinHeight(RenderStyle::initialMinSize());
- m_child.mutableStyle().setMaxHeight(RenderStyle::initialMaxSize());
- }
-
- if (m_mainAxisIsInlineAxis) {
- m_originalSize = m_child.style().logicalWidth();
- m_child.mutableStyle().setLogicalWidth(Length(flexBasis));
- return;
- }
- m_originalSize = m_child.style().logicalHeight();
- m_child.mutableStyle().setLogicalHeight(Length(flexBasis));
- }
- ~ScopedUnboundedBoxWithFlexBasisAsChildMainSize()
- {
- if (m_isHorizontalWritingModeInParallelFlow) {
- m_child.mutableStyle().setMinWidth(Length(m_originalMinSize));
- m_child.mutableStyle().setMaxWidth(Length(m_originalMaxSize));
- } else {
- m_child.mutableStyle().setMinHeight(Length(m_originalMinSize));
- m_child.mutableStyle().setMaxHeight(Length(m_originalMaxSize));
- }
-
- if (m_mainAxisIsInlineAxis)
- m_child.mutableStyle().setLogicalWidth(Length(m_originalSize));
- else
- m_child.mutableStyle().setLogicalHeight(Length(m_originalSize));
- }
-private:
- RenderBox& m_child;
- bool m_isHorizontalWritingModeInParallelFlow;
- bool m_mainAxisIsInlineAxis;
- Length m_originalSize;
- Length m_originalMinSize;
- Length m_originalMaxSize;
-};
-
-// https://drafts.csswg.org/css-flexbox/#algo-main-item
-LayoutUnit RenderFlexibleBox::computeFlexBaseSizeForChild(RenderBox& child, LayoutUnit mainAxisBorderAndPadding)
</del><ins>+LayoutUnit RenderFlexibleBox::computeInnerFlexBaseSizeForChild(RenderBox& child, LayoutUnit mainAxisBorderAndPadding)
</ins><span class="cx"> {
</span><span class="cx"> Length flexBasis = flexBasisForChild(child);
</span><del>- // 9.3.2 A.
</del><span class="cx"> if (childMainSizeIsDefinite(child, flexBasis))
</span><span class="cx"> return std::max(0_lu, computeMainAxisExtentForChild(child, MainOrPreferredSize, flexBasis).value());
</span><span class="cx">
</span><del>- // 9.3.2 B.
</del><span class="cx"> if (childHasComputableAspectRatioAndCrossSizeIsConsideredDefinite(child)) {
</span><span class="cx"> const Length& crossSizeLength = crossSizeLengthForChild(MainOrPreferredSize, child);
</span><span class="cx"> return adjustChildSizeForAspectRatioCrossAxisMinAndMax(child, computeMainSizeFromAspectRatioUsing(child, crossSizeLength));
</span><span class="cx"> }
</span><span class="cx">
</span><del>- // FIXME: implement 9.3.2 C.
- // FIXME: implement 9.3.2 D.
-
- // 9.3.2 E. Otherwise, size the item into the available space using its used flex basis in place of its main size.
- {
- ScopedUnboundedBoxWithFlexBasisAsChildMainSize flexBasisScope(child, flexBasis.isContent() ? Length(LengthType::MaxContent) : flexBasis, mainAxisIsChildInlineAxis(child));
- if (mainAxisIsChildInlineAxis(child))
- return child.maxPreferredLogicalWidth() - mainAxisBorderAndPadding;
-
- if (childHasIntrinsicMainAxisSize(child))
- child.setNeedsLayout(MarkOnlyThis);
- child.layoutIfNeeded();
- return child.logicalHeight() - mainAxisBorderAndPadding;
</del><ins>+ // The flex basis is indefinite (=auto), so we need to compute the actual width of the child.
+ LayoutUnit mainAxisExtent;
+ if (!mainAxisIsChildInlineAxis(child)) {
+ ASSERT(!child.needsLayout());
+ ASSERT(m_intrinsicSizeAlongMainAxis.contains(&child));
+ mainAxisExtent = m_intrinsicSizeAlongMainAxis.get(&child);
+ } else {
+ // We don't need to add scrollbarLogicalWidth here because the preferred
+ // width includes the scrollbar, even for overflow: auto.
+ mainAxisExtent = child.maxPreferredLogicalWidth();
</ins><span class="cx"> }
</span><ins>+ return mainAxisExtent - mainAxisBorderAndPadding;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void RenderFlexibleBox::layoutFlexItems(bool relayoutChildren)
</span><span class="lines">@@ -1317,7 +1260,7 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-std::pair<LayoutUnit, LayoutUnit> RenderFlexibleBox::computeFlexItemMinMaxSizes(RenderBox& child, bool relayoutChildren)
</del><ins>+std::pair<LayoutUnit, LayoutUnit> RenderFlexibleBox::computeFlexItemMinMaxSizes(RenderBox& child)
</ins><span class="cx"> {
</span><span class="cx"> Length max = mainSizeLengthForChild(MaxSize, child);
</span><span class="cx"> std::optional<LayoutUnit> maxExtent = std::nullopt;
</span><span class="lines">@@ -1336,30 +1279,8 @@
</span><span class="cx"> Length childCrossSizeLength = crossSizeLengthForChild(MainOrPreferredSize, child);
</span><span class="cx"> if (child.isRenderReplaced() && childHasComputableAspectRatio(child) && childCrossSizeIsDefinite(child, childCrossSizeLength))
</span><span class="cx"> contentSize = computeMainSizeFromAspectRatioUsing(child, childCrossSizeLength);
</span><del>- else {
- if (childHasIntrinsicMainAxisSize(child)) {
- // If this condition is true, then computeMainAxisExtentForChild will call
- // child.intrinsicContentLogicalHeight() and child.scrollbarLogicalHeight(),
- // so if the child has intrinsic min/max/preferred size, run layout on it now to make sure
- // its logical height and scroll bars are up to date.
- updateBlockChildDirtyBitsBeforeLayout(relayoutChildren, child);
- // Don't resolve percentages in children. This is especially important for the min-height calculation,
- // where we want percentages to be treated as auto.
- if (child.needsLayout() || !m_intrinsicSizeAlongMainAxis.contains(&child)) {
- if (isHorizontalWritingMode() == child.isHorizontalWritingMode())
- child.setOverridingContainingBlockContentLogicalHeight(std::nullopt);
- else
- child.setOverridingContainingBlockContentLogicalWidth(std::nullopt);
-
- child.clearOverridingContentSize();
- child.setChildNeedsLayout(MarkOnlyThis);
- child.layoutIfNeeded();
- cacheChildMainSize(child);
- child.clearOverridingContainingBlockContentSize();
- }
- }
</del><ins>+ else
</ins><span class="cx"> contentSize = computeMainAxisExtentForChild(child, MinSize, Length(LengthType::MinContent)).value_or(0);
</span><del>- }
</del><span class="cx"> if (child.hasIntrinsicAspectRatio() && child.intrinsicSize().height())
</span><span class="cx"> contentSize = adjustChildSizeForAspectRatioCrossAxisMinAndMax(child, contentSize);
</span><span class="cx"> ASSERT(contentSize >= 0);
</span><span class="lines">@@ -1446,10 +1367,32 @@
</span><span class="cx"> {
</span><span class="cx"> auto childHadLayout = child.everHadLayout();
</span><span class="cx"> child.clearOverridingContentSize();
</span><ins>+ if (childHasIntrinsicMainAxisSize(child)) {
+ // If this condition is true, then computeMainAxisExtentForChild will call
+ // child.intrinsicContentLogicalHeight() and child.scrollbarLogicalHeight(),
+ // so if the child has intrinsic min/max/preferred size, run layout on it now to make sure
+ // its logical height and scroll bars are up to date.
+ updateBlockChildDirtyBitsBeforeLayout(relayoutChildren, child);
+ // Don't resolve percentages in children. This is especially important for the min-height calculation,
+ // where we want percentages to be treated as auto. For flex-basis itself, this is not a problem because
+ // by definition we have an indefinite flex basis here and thus percentages should not resolve.
+ if (child.needsLayout() || !m_intrinsicSizeAlongMainAxis.contains(&child)) {
+ if (isHorizontalWritingMode() == child.isHorizontalWritingMode())
+ child.setOverridingContainingBlockContentLogicalHeight(std::nullopt);
+ else
+ child.setOverridingContainingBlockContentLogicalWidth(std::nullopt);
+ child.clearOverridingContentSize();
+ child.setChildNeedsLayout(MarkOnlyThis);
+ child.layoutIfNeeded();
+ cacheChildMainSize(child);
+ child.clearOverridingContainingBlockContentSize();
+ }
+ }
+
</ins><span class="cx"> LayoutUnit borderAndPadding = isHorizontalFlow() ? child.horizontalBorderAndPaddingExtent() : child.verticalBorderAndPaddingExtent();
</span><del>- LayoutUnit childFlexBaseSize = computeFlexBaseSizeForChild(child, borderAndPadding);
</del><ins>+ LayoutUnit childInnerFlexBaseSize = computeInnerFlexBaseSizeForChild(child, borderAndPadding);
</ins><span class="cx"> LayoutUnit margin = isHorizontalFlow() ? child.horizontalMarginExtent() : child.verticalMarginExtent();
</span><del>- return FlexItem(child, childFlexBaseSize, borderAndPadding, margin, computeFlexItemMinMaxSizes(child, relayoutChildren), childHadLayout);
</del><ins>+ return FlexItem(child, childInnerFlexBaseSize, borderAndPadding, margin, computeFlexItemMinMaxSizes(child), childHadLayout);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void RenderFlexibleBox::freezeViolations(Vector<FlexItem*>& violations, LayoutUnit& availableFreeSpace, double& totalFlexGrow, double& totalFlexShrink, double& totalWeightedFlexShrink)
</span><span class="lines">@@ -1945,7 +1888,7 @@
</span><span class="cx"> resetAutoMarginsAndLogicalTopInCrossAxis(child);
</span><span class="cx"> }
</span><span class="cx"> // We may have already forced relayout for orthogonal flowing children in
</span><del>- // computeFlexBaseSizeForChild.
</del><ins>+ // computeInnerFlexBaseSizeForChild.
</ins><span class="cx"> bool forceChildRelayout = relayoutChildren && !m_relaidOutChildren.contains(&child);
</span><span class="cx"> if (!forceChildRelayout && childHasPercentHeightDescendants(child)) {
</span><span class="cx"> // Have to force another relayout even though the child is sized
</span><span class="lines">@@ -2200,7 +2143,7 @@
</span><span class="cx"> } else if (!mainAxisIsChildInlineAxis(child) && child.style().logicalWidth().isAuto()) {
</span><span class="cx"> LayoutUnit childWidth = std::max(0_lu, lineCrossAxisExtent - crossAxisMarginExtentForChild(child));
</span><span class="cx"> childWidth = child.constrainLogicalWidthInFragmentByMinMax(childWidth, crossAxisContentExtent(), *this, nullptr);
</span><del>-
</del><ins>+
</ins><span class="cx"> if (childWidth != child.logicalWidth()) {
</span><span class="cx"> child.setOverridingLogicalWidth(childWidth);
</span><span class="cx"> child.setChildNeedsLayout(MarkOnlyThis);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderFlexibleBoxh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderFlexibleBox.h (285044 => 285045)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderFlexibleBox.h 2021-10-29 19:28:34 UTC (rev 285044)
+++ trunk/Source/WebCore/rendering/RenderFlexibleBox.h 2021-10-29 20:17:26 UTC (rev 285045)
</span><span class="lines">@@ -150,7 +150,7 @@
</span><span class="cx"> void computeChildIntrinsicLogicalWidths(RenderObject&, LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const override;
</span><span class="cx"> LayoutUnit computeMainSizeFromAspectRatioUsing(const RenderBox& child, Length crossSizeLength) const;
</span><span class="cx"> void setFlowAwareLocationForChild(RenderBox& child, const LayoutPoint&);
</span><del>- LayoutUnit computeFlexBaseSizeForChild(RenderBox& child, LayoutUnit mainAxisBorderAndPadding);
</del><ins>+ LayoutUnit computeInnerFlexBaseSizeForChild(RenderBox& child, LayoutUnit mainAxisBorderAndPadding);
</ins><span class="cx"> void adjustAlignmentForChild(RenderBox& child, LayoutUnit);
</span><span class="cx"> ItemPosition alignmentForChild(const RenderBox& child) const;
</span><span class="cx"> bool canComputePercentageFlexBasis(const RenderBox& child, const Length& flexBasis, UpdatePercentageHeightDescendants);
</span><span class="lines">@@ -176,7 +176,7 @@
</span><span class="cx">
</span><span class="cx"> LayoutUnit computeChildMarginValue(Length margin);
</span><span class="cx"> void prepareOrderIteratorAndMargins();
</span><del>- std::pair<LayoutUnit, LayoutUnit> computeFlexItemMinMaxSizes(RenderBox& child, bool relayoutChildren);
</del><ins>+ std::pair<LayoutUnit, LayoutUnit> computeFlexItemMinMaxSizes(RenderBox& child);
</ins><span class="cx"> LayoutUnit adjustChildSizeForAspectRatioCrossAxisMinAndMax(const RenderBox& child, LayoutUnit childSize);
</span><span class="cx"> FlexItem constructFlexItem(RenderBox&, bool relayoutChildren);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorestyleStyleBuilderConverterh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/StyleBuilderConverter.h (285044 => 285045)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/StyleBuilderConverter.h 2021-10-29 19:28:34 UTC (rev 285044)
+++ trunk/Source/WebCore/style/StyleBuilderConverter.h 2021-10-29 20:17:26 UTC (rev 285045)
</span><span class="lines">@@ -68,7 +68,6 @@
</span><span class="cx"> public:
</span><span class="cx"> static Length convertLength(const BuilderState&, const CSSValue&);
</span><span class="cx"> static Length convertLengthOrAuto(const BuilderState&, const CSSValue&);
</span><del>- static Length convertLengthOrAutoOrContent(const BuilderState&, const CSSValue&);
</del><span class="cx"> static Length convertLengthSizing(const BuilderState&, const CSSValue&);
</span><span class="cx"> static Length convertLengthMaxSizing(const BuilderState&, const CSSValue&);
</span><span class="cx"> static TabSize convertTabSize(const BuilderState&, const CSSValue&);
</span><span class="lines">@@ -245,8 +244,6 @@
</span><span class="cx"> return Length(LengthType::FitContent);
</span><span class="cx"> case CSSValueAuto:
</span><span class="cx"> return Length(LengthType::Auto);
</span><del>- case CSSValueContent:
- return Length(LengthType::Content);
</del><span class="cx"> default:
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><span class="cx"> return Length();
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (285044 => 285045)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog 2021-10-29 19:28:34 UTC (rev 285044)
+++ trunk/Source/WebKit/ChangeLog 2021-10-29 20:17:26 UTC (rev 285045)
</span><span class="lines">@@ -1,3 +1,11 @@
</span><ins>+2021-10-29 Yusuke Suzuki <ysuzuki@apple.com>
+
+ Unreviewed, revert r284440, r284397, r284359
+
+ * Shared/WebCoreArgumentCoders.cpp:
+ (IPC::ArgumentCoder<Length>::encode):
+ (IPC::ArgumentCoder<Length>::decode):
+
</ins><span class="cx"> 2021-10-29 Sihui Liu <sihui_liu@apple.com>
</span><span class="cx">
</span><span class="cx"> Release FileSystemStorageHandle when it is not in use
</span></span></pre></div>
<a id="trunkSourceWebKitSharedWebCoreArgumentCoderscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp (285044 => 285045)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp 2021-10-29 19:28:34 UTC (rev 285044)
+++ trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp 2021-10-29 20:17:26 UTC (rev 285045)
</span><span class="lines">@@ -717,7 +717,6 @@
</span><span class="cx">
</span><span class="cx"> switch (length.type()) {
</span><span class="cx"> case LengthType::Auto:
</span><del>- case LengthType::Content:
</del><span class="cx"> case LengthType::Undefined:
</span><span class="cx"> break;
</span><span class="cx"> case LengthType::Fixed:
</span><span class="lines">@@ -753,7 +752,6 @@
</span><span class="cx">
</span><span class="cx"> switch (type) {
</span><span class="cx"> case LengthType::Auto:
</span><del>- case LengthType::Content:
</del><span class="cx"> case LengthType::Undefined:
</span><span class="cx"> length = Length(type);
</span><span class="cx"> return true;
</span></span></pre>
</div>
</div>
</body>
</html>