Changeset 280024 in webkit
- Timestamp:
- Jul 19, 2021 7:25:38 AM (12 months ago)
- Location:
- trunk
- Files:
-
- 11 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-grid/alignment/grid-alignment-implies-size-change-011-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-implies-size-change-012-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-implies-size-change-013-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-implies-size-change-014-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-implies-size-change-017-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-implies-size-change-018-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/rendering/RenderReplaced.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r280022 r280024 1 2021-07-19 Ziran Sun <zsun@igalia.com> 2 3 [css-grid] Images as grid items should use the overridingLogicalHeight when defined to compute the logical width 4 https://bugs.webkit.org/show_bug.cgi?id=227984 5 6 Reviewed by Javier Fernandez. 7 8 9 grid WPT tests are now passing. 9 10 * TestExpectations: 11 1 12 2021-07-19 Ziran Sun <zsun@igalia.com> 2 13 -
trunk/LayoutTests/TestExpectations
r280023 r280024 1433 1433 webkit.org/b/216146 imported/w3c/web-platform-tests/css/css-grid/alignment/grid-baseline-align-001.html [ ImageOnlyFailure ] 1434 1434 webkit.org/b/216146 imported/w3c/web-platform-tests/css/css-grid/alignment/grid-baseline-justify-001.html [ ImageOnlyFailure ] 1435 imported/w3c/web-platform-tests/css/css-grid/alignment/replaced-alignment-with-aspect-ratio-001.html [ ImageOnlyFailure ]1436 1435 imported/w3c/web-platform-tests/css/css-grid/alignment/replaced-alignment-with-aspect-ratio-002.html [ ImageOnlyFailure ] 1437 imported/w3c/web-platform-tests/css/css-grid/alignment/replaced-alignment-with-aspect-ratio-006.html [ ImageOnlyFailure ]1438 1436 imported/w3c/web-platform-tests/css/css-grid/alignment/replaced-alignment-with-aspect-ratio-007.html [ ImageOnlyFailure ] 1439 1437 imported/w3c/web-platform-tests/css/css-grid/alignment/replaced-alignment-with-aspect-ratio-008.html [ ImageOnlyFailure ] 1440 imported/w3c/web-platform-tests/css/css-grid/alignment/replaced-alignment-with-aspect-ratio-009.html [ ImageOnlyFailure ]1441 1442 1438 1443 1439 imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-aspect-ratio-001.html [ ImageOnlyFailure ] -
trunk/LayoutTests/imported/w3c/ChangeLog
r280023 r280024 1 2021-07-19 Ziran Sun <zsun@igalia.com> 2 3 [css-grid] Images as grid items should use the overridingLogicalHeight when defined to compute the logical width 4 https://bugs.webkit.org/show_bug.cgi?id=227984 5 6 Reviewed by Javier Fernandez. 7 8 * web-platform-tests/css/css-grid/alignment/grid-alignment-implies-size-change-011-expected.txt: 9 * web-platform-tests/css/css-grid/alignment/grid-alignment-implies-size-change-012-expected.txt: 10 * web-platform-tests/css/css-grid/alignment/grid-alignment-implies-size-change-013-expected.txt: 11 * web-platform-tests/css/css-grid/alignment/grid-alignment-implies-size-change-014-expected.txt: 12 * web-platform-tests/css/css-grid/alignment/grid-alignment-implies-size-change-017-expected.txt: 13 * web-platform-tests/css/css-grid/alignment/grid-alignment-implies-size-change-018-expected.txt: 14 1 15 2021-07-19 Ziran Sun <zsun@igalia.com> 2 16 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-implies-size-change-011-expected.txt
r279269 r280024 1 1 2 2 3 FAIL .before 1 assert_equals: 4 <img id="item" src="support/100x100-green.png" class=" before" data-expected-width="200" data-expected-height="200"> 5 width expected 200 but got 100 3 PASS .before 1 6 4 PASS .after 2 7 5 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-implies-size-change-012-expected.txt
r279269 r280024 2 2 3 3 PASS .before 1 4 FAIL .after 2 assert_equals: 5 <img id="item" src="support/100x100-green.png" class=" before after" data-expected-width="200" data-expected-height="200"> 6 width expected 200 but got 100 4 PASS .after 2 7 5 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-implies-size-change-013-expected.txt
r279269 r280024 1 1 2 2 3 FAIL .before 1 assert_equals: 4 <img id="item" src="support/100x100-green.png" class=" before" data-expected-width="200" data-expected-height="200"> 5 width expected 200 but got 100 3 PASS .before 1 6 4 PASS .after 2 7 5 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-implies-size-change-014-expected.txt
r279269 r280024 2 2 3 3 PASS .before 1 4 FAIL .after 2 assert_equals: 5 <img id="item" src="support/100x100-green.png" class=" before after" data-expected-width="200" data-expected-height="200"> 6 width expected 200 but got 100 4 PASS .after 2 7 5 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-implies-size-change-017-expected.txt
r279269 r280024 2 2 3 3 PASS .before 1 4 FAIL .after 2 assert_equals: 5 <img id="item" src="support/100x100-green.png" class=" before after" data-expected-width="80" data-expected-height="80"> 6 width expected 80 but got 100 4 PASS .after 2 7 5 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-implies-size-change-018-expected.txt
r279269 r280024 1 1 2 2 3 FAIL .before 1 assert_equals: 4 <img id="item" src="support/100x100-green.png" class=" before" data-expected-width="80" data-expected-height="80"> 5 width expected 80 but got 100 3 PASS .before 1 6 4 PASS .after 2 7 5 -
trunk/Source/WebCore/ChangeLog
r280023 r280024 1 2021-07-19 Ziran Sun <zsun@igalia.com> 2 3 [css-grid] Images as grid items should use the overridingLogicalHeight when defined to compute the logical width 4 https://bugs.webkit.org/show_bug.cgi?id=227984 5 6 Reviewed by Javier Fernandez. 7 8 As discussed in https://github.com/w3c/csswg-drafts/issues/5713, for images as grid items, when 9 stretch alignment is only applied in one axis we should respect aspect-ratio on the other. 10 11 When computing the logical width using an intrinsic aspect ratio, RenderReplaced should use the 12 overridingLogicalHeight whenever defined just as how it does for flex items. This change is to 13 replace the use of intrinsic (non-stretched) logical height in current code with the overridingLogicalHeight. 14 15 This allows us to pass an additional of 9 grid WPT tests. 16 17 * rendering/RenderReplaced.cpp: 18 (WebCore::RenderReplaced::computeReplacedLogicalWidth const): 19 1 20 2021-07-19 Ziran Sun <zsun@igalia.com> 2 21 -
trunk/Source/WebCore/rendering/RenderReplaced.cpp
r280023 r280024 551 551 bool hasIntrinsicHeight = constrainedSize.hasIntrinsicHeight || constrainedSize.height() > 0; 552 552 553 // For flex items where the logical height has been overriden then we should use that size to compute the replaced width as long as the flex item has 554 // an intrinsic size. It is possible (indeed, common) for an SVG graphic to have an intrinsic aspect ratio but not to have an intrinsic width or height. 555 // There are also elements with intrinsic sizes but without intrinsic ratio (like an iframe). We cannot apply this rule to grid items because the grid 556 // container can distort aspect ratios in case of "align-self: stretch" for example (see https://drafts.csswg.org/css-grid/#grid-item-sizing). 557 if (intrinsicRatio && isFlexItem() && hasOverridingLogicalHeight() && hasIntrinsicWidth && hasIntrinsicHeight) 553 // For flex or grid items where the logical height has been overriden then we should use that size to compute the replaced width as long as the flex or 554 // grid item has an intrinsic size. It is possible (indeed, common) for an SVG graphic to have an intrinsic aspect ratio but not to have an intrinsic 555 // width or height. There are also elements with intrinsic sizes but without intrinsic ratio (like an iframe). 556 if (intrinsicRatio && (isFlexItem() || isGridItem()) && hasOverridingLogicalHeight() && hasIntrinsicWidth && hasIntrinsicHeight) 558 557 return computeReplacedLogicalWidthRespectingMinMaxWidth(roundToInt(round(overridingContentLogicalHeight() * intrinsicRatio)), shouldComputePreferred); 559 558
Note: See TracChangeset
for help on using the changeset viewer.