Changeset 280889 in webkit
- Timestamp:
- Aug 11, 2021, 12:53:06 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/rendering/RenderBox.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r280880 r280889 1 2021-08-11 Cathie Chen <cathiechen@igalia.com> 2 3 REGRESSION (r277997): Max-height not applied for image 4 https://bugs.webkit.org/show_bug.cgi?id=228872 5 6 Reviewed by Antti Koivisto. 7 8 * TestExpectations: 9 1 10 2021-08-10 Lauro Moura <lmoura@igalia.com> 2 11 -
trunk/LayoutTests/TestExpectations
r280881 r280889 4703 4703 webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-025.html [ ImageOnlyFailure ] 4704 4704 webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-026.html [ ImageOnlyFailure ] 4705 webkit.org/b/228872 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-029.html [ ImageOnlyFailure ]4706 webkit.org/b/228872 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-030.html [ ImageOnlyFailure ]4707 4705 webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/contain-intrinsic-size/contain-intrinsic-size-001.html [ ImageOnlyFailure ] 4708 4706 webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/contain-intrinsic-size/contain-intrinsic-size-002.html [ ImageOnlyFailure ] -
trunk/Source/WebCore/ChangeLog
r280887 r280889 1 2021-08-11 Cathie Chen <cathiechen@igalia.com> 2 3 REGRESSION (r277997): Max-height not applied for image 4 https://bugs.webkit.org/show_bug.cgi?id=228872 5 6 Reviewed by Antti Koivisto. 7 8 The image get stretched because constrainLogicalHeightByMinMax uses the intrinsic height for the minimum height. 9 According to [1], the automatic minimum size in the ratio-dependent axis of a box is its min-content size, 10 not the intrinsic size. To fix this, the ratio-dependent minimum height of a box should be computed from aspect-ratio 11 if it doesn't have any child, otherwise, then it should consider the intrinsic height. 12 13 [1] https://www.w3.org/TR/css-sizing-4/#aspect-ratio-minimum 14 15 * rendering/RenderBox.cpp: 16 (WebCore::RenderBox::constrainLogicalHeightByMinMax const): The minimum height is computed from aspect-ratio if it doesn't have any child. 17 1 18 2021-08-11 Rob Buis <rbuis@igalia.com> 2 19 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r280631 r280889 678 678 } 679 679 auto logicalMinHeight = styleToUse.logicalMinHeight(); 680 if (logicalMinHeight.isAuto() && shouldComputeLogicalHeightFromAspectRatio() && intrinsicContentHeight && styleToUse.overflowBlockDirection() == Overflow::Visible) 681 logicalMinHeight = Length(*intrinsicContentHeight, LengthType::Fixed); 680 if (logicalMinHeight.isAuto() && shouldComputeLogicalHeightFromAspectRatio() && intrinsicContentHeight && styleToUse.overflowBlockDirection() == Overflow::Visible) { 681 auto heightFromAspectRatio = blockSizeFromAspectRatio(horizontalBorderAndPaddingExtent(), verticalBorderAndPaddingExtent(), LayoutUnit(style().logicalAspectRatio()), style().boxSizingForAspectRatio(), logicalWidth()) - borderAndPaddingLogicalHeight(); 682 if (firstChild()) 683 heightFromAspectRatio = std::max(heightFromAspectRatio, *intrinsicContentHeight); 684 logicalMinHeight = Length(heightFromAspectRatio, LengthType::Fixed); 685 } 682 686 if (logicalMinHeight.isMinContent() || logicalMinHeight.isMaxContent()) 683 687 logicalMinHeight = Length();
Note:
See TracChangeset
for help on using the changeset viewer.