Changeset 270073 in webkit
- Timestamp:
- Nov 20, 2020 1:33:25 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r270048 r270073 1 2020-11-16 Sergio Villar Senin <svillar@igalia.com> 2 3 [css-flex] Images as flex items should use the overridingLogicalHeight when defined to compute the logical width 4 https://bugs.webkit.org/show_bug.cgi?id=218975 5 6 Reviewed by Manuel Rego Casasnovas. 7 8 Replaced 19 FAIL by PASS expectations. 9 10 * web-platform-tests/css/css-flexbox/image-as-flexitem-size-001v-expected.txt: 11 * web-platform-tests/css/css-flexbox/image-as-flexitem-size-002-expected.txt: 12 * web-platform-tests/css/css-flexbox/image-as-flexitem-size-005v-expected.txt: 13 * web-platform-tests/css/css-flexbox/image-as-flexitem-size-006-expected.txt: 14 * web-platform-tests/css/css-flexbox/image-as-flexitem-size-007v-expected.txt: 15 1 16 2020-11-19 Chris Dumez <cdumez@apple.com> 2 17 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/image-as-flexitem-size-001v-expected.txt
r269628 r270073 9 9 PASS .flexbox > img 2 10 10 PASS .flexbox > img 3 11 FAIL .flexbox > img 4 assert_equals: 12 <img src="support/solidblue.png" style="flex: 0 0 30px" data-expected-width="30" data-expected-height="30"> 13 height expected 30 but got 16 11 PASS .flexbox > img 4 14 12 PASS .flexbox > img 5 15 13 PASS .flexbox > img 6 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/image-as-flexitem-size-002-expected.txt
r269628 r270073 9 9 PASS .flexbox > img 2 10 10 PASS .flexbox > img 3 11 FAIL .flexbox > img 4 assert_equals: 12 <img src="support/solidblue.png" style="flex: 0 0 30px" data-expected-width="30" data-expected-height="30"> 13 width expected 30 but got 16 11 PASS .flexbox > img 4 14 12 PASS .flexbox > img 5 15 13 PASS .flexbox > img 6 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/image-as-flexitem-size-005v-expected.txt
r269628 r270073 6 6 7 7 8 FAIL .flexbox > img 1 assert_equals: 9 <img src="support/solidblue.png" data-expected-width="40" data-expected-height="40"> 10 height expected 40 but got 16 11 FAIL .flexbox > img 2 assert_equals: 12 <img src="support/solidblue.png" style="width: 30px" data-expected-width="40" data-expected-height="40"> 13 height expected 40 but got 30 8 PASS .flexbox > img 1 9 PASS .flexbox > img 2 14 10 PASS .flexbox > img 3 15 FAIL .flexbox > img 4 assert_equals: 16 <img src="support/solidblue.png" style="flex: 1 1 30px" data-expected-width="40" data-expected-height="40"> 17 height expected 40 but got 16 18 FAIL .flexbox > img 5 assert_equals: 19 <img src="support/solidblue.png" style="min-width: 34px" data-expected-width="40" data-expected-height="40"> 20 height expected 40 but got 34 21 FAIL .flexbox > img 6 assert_equals: 22 <img src="support/solidblue.png" style="min-height: 34px" data-expected-width="40" data-expected-height="40"> 23 height expected 40 but got 34 24 FAIL .flexbox > img 7 assert_equals: 25 <img src="support/solidblue.png" style="min-width: 30px; 26 min-height: 34px" data-expected-width="40" data-expected-height="40"> 27 height expected 40 but got 34 28 FAIL .flexbox > img 8 assert_equals: 29 <img src="support/solidblue.png" style="min-width: 34px; 30 min-height: 30px" data-expected-width="40" data-expected-height="40"> 31 height expected 40 but got 34 11 PASS .flexbox > img 4 12 PASS .flexbox > img 5 13 PASS .flexbox > img 6 14 PASS .flexbox > img 7 15 PASS .flexbox > img 8 32 16 PASS .flexbox > img 9 33 17 PASS .flexbox > img 10 … … 39 23 PASS .flexbox > img 16 40 24 PASS .flexbox > img 17 41 FAIL .flexbox > img 18 assert_equals: 42 <img src="support/solidblue.png" style="width: 10px; 43 min-height: 30px" data-expected-width="40" data-expected-height="40"> 44 height expected 40 but got 30 25 PASS .flexbox > img 18 45 26 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/image-as-flexitem-size-006-expected.txt
r269628 r270073 6 6 7 7 8 FAIL .flexbox > img 1 assert_equals: 9 <img src="support/solidblue.png" data-expected-width="40" data-expected-height="40"> 10 width expected 40 but got 16 8 PASS .flexbox > img 1 11 9 PASS .flexbox > img 2 12 FAIL .flexbox > img 3 assert_equals: 13 <img src="support/solidblue.png" style="height: 30px" data-expected-width="40" data-expected-height="40"> 14 width expected 40 but got 30 15 FAIL .flexbox > img 4 assert_equals: 16 <img src="support/solidblue.png" style="flex: 1 1 30px" data-expected-width="40" data-expected-height="40"> 17 width expected 40 but got 16 18 FAIL .flexbox > img 5 assert_equals: 19 <img src="support/solidblue.png" style="min-width: 34px" data-expected-width="40" data-expected-height="40"> 20 width expected 40 but got 34 21 FAIL .flexbox > img 6 assert_equals: 22 <img src="support/solidblue.png" style="min-height: 34px" data-expected-width="40" data-expected-height="40"> 23 width expected 40 but got 34 24 FAIL .flexbox > img 7 assert_equals: 25 <img src="support/solidblue.png" style="min-width: 30px; 26 min-height: 34px" data-expected-width="40" data-expected-height="40"> 27 width expected 40 but got 34 28 FAIL .flexbox > img 8 assert_equals: 29 <img src="support/solidblue.png" style="min-width: 34px; 30 min-height: 30px" data-expected-width="40" data-expected-height="40"> 31 width expected 40 but got 34 10 PASS .flexbox > img 3 11 PASS .flexbox > img 4 12 PASS .flexbox > img 5 13 PASS .flexbox > img 6 14 PASS .flexbox > img 7 15 PASS .flexbox > img 8 32 16 PASS .flexbox > img 9 33 17 PASS .flexbox > img 10 … … 36 20 PASS .flexbox > img 13 37 21 PASS .flexbox > img 14 38 FAIL .flexbox > img 15 assert_equals: 39 <img src="support/solidblue.png" style="min-width: 30px; 40 height: 10px" data-expected-width="40" data-expected-height="40"> 41 width expected 40 but got 30 22 PASS .flexbox > img 15 42 23 PASS .flexbox > img 16 43 24 PASS .flexbox > img 17 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/image-as-flexitem-size-007v-expected.txt
r269628 r270073 11 11 <img src="support/solidblue.png" style="height: 30px" data-expected-width="32" data-expected-height="30"> 12 12 width expected 32 but got 30 13 FAIL .flexbox > img 4 assert_equals: 14 <img src="support/solidblue.png" style="flex: 0 0 30px" data-expected-width="30" data-expected-height="28"> 15 height expected 28 but got 20 13 PASS .flexbox > img 4 16 14 PASS .flexbox > img 5 17 15 PASS .flexbox > img 6 -
trunk/Source/WebCore/ChangeLog
r270071 r270073 1 2020-11-16 Sergio Villar Senin <svillar@igalia.com> 2 3 [css-flex] Images as flex items should use the overridingLogicalHeight when defined to compute the logical width 4 https://bugs.webkit.org/show_bug.cgi?id=218975 5 6 Reviewed by Manuel Rego Casasnovas. 7 8 RenderReplaced should use the overridingLogicalHeight whenever defined instead of the specified logical height to compute the logical 9 width using an intrinsic aspect ratio. The overriding height is set by flex containers that need to stretch/shrink their items. 10 The current code was not considering this case and thus, the intrinsic (non-stretched) logical height was used to compute the logical width, 11 meaning that the stretching set by the flexbox container was ignored. 12 13 Note that it isn't enough to check that there is an overriding height, we must also check that the replaced element has an intrinsic size. 14 Replaced elements with intrinsic ratios but without intrinsic sizes are handled in a separate code path (it's actually undefined behaviour). 15 That's why it isn't enough to verify that the element has an aspect ratio, because most SVG graphics actually have defined intrinsic ratios 16 but not intrinsic sizes. 17 18 This allows us to pass an additional 19 subtests in 5 flexbox WPT tests. 19 20 * rendering/RenderReplaced.cpp: 21 (WebCore::RenderReplaced::computeReplacedLogicalWidth const): Use the overriding logical height if defined in presence of a valid aspect ratio. 22 1 23 2020-11-19 Fujii Hironori <Hironori.Fujii@sony.com> 2 24 -
trunk/Source/WebCore/rendering/RenderReplaced.cpp
r269820 r270073 518 518 bool computedHeightIsAuto = style().logicalHeight().isAuto(); 519 519 bool hasIntrinsicWidth = constrainedSize.width() > 0; 520 bool hasIntrinsicHeight = constrainedSize.height() > 0; 521 522 // 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 523 // 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. 524 // 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 525 // container can distort aspect ratios in case of "align-self: stretch" for example (see https://drafts.csswg.org/css-grid/#grid-item-sizing). 526 if (intrinsicRatio && isFlexItem() && hasOverridingLogicalHeight() && hasIntrinsicWidth && hasIntrinsicHeight) 527 return computeReplacedLogicalWidthRespectingMinMaxWidth(roundToInt(round(overridingContentLogicalHeight() * intrinsicRatio)), shouldComputePreferred); 520 528 521 529 // If 'height' and 'width' both have computed values of 'auto' and the element also has an intrinsic width, then that intrinsic width is the used value of 'width'. … … 523 531 return computeReplacedLogicalWidthRespectingMinMaxWidth(constrainedSize.width(), shouldComputePreferred); 524 532 525 bool hasIntrinsicHeight = constrainedSize.height() > 0;526 533 if (intrinsicRatio) { 527 534 // If 'height' and 'width' both have computed values of 'auto' and the element has no intrinsic width, but does have an intrinsic height and intrinsic ratio;
Note: See TracChangeset
for help on using the changeset viewer.