Changeset 277371 in webkit
- Timestamp:
- May 12, 2021 8:59:48 AM (14 months ago)
- Location:
- trunk
- Files:
-
- 7 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-row-013-expected.txt (modified) (3 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-row-013.html (modified) (2 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/rendering/RenderFlexibleBox.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r277368 r277371 1 2021-05-12 Sergio Villar Senin <svillar@igalia.com> 2 3 [css-flexbox] Do not use margins when computing aspect ratio cross sizes 4 https://bugs.webkit.org/show_bug.cgi?id=221210 5 6 Reviewed by Javier Fernandez. 7 8 * TestExpectations: Unskipped flex-aspect-ratio-img-row-013.html which is now passing. 9 1 10 2021-05-12 Diego Pino Garcia <dpino@igalia.com> 2 11 -
trunk/LayoutTests/TestExpectations
r277321 r277371 3870 3870 webkit.org/b/219343 imported/w3c/web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-row-007.html [ ImageOnlyFailure ] 3871 3871 webkit.org/b/219343 imported/w3c/web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-row-010.html [ ImageOnlyFailure ] 3872 webkit.org/b/219343 imported/w3c/web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-row-013.html [ ImageOnlyFailure ]3873 3872 webkit.org/b/219343 imported/w3c/web-platform-tests/css/css-flexbox/aspect-ratio-intrinsic-size-001.html [ ImageOnlyFailure ] 3874 3873 webkit.org/b/219343 imported/w3c/web-platform-tests/css/css-flexbox/aspect-ratio-intrinsic-size-002.html [ ImageOnlyFailure ] -
trunk/LayoutTests/imported/w3c/ChangeLog
r277321 r277371 1 2021-05-12 Sergio Villar Senin <svillar@igalia.com> 2 3 [css-flexbox] Do not use margins when computing aspect ratio cross sizes 4 https://bugs.webkit.org/show_bug.cgi?id=221210 5 <rdar://problem/74097534> 6 7 Reviewed by Javier Fernandez. 8 9 * web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-row-013-expected.txt: 10 Replaced FAIL by PASS expectations + new expectations. 11 * web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-row-013.html: Imported 12 latest changes from upstream WPT. 13 1 14 2021-05-11 Cathie Chen <cathiechen@igalia.com> 2 15 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-row-013-expected.txt
r273072 r277371 1 Pass condition is 3 green 100x100 squares.1 Pass condition is 4 green 100x100 squares and 1 0x0 square. 2 2 3 3 Firefox 84a1 passes. Chrome 87 fails them all by making the green rectangles be 200x100. … … 9 9 10 10 11 Have to subtract a margin larger than the stretched height to get 0px transferred size suggestion: 12 13 14 Have to subtract the margin from the stretched height (ignoring the presence of a border) to get the transferred size suggestion: 15 16 11 17 Stretched transferred size suggestion has to obey min-height: 12 18 … … 14 20 15 21 PASS img 1 16 FAIL img 2 assert_equals: 17 <img src="support/200x200-green.png" style="margin-bottom: 20px" data-expected-height="100" data-expected-width="100"> 18 width expected 100 but got 120 22 PASS img 2 19 23 PASS img 3 24 PASS img 4 25 PASS img 5 20 26 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-row-013.html
r270237 r277371 11 11 <body onload="checkLayout('img')"> 12 12 <p> 13 Pass condition is 3 green 100x100 squares.13 Pass condition is 4 green 100x100 squares and 1 0x0 square. 14 14 </p> 15 15 … … 28 28 </div> 29 29 30 <p>Have to subtract a margin larger than the stretched height to get 0px transferred size suggestion:</p> 31 <div style="display: flex; width: 0; height: 120px;"> 32 <img src="support/200x200-green.png" style="margin-bottom: 160px" data-expected-height=0 data-expected-width=0> 33 </div> 34 35 <p>Have to subtract the margin from the stretched height (ignoring the presence of a border) to get the transferred size suggestion:</p> 36 <div style="display: flex; width: 0; height: 120px;"> 37 <img src="support/200x200-green.png" style="border-right: 10px solid black; margin-bottom: 20px" data-expected-height=100 data-expected-width=110> 38 </div> 39 30 40 <p>Stretched transferred size suggestion has to obey min-height:</p> 31 41 <div style="display: flex; width: 0; height: 50px;"> -
trunk/Source/WebCore/ChangeLog
r277369 r277371 1 2021-05-12 Sergio Villar Senin <svillar@igalia.com> 2 3 [css-flexbox] Do not use margins when computing aspect ratio cross sizes 4 https://bugs.webkit.org/show_bug.cgi?id=221210 5 6 Reviewed by Javier Fernandez. 7 8 In r270578 we implemented section 9.8.1 of the flexbox specs which allowed us to compute child's 9 indefinite cross sizes as definite when the flexbox container had a definite cross size and a couple 10 of other conditions. However we did not take into account that the child might have some margins in 11 in the cross direction. Aspect ratio computations must use the content box and thus, we need to 12 substract the margin extent before trying to compute a cross size based on an aspect ratio. 13 14 Note that when computeMainSizeFromAspectRatioUsing() is called the child might not have been ever 15 laid out. This means that the margins wouldn't have been computed and thus marginXXX() would always 16 return 0. That's why crossAxisMarginExtentForChild() was also modified so that it actually computes 17 the margins in case the child needs to be laid out. 18 19 * rendering/RenderFlexibleBox.cpp: 20 (WebCore::RenderFlexibleBox::crossAxisMarginExtentForChild const): 21 (WebCore::RenderFlexibleBox::computeMainSizeFromAspectRatioUsing const): 22 1 23 2021-05-12 Sam Weinig <weinig@apple.com> 2 24 -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r277321 r277371 742 742 LayoutUnit RenderFlexibleBox::crossAxisMarginExtentForChild(const RenderBox& child) const 743 743 { 744 return isHorizontalFlow() ? child.verticalMarginExtent() : child.horizontalMarginExtent(); 744 if (!child.needsLayout()) 745 return isHorizontalFlow() ? child.verticalMarginExtent() : child.horizontalMarginExtent(); 746 747 LayoutUnit marginStart; 748 LayoutUnit marginEnd; 749 if (isHorizontalFlow()) 750 child.computeBlockDirectionMargins(*this, marginStart, marginEnd); 751 else 752 child.computeInlineDirectionMargins(*this, child.containingBlockLogicalWidthForContentInFragment(nullptr), child.logicalWidth(), marginStart, marginEnd); 753 return marginStart + marginEnd; 745 754 } 746 755 … … 819 828 // Keep this sync'ed with childCrossSizeShouldUseContainerCrossSize(). 820 829 ASSERT(containerCrossSizeLength.isFixed()); 821 crossSize = valueForLength(containerCrossSizeLength, -1_lu);830 crossSize = std::max(0_lu, valueForLength(containerCrossSizeLength, -1_lu) - crossAxisMarginExtentForChild(child)); 822 831 } else { 823 832 ASSERT(crossSizeLength.isPercentOrCalculated());
Note: See TracChangeset
for help on using the changeset viewer.