Changeset 287976 in webkit
- Timestamp:
- Jan 13, 2022 5:04:00 AM (6 months ago)
- Location:
- trunk
- Files:
-
- 7 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (2 diffs)
-
LayoutTests/fast/canvas/canvas-css-size-after-height-change-with-display-flex-expected.html (modified) (1 diff)
-
LayoutTests/fast/canvas/canvas-css-size-after-height-change-with-display-flex.html (modified) (2 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/rendering/RenderFlexibleBox.cpp (modified) (4 diffs)
-
Source/WebCore/rendering/RenderFlexibleBox.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r287975 r287976 1 2022-01-10 Sergio Villar Senin <svillar@igalia.com> 2 3 [css-flexbox] Incorrect height of flex items with aspect-ratio whenever the cross axis intrinsic size is larger than the viewport 4 https://bugs.webkit.org/show_bug.cgi?id=234564 5 <rdar://problem/86958389> 6 7 Reviewed by Manuel Rego Casasnovas. 8 9 Adjusted the canvas-css-size-after-height-change-with-display-flex.html test case and expectations so it behaves as other engines. 10 11 * TestExpectations: Unskipped a test that is passing now. 12 * fast/canvas/canvas-css-size-after-height-change-with-display-flex-expected.html: 13 * fast/canvas/canvas-css-size-after-height-change-with-display-flex.html: 14 1 15 2022-01-13 Youenn Fablet <youenn@apple.com> 2 16 -
trunk/LayoutTests/TestExpectations
r287927 r287976 1356 1356 webkit.org/b/136754 css3/flexbox/csswg/ttwf-reftest-flex-wrap-reverse.html [ ImageOnlyFailure ] 1357 1357 webkit.org/b/136754 css3/flexbox/csswg/ttwf-reftest-flex-wrap.html [ ImageOnlyFailure ] 1358 webkit.org/b/136754 imported/w3c/web-platform-tests/css/css-flexbox/canvas-dynamic-change-001.html [ Failure ]1359 1358 webkit.org/b/136754 imported/w3c/web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-row-015.html [ ImageOnlyFailure ] 1360 1359 webkit.org/b/136754 imported/w3c/web-platform-tests/css/css-flexbox/flexbox-safe-overflow-position-001.html [ ImageOnlyFailure ] … … 4203 4202 webkit.org/b/219343 imported/w3c/web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-row-010.html [ ImageOnlyFailure ] 4204 4203 webkit.org/b/219343 imported/w3c/web-platform-tests/css/css-flexbox/aspect-ratio-intrinsic-size-005.html [ ImageOnlyFailure ] 4205 webkit.org/b/234564 imported/w3c/web-platform-tests/css/css-flexbox/aspect-ratio-intrinsic-size-007.html [ ImageOnlyFailure ]4206 4204 4207 4205 webkit.org/b/145176 imported/w3c/web-platform-tests/css/css-flexbox/flexbox_align-items-stretch-3.html [ ImageOnlyFailure ] -
trunk/LayoutTests/fast/canvas/canvas-css-size-after-height-change-with-display-flex-expected.html
r201889 r287976 1 <div style=" height: 500px; background-color: blue;"></div>1 <div style="width: 600px; height: 600px; background-color: blue;"></div> -
trunk/LayoutTests/fast/canvas/canvas-css-size-after-height-change-with-display-flex.html
r201889 r287976 1 1 <div style="display: flex; flex-direction: column;"> 2 <canvas style="background-color: blue; ">2 <canvas style="background-color: blue; max-width: 600px"> 3 3 <script> 4 4 if (window.testRunner) … … 6 6 7 7 window.requestAnimationFrame(function() { 8 document.querySelector("canvas").height = " 500";8 document.querySelector("canvas").height = "300"; 9 9 if (window.testRunner) 10 10 testRunner.notifyDone(); -
trunk/Source/WebCore/ChangeLog
r287973 r287976 1 2022-01-10 Sergio Villar Senin <svillar@igalia.com> 2 3 [css-flexbox] Incorrect height of flex items with aspect-ratio whenever the cross axis intrinsic size is larger than the viewport 4 https://bugs.webkit.org/show_bug.cgi?id=234564 5 <rdar://problem/86958389> 6 7 Reviewed by Manuel Rego Casasnovas. 8 9 Automatic preferred sizes were considered always indefinite. However whenever they correspond to 10 the (physical) width we could consider them as definite. This allows us to use that size instead of 11 the flex item intrinsic size when computing the transferred size contribution. This way, flex items 12 with aspect ratio and large intrinsic size are not abnormally stretched due to the min-size:auto 13 computation. 14 15 * rendering/RenderFlexibleBox.cpp: 16 (WebCore::RenderFlexibleBox::computeMainSizeFromAspectRatioUsing const): Use availableLogical{Width|Height} 17 to compute the cross size when then automatic preferred size is the physical width. 18 (WebCore::RenderFlexibleBox::childCrossAxisIsPhysicalWidth const): 19 (WebCore::RenderFlexibleBox::childCrossSizeShouldUseContainerCrossSize const): Handle the cases of 20 automatic preferred widths. 21 * rendering/RenderFlexibleBox.h: 22 1 23 2022-01-12 Antti Koivisto <antti@apple.com> 2 24 -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r287355 r287976 915 915 if (crossSizeLength.isFixed()) 916 916 crossSize = adjustForBoxSizing(child, crossSizeLength); 917 else if (crossSizeLength.isAuto()) 917 else if (crossSizeLength.isAuto()) { 918 ASSERT(childCrossSizeShouldUseContainerCrossSize(child)); 918 919 crossSize = computeCrossSizeForChildUsingContainerCrossSize(child); 919 else {920 } else { 920 921 ASSERT(crossSizeLength.isPercentOrCalculated()); 921 922 crossSize = mainAxisIsChildInlineAxis(child) ? child.computePercentageLogicalHeight(crossSizeLength) : adjustBorderBoxLogicalWidthForBoxSizing(valueForLength(crossSizeLength, contentWidth()), crossSizeLength.type()); … … 988 989 } 989 990 991 bool RenderFlexibleBox::crossAxisIsPhysicalWidth() const 992 { 993 return (isHorizontalWritingMode() && isColumnFlow()) || (!isHorizontalWritingMode() && !isColumnFlow()); 994 } 995 990 996 bool RenderFlexibleBox::childCrossSizeShouldUseContainerCrossSize(const RenderBox& child) const 991 997 { … … 995 1001 // and is considered definite. 996 1002 if (!isMultiline() && alignmentForChild(child) == ItemPosition::Stretch && !hasAutoMarginsInCrossAxis(child) && crossSizeLengthForChild(MainOrPreferredSize, child).isAuto()) { 1003 if (crossAxisIsPhysicalWidth()) 1004 return true; 997 1005 // This must be kept in sync with computeMainSizeFromAspectRatioUsing(). 998 1006 // FIXME: so far we're only considered fixed sizes but we should extend it to other definite sizes. … … 1742 1750 LayoutUnit RenderFlexibleBox::computeCrossSizeForChildUsingContainerCrossSize(const RenderBox& child) const 1743 1751 { 1752 if (crossAxisIsPhysicalWidth()) 1753 return contentWidth(); 1754 1744 1755 // Keep this sync'ed with childCrossSizeShouldUseContainerCrossSize(). 1745 1756 auto definiteSizeValue = [&] { -
trunk/Source/WebCore/rendering/RenderFlexibleBox.h
r287128 r287976 147 147 bool childHasComputableAspectRatio(const RenderBox&) const; 148 148 bool childHasComputableAspectRatioAndCrossSizeIsConsideredDefinite(const RenderBox&); 149 bool crossAxisIsPhysicalWidth() const; 149 150 bool childCrossSizeShouldUseContainerCrossSize(const RenderBox& child) const; 150 151 LayoutUnit computeCrossSizeForChildUsingContainerCrossSize(const RenderBox& child) const;
Note: See TracChangeset
for help on using the changeset viewer.