Changeset 272718 in webkit
- Timestamp:
- Feb 11, 2021 2:55:20 AM (17 months ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (2 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/rendering/RenderBox.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r272715 r272718 1 2021-02-11 Rob Buis <rbuis@igalia.com> 2 3 Handle min-width/min-height:auto for aspect-ratio 4 https://bugs.webkit.org/show_bug.cgi?id=220582 5 6 Reviewed by Antti Koivisto. 7 8 Enable tests that pass now. 9 10 * TestExpectations: 11 1 12 2021-02-11 Myles C. Maxfield <mmaxfield@apple.com> 2 13 -
trunk/LayoutTests/TestExpectations
r272707 r272718 4556 4556 webkit.org/b/214462 imported/w3c/web-platform-tests/css/css-scoping/slotted-placeholder.html [ ImageOnlyFailure ] 4557 4557 4558 webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/abspos-012.html [ ImageOnlyFailure ]4559 webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/abspos-013.html [ ImageOnlyFailure ]4560 4558 webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/abspos-014.html [ ImageOnlyFailure ] 4561 webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-009.html [ ImageOnlyFailure ]4562 webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-014.html [ ImageOnlyFailure ]4563 webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-015.html [ ImageOnlyFailure ]4564 webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-017.html [ ImageOnlyFailure ]4565 4559 webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-024.html [ ImageOnlyFailure ] 4566 4560 webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-028.html [ ImageOnlyFailure ] … … 4570 4564 webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-004.html [ ImageOnlyFailure ] 4571 4565 webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-005.html [ ImageOnlyFailure ] 4566 webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-008.html [ ImageOnlyFailure ] 4572 4567 webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-009.html [ ImageOnlyFailure ] 4573 4568 webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-011.html [ ImageOnlyFailure ] -
trunk/Source/WebCore/ChangeLog
r272715 r272718 1 2021-02-11 Rob Buis <rbuis@igalia.com> 2 3 Handle min-width/min-height:auto for aspect-ratio 4 https://bugs.webkit.org/show_bug.cgi?id=220582 5 6 Reviewed by Antti Koivisto. 7 8 Implement automatic minimum size [1] handling for aspect-ratio 9 as specified here [2]. 10 11 [1] https://drafts.csswg.org/css-sizing-3/#automatic-minimum-size 12 [2] https://drafts.csswg.org/css-sizing-4/#aspect-ratio-minimum 13 14 * rendering/RenderBox.cpp: 15 (WebCore::RenderBox::constrainLogicalWidthInFragmentByMinMax const): 16 (WebCore::RenderBox::constrainLogicalHeightByMinMax const): 17 (WebCore::RenderBox::computePositionedLogicalWidthUsing const): 18 (WebCore::RenderBox::computePositionedLogicalHeight const): 19 (WebCore::RenderBox::computePositionedLogicalHeightUsing const): 20 1 21 2021-02-11 Myles C. Maxfield <mmaxfield@apple.com> 2 22 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r272569 r272718 663 663 if (!styleToUse.logicalMaxWidth().isUndefined()) 664 664 logicalWidth = std::min(logicalWidth, computeLogicalWidthInFragmentUsing(MaxSize, styleToUse.logicalMaxWidth(), availableWidth, cb, fragment)); 665 return std::max(logicalWidth, computeLogicalWidthInFragmentUsing(MinSize, styleToUse.logicalMinWidth(), availableWidth, cb, fragment)); 665 auto minLength = styleToUse.logicalMinWidth(); 666 if (styleToUse.hasAspectRatio() && styleToUse.logicalWidth().isAuto() && minLength.isAuto() && styleToUse.overflowInlineDirection() == Overflow::Visible) { 667 // Make sure we actually used the aspect ratio. 668 if (shouldComputeLogicalWidthFromAspectRatio()) 669 minLength = Length(MinContent); 670 } 671 return std::max(logicalWidth, computeLogicalWidthInFragmentUsing(MinSize, minLength, availableWidth, cb, fragment)); 666 672 } 667 673 … … 673 679 logicalHeight = std::min(logicalHeight, maxH.value()); 674 680 } 675 if (Optional<LayoutUnit> computedLogicalHeight = computeLogicalHeightUsing(MinSize, styleToUse.logicalMinHeight(), intrinsicContentHeight)) 681 auto logicalMinHeight = styleToUse.logicalMinHeight(); 682 if (logicalMinHeight.isAuto() && shouldComputeLogicalHeightFromAspectRatio() && intrinsicContentHeight && styleToUse.overflowBlockDirection() == Overflow::Visible) 683 logicalMinHeight = Length(*intrinsicContentHeight, Fixed); 684 if (Optional<LayoutUnit> computedLogicalHeight = computeLogicalHeightUsing(MinSize, logicalMinHeight, intrinsicContentHeight)) 676 685 return std::max(logicalHeight, computedLogicalHeight.value()); 677 686 return logicalHeight; … … 3788 3797 ASSERT(widthType == MinSize || widthType == MainOrPreferredSize || !logicalWidth.isAuto()); 3789 3798 auto originalLogicalWidthType = logicalWidth.type(); 3790 if (widthType == MinSize && logicalWidth.isAuto()) 3791 logicalWidth = Length(0, Fixed); 3792 else if (widthType == MainOrPreferredSize && logicalWidth.isAuto() && shouldComputeLogicalWidthFromAspectRatio()) 3799 if (widthType == MinSize && logicalWidth.isAuto()) { 3800 if (shouldComputeLogicalWidthFromAspectRatio()) { 3801 LayoutUnit minLogicalWidth; 3802 LayoutUnit maxLogicalWidth; 3803 computeIntrinsicLogicalWidths(minLogicalWidth, maxLogicalWidth); 3804 logicalWidth = Length(minLogicalWidth, Fixed); 3805 } else 3806 logicalWidth = Length(0, Fixed); 3807 } else if (widthType == MainOrPreferredSize && logicalWidth.isAuto() && shouldComputeLogicalWidthFromAspectRatio()) 3793 3808 logicalWidth = Length(computeLogicalWidthFromAspectRatio(), Fixed); 3794 3809 else if (logicalWidth.isIntrinsic()) … … 4061 4076 4062 4077 // Calculate constraint equation values for 'min-height' case. 4063 if (!styleToUse.logicalMinHeight().isZero() || styleToUse.logicalMinHeight().isIntrinsic()) { 4078 Length logicalMinHeight = styleToUse.logicalMinHeight(); 4079 if (logicalMinHeight.isAuto() || !logicalMinHeight.isZero() || logicalMinHeight.isIntrinsic()) { 4064 4080 LogicalExtentComputedValues minValues; 4065 4081 … … 4126 4142 { 4127 4143 ASSERT(heightType == MinSize || heightType == MainOrPreferredSize || !logicalHeightLength.isAuto()); 4128 if (heightType == MinSize && logicalHeightLength.isAuto()) 4129 logicalHeightLength = Length(0, Fixed); 4144 if (heightType == MinSize && logicalHeightLength.isAuto()) { 4145 if (shouldComputeLogicalHeightFromAspectRatio()) 4146 logicalHeightLength = Length(logicalHeight, Fixed); 4147 else 4148 logicalHeightLength = Length(0, Fixed); 4149 } 4130 4150 4131 4151 // 'top' and 'bottom' cannot both be 'auto' because 'top would of been
Note: See TracChangeset
for help on using the changeset viewer.