Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
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>. 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. Canonical link: https://commits.webkit.org/167120@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@189567 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
31 changed files
with
359 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
PASS | ||
PASS | ||
PASS | ||
PASS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.