Changeset 286100 in webkit
- Timestamp:
- Nov 21, 2021 10:22:01 AM (8 months 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) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r286094 r286100 1 2021-11-21 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 * TestExpectations: unskip two tests that are now passing. 9 1 10 2021-11-20 Carlos Garcia Campos <cgarcia@igalia.com> 2 11 -
trunk/LayoutTests/TestExpectations
r286094 r286100 4323 4323 webkit.org/b/209460 imported/w3c/web-platform-tests/css/css-grid/abspos/descendant-static-position-003.html [ ImageOnlyFailure ] 4324 4324 webkit.org/b/212201 imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-limits-001.html [ Skip ] 4325 webkit.org/b/227900 imported/w3c/web-platform-tests/css/css-grid/alignment/grid-item-aspect-ratio-stretch-1.html [ ImageOnlyFailure ]4326 webkit.org/b/227900 imported/w3c/web-platform-tests/css/css-grid/alignment/grid-item-aspect-ratio-stretch-2.html [ ImageOnlyFailure ]4327 4325 webkit.org/b/212246 imported/w3c/web-platform-tests/css/css-grid/alignment/grid-baseline-align-cycles-001.html [ ImageOnlyFailure ] 4328 4326 webkit.org/b/231021 imported/w3c/web-platform-tests/css/css-grid/alignment/grid-inline-baseline.html [ ImageOnlyFailure ] -
trunk/Source/WebCore/ChangeLog
r286099 r286100 1 2021-11-21 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 This is a reland of r280290. It's got reverted because another patch r280078 caused crash and had been 9 reverted. r280290 is a dependent patch for r280078. 10 11 As discussed at https://github.com/w3c/csswg-drafts/issues/6286#issuecomment-866986544, degenerate 12 aspect ratios derived from SVG width/height attributes fall back to viewbox aspect ratio 13 (whether due to negative values or zero values). 14 15 When computing the logical height/width using an intrinsic aspect ratio, RenderReplaced uses the 16 overridingLogicalWidth/overridingLogicalHeight whenever defined as long as the flex or 17 grid item has an intrinsic size. For an SVG graphic though, it's common to have an intrinsic aspect 18 ratio but not to have an intrinsic width or height. For this special case, we still should use 19 overridingLogicalWidth/overridingLogicalHeight for logical height/width calculations. 20 21 * rendering/RenderReplaced.cpp: 22 (WebCore::hasIntrinsicSize): 23 (WebCore::RenderReplaced::computeReplacedLogicalWidth const): 24 (WebCore::RenderReplaced::computeReplacedLogicalHeight const): 25 1 26 2021-11-21 Alan Bujtas <zalan@apple.com> 2 27 -
trunk/Source/WebCore/rendering/RenderReplaced.cpp
r285998 r286100 532 532 } 533 533 534 static inline bool hasIntrinsicSize(RenderBox*contentRenderer, bool hasIntrinsicWidth, bool hasIntrinsicHeight ) 535 { 536 if (hasIntrinsicWidth && hasIntrinsicHeight) 537 return true; 538 if (hasIntrinsicWidth || hasIntrinsicHeight) 539 return contentRenderer && contentRenderer->isSVGRoot(); 540 return false; 541 } 542 534 543 LayoutUnit RenderReplaced::computeReplacedLogicalWidth(ShouldComputePreferred shouldComputePreferred) const 535 544 { … … 554 563 // 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 564 // width or height. There are also elements with intrinsic sizes but without intrinsic ratio (like an iframe). 556 if (intrinsicRatio && (isFlexItem() || isGridItem()) && hasOverridingLogicalHeight() && hasIntrinsic Width && hasIntrinsicHeight)565 if (intrinsicRatio && (isFlexItem() || isGridItem()) && hasOverridingLogicalHeight() && hasIntrinsicSize(contentRenderer, hasIntrinsicWidth, hasIntrinsicHeight)) 557 566 return computeReplacedLogicalWidthRespectingMinMaxWidth(roundToInt(round(overridingContentLogicalHeight() * intrinsicRatio)), shouldComputePreferred); 558 567 … … 624 633 625 634 // See computeReplacedLogicalHeight() for a similar check for heights. 626 if (intrinsicRatio && (isFlexItem() || isGridItem()) && hasOverridingLogicalWidth() && hasIntrinsic Height && hasIntrinsicWidth)635 if (intrinsicRatio && (isFlexItem() || isGridItem()) && hasOverridingLogicalWidth() && hasIntrinsicSize(contentRenderer, hasIntrinsicWidth, hasIntrinsicHeight)) 627 636 return computeReplacedLogicalHeightRespectingMinMaxHeight(roundToInt(round(overridingContentLogicalWidth() / intrinsicRatio))); 628 637
Note: See TracChangeset
for help on using the changeset viewer.