Changeset 280290 in webkit
- Timestamp:
- Jul 26, 2021, 12:42:45 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/RenderReplaced.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r280289 r280290 1 2021-07-26 Ziran Sun <zsun@igalia.com> 2 3 [css-grid] svg image as grid items should use the overriding logical width/height when defined to compute the logical height/width 4 https://bugs.webkit.org/show_bug.cgi?id=228105 5 6 Reviewed by Javier Fernandez. 7 8 Update TestExpectations as 4 failed grid WPT tests are now passing. 9 10 * TestExpectations: 11 1 12 2021-07-25 Alexey Shvayka <shvaikalesh@gmail.com> 2 13 -
trunk/LayoutTests/TestExpectations
r280196 r280290 4274 4274 webkit.org/b/209460 imported/w3c/web-platform-tests/css/css-grid/abspos/descendant-static-position-003.html [ ImageOnlyFailure ] 4275 4275 webkit.org/b/212201 imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-limits-001.html [ Skip ] 4276 webkit.org/b/227900 imported/w3c/web-platform-tests/css/css-grid/alignment/grid-item-aspect-ratio-stretch-1.html [ ImageOnlyFailure ]4277 webkit.org/b/227900 imported/w3c/web-platform-tests/css/css-grid/alignment/grid-item-aspect-ratio-stretch-2.html [ ImageOnlyFailure ]4278 webkit.org/b/227900 imported/w3c/web-platform-tests/css/css-grid/alignment/grid-item-aspect-ratio-stretch-3.html [ ImageOnlyFailure ]4279 webkit.org/b/227900 imported/w3c/web-platform-tests/css/css-grid/alignment/grid-item-aspect-ratio-stretch-4.html [ ImageOnlyFailure ]4280 4276 webkit.org/b/212246 imported/w3c/web-platform-tests/css/css-grid/alignment/grid-baseline-align-cycles-001.html [ ImageOnlyFailure ] 4281 4277 webkit.org/b/212246 imported/w3c/web-platform-tests/css/css-grid/alignment/grid-item-content-baseline-001.html [ ImageOnlyFailure ] -
trunk/Source/WebCore/ChangeLog
r280284 r280290 1 2021-07-26 Ziran Sun <zsun@igalia.com> 2 3 [css-grid] svg image as grid items should use the overriding logical width/height when defined to compute the logical height/width 4 https://bugs.webkit.org/show_bug.cgi?id=228105 5 6 As discussed at https://github.com/w3c/csswg-drafts/issues/6286#issuecomment-866986544, degenerate 7 aspect ratios derived from SVG width/height attributes fall back to viewbox aspect ratio 8 (whether due to negative values or zero values). 9 10 When computing the logical height/width using an intrinsic aspect ratio, RenderReplaced uses the 11 overridingLogicalWidth/overridingLogicalHeight whenever defined as long as the flex or 12 grid item has an intrinsic size. For an SVG graphic though, it's common to have an intrinsic aspect 13 ratio but not to have an intrinsic width or height. For this special case, we still should use 14 overridingLogicalWidth/overridingLogicalHeight for logical height/width calculations. 15 16 Reviewed by Javier Fernandez. 17 18 * rendering/RenderReplaced.cpp: 19 (WebCore::RenderReplaced::computeReplacedLogicalWidth const): 20 (WebCore::RenderReplaced::computeReplacedLogicalHeight const): 21 1 22 2021-07-24 Devin Rousso <drousso@apple.com> 2 23 -
trunk/Source/WebCore/rendering/RenderReplaced.cpp
r280078 r280290 554 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 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)556 if (intrinsicRatio && (isFlexItem() || isGridItem()) && hasOverridingLogicalHeight() && ((hasIntrinsicWidth && hasIntrinsicHeight) || (contentRenderer && contentRenderer->isSVGRoot() && (hasIntrinsicWidth || hasIntrinsicHeight)))) 557 557 return computeReplacedLogicalWidthRespectingMinMaxWidth(roundToInt(round(overridingContentLogicalHeight() * intrinsicRatio)), shouldComputePreferred); 558 558 … … 624 624 625 625 // See computeReplacedLogicalHeight() for a similar check for heights. 626 if (intrinsicRatio && (isFlexItem() || isGridItem()) && hasOverridingLogicalWidth() && hasIntrinsicHeight && hasIntrinsicWidth)626 if (intrinsicRatio && (isFlexItem() || isGridItem()) && hasOverridingLogicalWidth() && ((hasIntrinsicWidth && hasIntrinsicHeight) || (contentRenderer && contentRenderer->isSVGRoot() && (hasIntrinsicWidth || hasIntrinsicHeight)))) 627 627 return computeReplacedLogicalHeightRespectingMinMaxHeight(roundToInt(round(overridingContentLogicalWidth() / intrinsicRatio))); 628 628
Note:
See TracChangeset
for help on using the changeset viewer.