Changeset 280022 in webkit
- Timestamp:
- Jul 19, 2021 1:39:01 AM (12 months ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/rendering/RenderBox.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/RenderBox.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r280017 r280022 1 2021-07-19 Ziran Sun <zsun@igalia.com> 2 3 [CSS-grid] Ignore the aspect-ratio of a replaced element if stretch alignments are applied to both axes 4 https://bugs.webkit.org/show_bug.cgi?id=227573 5 6 Reviewed by Javier Fernandez. 7 8 Two grid WPT tests are now passing. 9 10 * TestExpectations: 11 1 12 2021-07-16 Simon Fraser <simon.fraser@apple.com> 2 13 -
trunk/LayoutTests/TestExpectations
r279971 r280022 1435 1435 imported/w3c/web-platform-tests/css/css-grid/alignment/replaced-alignment-with-aspect-ratio-001.html [ ImageOnlyFailure ] 1436 1436 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-004.html [ ImageOnlyFailure ]1438 imported/w3c/web-platform-tests/css/css-grid/alignment/replaced-alignment-with-aspect-ratio-005.html [ ImageOnlyFailure ]1439 1437 imported/w3c/web-platform-tests/css/css-grid/alignment/replaced-alignment-with-aspect-ratio-006.html [ ImageOnlyFailure ] 1440 1438 imported/w3c/web-platform-tests/css/css-grid/alignment/replaced-alignment-with-aspect-ratio-007.html [ ImageOnlyFailure ] -
trunk/Source/WebCore/ChangeLog
r280020 r280022 1 2021-07-19 Ziran Sun <zsun@igalia.com> 2 3 [CSS-grid] Ignore the aspect-ratio of a replaced element if stretch alignments are applied to both axes 4 https://bugs.webkit.org/show_bug.cgi?id=227573 5 6 Reviewed by Javier Fernandez. 7 8 As discussed in https://github.com/w3c/csswg-drafts/issues/5713, for the replaced element as a grid item, 9 when both axes have stretch alignments applied and there is no auto margin(s) presented, the aspect ratio 10 should be ignored if there is any. 11 12 Part of this patch is an import of Chromium CL at 13 https://chromium-review.googlesource.com/c/chromium/src/+/2651651 14 15 * rendering/RenderBox.cpp: 16 (WebCore::RenderBox::hasStretchedLogicalHeight const): 17 (WebCore::RenderBox::shouldComputeLogicalWidthFromAspectRatio const): 18 * rendering/RenderBox.h: 19 1 20 2021-07-18 Sam Weinig <weinig@apple.com> 2 21 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r280017 r280022 2761 2761 2762 2762 // FIXME: Can/Should we move this inside specific layout classes (flex. grid)? Can we refactor columnFlexItemHasStretchAlignment logic? 2763 bool RenderBox::hasStretchedLogicalHeight() const 2764 { 2765 auto& style = this->style(); 2766 if (!style.logicalHeight().isAuto() || style.marginBefore().isAuto() || style.marginAfter().isAuto()) 2767 return false; 2768 RenderBlock* containingBlock = this->containingBlock(); 2769 if (!containingBlock) { 2770 // We are evaluating align-self/justify-self, which default to 'normal' for the root element. 2771 // The 'normal' value behaves like 'start' except for Flexbox Items, which obviously should have a container. 2772 return false; 2773 } 2774 if (containingBlock->isHorizontalWritingMode() != isHorizontalWritingMode()) 2775 return style.resolvedJustifySelf(&containingBlock->style(), containingBlock->selfAlignmentNormalBehavior(this)).position() == ItemPosition::Stretch; 2776 return style.resolvedAlignSelf(&containingBlock->style(), containingBlock->selfAlignmentNormalBehavior(this)).position() == ItemPosition::Stretch; 2777 } 2778 2779 // FIXME: Can/Should we move this inside specific layout classes (flex. grid)? Can we refactor columnFlexItemHasStretchAlignment logic? 2763 2780 bool RenderBox::hasStretchedLogicalWidth() const 2764 2781 { … … 5252 5269 return false; 5253 5270 5271 if (isGridItem() && shouldComputeSizeAsReplaced() && hasStretchedLogicalWidth() && hasStretchedLogicalHeight()) 5272 return false; 5273 5254 5274 auto isResolvablePercentageHeight = [&] { 5255 5275 return style().logicalHeight().isPercentOrCalculated() && (isOutOfFlowPositioned() || percentageLogicalHeightIsResolvable()); -
trunk/Source/WebCore/rendering/RenderBox.h
r279918 r280022 437 437 bool sizesLogicalWidthToFitContent(SizeType) const; 438 438 439 bool hasStretchedLogicalHeight() const; 439 440 bool hasStretchedLogicalWidth() const; 440 441 bool isStretchingColumnFlexItem() const;
Note: See TracChangeset
for help on using the changeset viewer.