Changeset 266695 in webkit
- Timestamp:
- Sep 7, 2020, 2:20:46 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 7 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (1 diff)
-
LayoutTests/fast/flexbox/nested-column-intrinsic-min-disabled-expected.html (deleted)
-
LayoutTests/fast/flexbox/nested-column-intrinsic-min-disabled.html (deleted)
-
LayoutTests/platform/ios/fast/forms/auto-fill-button/input-strong-password-auto-fill-button-expected.txt (modified) (2 diffs)
-
LayoutTests/platform/mac/fast/forms/auto-fill-button/input-strong-password-auto-fill-button-expected.txt (modified) (2 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/rendering/RenderFlexibleBox.cpp (modified) (6 diffs)
-
Source/WebCore/rendering/RenderFlexibleBox.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r266684 r266695 1 2020-09-02 Sergio Villar Senin <svillar@igalia.com> 2 3 [css-flexbox] min-height: auto not applied to nested flexboxes. 4 https://bugs.webkit.org/show_bug.cgi?id=210089 5 6 Reviewed by Daniel Bates. 7 8 Apart from enabling some tests we're removing a test which is now invalid as it was added 9 under the condition that we were not matching the specs wrt percentage height computation in 10 column flexboxes. 11 12 * TestExpectations: Removed two test cases that are passing now. 13 * fast/flexbox/nested-column-intrinsic-min-disabled-expected.html: Removed. 14 * fast/flexbox/nested-column-intrinsic-min-disabled.html: Removed. 15 * platform/ios/fast/forms/auto-fill-button/input-strong-password-auto-fill-button-expected.txt: Updated. 16 * platform/mac/fast/forms/auto-fill-button/input-strong-password-auto-fill-button-expected.txt: Ditto. 17 1 18 2020-09-06 Chris Dumez <cdumez@apple.com> 2 19 -
trunk/LayoutTests/TestExpectations
r266684 r266695 3936 3936 webkit.org/b/209649 imported/w3c/web-platform-tests/css/css-flexbox/padding-overflow-crash.html [ ImageOnlyFailure ] 3937 3937 webkit.org/b/210077 imported/w3c/web-platform-tests/css/css-flexbox/flex-basis-010.html [ ImageOnlyFailure ] 3938 webkit.org/b/210089 imported/w3c/web-platform-tests/css/css-flexbox/flex-minimum-height-flex-items-011.xht [ ImageOnlyFailure ]3939 webkit.org/b/210089 imported/w3c/web-platform-tests/css/css-flexbox/flex-minimum-height-flex-items-013.html [ ImageOnlyFailure ]3940 3938 webkit.org/b/210093 imported/w3c/web-platform-tests/css/css-flexbox/select-element-zero-height-001.html [ ImageOnlyFailure ] 3941 3939 webkit.org/b/210093 imported/w3c/web-platform-tests/css/css-flexbox/select-element-zero-height-002.html [ ImageOnlyFailure ] -
trunk/LayoutTests/platform/ios/fast/forms/auto-fill-button/input-strong-password-auto-fill-button-expected.txt
r262716 r266695 49 49 layer at (654,57) size 20x12 scrollWidth 94 scrollHeight 26 50 50 RenderFlexibleBox {DIV} at (6,3) size 21x13 51 RenderBlock {DIV} at (0,12) size 20x14 [color=#000000CC]51 RenderBlock {DIV} at (0,12) size 95x14 [color=#000000CC] 52 52 RenderText {#text} at (6,0) size 89x14 53 53 text run at (6,0) width 89: "Strong Password" … … 63 63 layer at (176,134) size 20x12 scrollWidth 94 scrollHeight 26 64 64 RenderFlexibleBox {DIV} at (6,47) size 21x13 65 RenderBlock {DIV} at (0,12) size 20x14 [color=#000000CC]65 RenderBlock {DIV} at (0,12) size 95x14 [color=#000000CC] 66 66 RenderText {#text} at (6,0) size 89x14 67 67 text run at (6,0) width 89: "Strong Password" -
trunk/LayoutTests/platform/mac/fast/forms/auto-fill-button/input-strong-password-auto-fill-button-expected.txt
r232480 r266695 49 49 layer at (653,55) size 20x13 scrollWidth 94 scrollHeight 26 50 50 RenderFlexibleBox {DIV} at (3,3) size 20x13 51 RenderBlock {DIV} at (0,13) size 20x13 [color=#000000CC]51 RenderBlock {DIV} at (0,13) size 95x13 [color=#000000CC] 52 52 RenderText {#text} at (6,0) size 89x13 53 53 text run at (6,0) width 89: "Strong Password" … … 63 63 layer at (177,133) size 20x13 scrollWidth 94 scrollHeight 26 64 64 RenderFlexibleBox {DIV} at (3,46) size 20x14 65 RenderBlock {DIV} at (0,13) size 20x13 [color=#000000CC]65 RenderBlock {DIV} at (0,13) size 95x13 [color=#000000CC] 66 66 RenderText {#text} at (6,0) size 89x13 67 67 text run at (6,0) width 89: "Strong Password" -
trunk/Source/WebCore/ChangeLog
r266693 r266695 1 2020-09-02 Sergio Villar Senin <svillar@igalia.com> 2 3 [css-flexbox] min-height: auto not applied to nested flexboxes. 4 https://bugs.webkit.org/show_bug.cgi?id=210089 5 6 Reviewed by Daniel Bates. 7 8 Nested flexboxes with column direction were not computing correctly min-size:auto because 9 we were explicitly preventing them from doing so in the code. Implemented the required bits to 10 make it work correctly and thus removed the retriction. The idea is to set an indefinite override 11 containing block size so that percentages would be resolved to auto as spec'ed. The code which 12 decides whether to apply min-size:auto was refactored in the shouldApplyMinSizeAutoForChild() method. 13 14 In order not to cause regressions some other two additional changes were also implemented. First we 15 had to adjust childHasIntrinsicMainAxisSize() so that it also takes into account the cases where 16 shouldApplyMinSizeAutoForChild() is true and return true. Secondly we had to add an additional case 17 to mainAxisLengthIsDefinite() so that it returns false for column flows where the flexBasis is intrinsic. 18 19 Inspired by Blink's crrev.com/c/1641510, crrev.com/c/1269995 & crrev.com/c/1786297 by <cbiesinger@chromium.org> 20 21 * rendering/RenderFlexibleBox.cpp: 22 (WebCore::RenderFlexibleBox::shouldApplyMinSizeAutoForChild const): Refactored from 23 RenderFlexibleBox::adjustChildSizeForMinAndMax. 24 (WebCore::RenderFlexibleBox::mainAxisLengthIsDefinite const): Additional case for column flows. 25 (WebCore::RenderFlexibleBox::layoutFlexItems): Reset m_hasDefiniteHeight to Unknown after calling 26 constructFlexItem() because the latter might set now an override containing block height which basically 27 potentially makes any cached size value incorrect. 28 (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax): Directly call shouldApplyMinSizeAutoForChild(). 29 (WebCore::RenderFlexibleBox::constructFlexItem): Set an indefinite override containing block size for 30 children with percentage sizes so that they're resolved as auto. 31 (WebCore::RenderFlexibleBox::childHasIntrinsicMainAxisSize const): Return true for those cases where the 32 main axis length is indefinite and also when shouldApplyMinSizeAutoForChild(). 33 * rendering/RenderFlexibleBox.h: 34 1 35 2020-09-06 Myles C. Maxfield <mmaxfield@apple.com> 2 36 -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r266691 r266695 439 439 } 440 440 441 bool RenderFlexibleBox::shouldApplyMinSizeAutoForChild(const RenderBox& child) const 442 { 443 // css-flexbox section 4.5 444 auto minSize = isHorizontalFlow() ? child.style().minWidth() : child.style().minHeight(); 445 return minSize.isAuto() && mainAxisOverflowForChild(child) == Overflow::Visible; 446 } 447 441 448 Length RenderFlexibleBox::flexBasisForChild(const RenderBox& child) const 442 449 { … … 797 804 if (flexBasis.isAuto()) 798 805 return false; 806 if (isColumnFlow() && flexBasis.isIntrinsic()) 807 return false; 799 808 if (flexBasis.isPercentOrCalculated()) { 800 809 if (!isColumnFlow() || m_hasDefiniteHeight == SizeDefiniteness::Definite) … … 915 924 } 916 925 m_reversedOrderIteratorForHitTesting.reverse(); 926 927 // constructFlexItem() might set the override containing block height so any value cached for definiteness might be incorrect. 928 m_hasDefiniteHeight = SizeDefiniteness::Unknown; 917 929 918 930 const LayoutUnit lineBreakLength = mainAxisContentExtent(LayoutUnit::max()); … … 1129 1141 return std::max(childSize, std::max(0_lu, computeMainAxisExtentForChild(child, MinSize, min).valueOr(childSize))); 1130 1142 1131 if (!isFlexibleBoxImpl() && min.isAuto() && mainAxisOverflowForChild(child) == Overflow::Visible && !(isColumnFlow() && is<RenderFlexibleBox>(child))) { 1132 // FIXME: For now, we do not handle min-height: auto for nested 1133 // column flexboxes. We need to implement 1134 // https://drafts.csswg.org/css-flexbox/#intrinsic-sizes before that 1135 // produces reasonable results. Tracking bug: https://crbug.com/581553 1136 // css-flexbox section 4.5 1143 if (shouldApplyMinSizeAutoForChild(child)) { 1137 1144 // FIXME: If the min value is expected to be valid here, we need to come up with a non optional version of computeMainAxisExtentForChild and 1138 1145 // ensure it's valid through the virtual calls of computeIntrinsicLogicalContentHeightUsing. … … 1233 1240 FlexItem RenderFlexibleBox::constructFlexItem(RenderBox& child, bool relayoutChildren) 1234 1241 { 1235 // If this condition is true, then computeMainAxisExtentForChild will call 1236 // child.intrinsicContentLogicalHeight() and 1237 // child.scrollbarLogicalHeight(), so if the child has intrinsic 1238 // min/max/preferred size, run layout on it now to make sure its logical 1239 // height and scroll bars are up to date. 1240 if (childHasIntrinsicMainAxisSize(child) && child.needsLayout()) { 1241 child.clearOverrideContentSize(); 1242 child.setChildNeedsLayout(MarkOnlyThis); 1243 child.layoutIfNeeded(); 1244 cacheChildMainSize(child); 1245 relayoutChildren = false; 1242 if (childHasIntrinsicMainAxisSize(child)) { 1243 // If this condition is true, then computeMainAxisExtentForChild will call 1244 // child.intrinsicContentLogicalHeight() and child.scrollbarLogicalHeight(), 1245 // so if the child has intrinsic min/max/preferred size, run layout on it now to make sure 1246 // its logical height and scroll bars are up to date. 1247 updateBlockChildDirtyBitsBeforeLayout(relayoutChildren, child); 1248 // Don't resolve percentages in children. This is especially important for the min-height calculation, 1249 // where we want percentages to be treated as auto. For flex-basis itself, this is not a problem because 1250 // by definition we have an indefinite flex basis here and thus percentages should not resolve. 1251 if (child.needsLayout() || !m_intrinsicSizeAlongMainAxis.contains(&child)) { 1252 if (isHorizontalWritingMode() == child.isHorizontalWritingMode()) 1253 child.setOverrideContainingBlockContentLogicalHeight(WTF::nullopt); 1254 else 1255 child.setOverrideContainingBlockContentLogicalWidth(WTF::nullopt); 1256 child.clearOverrideContentSize(); 1257 child.setChildNeedsLayout(MarkOnlyThis); 1258 child.layoutIfNeeded(); 1259 cacheChildMainSize(child); 1260 relayoutChildren = false; 1261 child.clearOverrideContainingBlockContentSize(); 1262 } 1246 1263 } 1247 1264 … … 1557 1574 bool RenderFlexibleBox::childHasIntrinsicMainAxisSize(const RenderBox& child) const 1558 1575 { 1559 bool result = false; 1560 if (isHorizontalFlow() != child.style().isHorizontalWritingMode()) { 1561 Length childFlexBasis = flexBasisForChild(child); 1562 Length childMinSize = isHorizontalFlow() ? child.style().minWidth() : child.style().minHeight(); 1563 Length childMaxSize = isHorizontalFlow() ? child.style().maxWidth() : child.style().maxHeight(); 1564 if (childFlexBasis.isIntrinsic() || childMinSize.isIntrinsicOrAuto() || childMaxSize.isIntrinsic()) 1565 result = true; 1566 } 1567 return result; 1576 if (isHorizontalFlow() == child.style().isHorizontalWritingMode()) 1577 return false; 1578 1579 Length childFlexBasis = flexBasisForChild(child); 1580 Length childMinSize = isHorizontalFlow() ? child.style().minWidth() : child.style().minHeight(); 1581 Length childMaxSize = isHorizontalFlow() ? child.style().maxWidth() : child.style().maxHeight(); 1582 // FIXME: we must run mainAxisLengthIsDefinite() because it might end up calling computePercentageLogicalHeight() 1583 // which has some side effects like calling addPercentHeightDescendant() for example so it is not possible to skip 1584 // the call for example by moving it to the end of the conditional expression. This is error-prone and we should 1585 // refactor computePercentageLogicalHeight() at some point so that it only computes stuff without those side effects. 1586 if (!mainAxisLengthIsDefinite(child, childFlexBasis) || childMinSize.isIntrinsic() || childMaxSize.isIntrinsic()) 1587 return true; 1588 1589 if (shouldApplyMinSizeAutoForChild(child)) 1590 return true; 1591 1592 return false; 1568 1593 } 1569 1594 -
trunk/Source/WebCore/rendering/RenderFlexibleBox.h
r263792 r266695 114 114 bool isMultiline() const; 115 115 Length flexBasisForChild(const RenderBox& child) const; 116 bool shouldApplyMinSizeAutoForChild(const RenderBox&) const; 116 117 LayoutUnit crossAxisExtentForChild(const RenderBox& child) const; 117 118 LayoutUnit crossAxisIntrinsicExtentForChild(const RenderBox& child) const;
Note:
See TracChangeset
for help on using the changeset viewer.