Changeset 272338 in webkit
- Timestamp:
- Feb 3, 2021 1:22:30 PM (18 months ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-auto-margin-and-replaced-item-001-expected.html (added)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-auto-margin-and-replaced-item-001.html (added)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/w3c-import.log (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/RenderReplaced.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderReplaced.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r272315 r272338 1 2021-02-03 Ziran Sun <zsun@igalia.com> 2 3 the nested grid container which has replaced item with 'max-height' has wrong width(0px). 4 https://bugs.webkit.org/show_bug.cgi?id=219194 5 6 Reviewed by Javier Fernandez. 7 8 The test is imported from WPT. 9 10 * web-platform-tests/css/css-grid/grid-items/grid-auto-margin-and-replaced-item-001-expected.html: Added. 11 * web-platform-tests/css/css-grid/grid-items/grid-auto-margin-and-replaced-item-001.html: Added. 12 1 13 2021-02-03 Rob Buis <rbuis@igalia.com> 2 14 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/w3c-import.log
r272309 r272338 19 19 /LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/explicitly-sized-grid-item-as-table-expected.html 20 20 /LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/explicitly-sized-grid-item-as-table.html 21 /LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-auto-margin-and-replaced-item-001.html 21 22 /LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-automatic-minimum-intrinsic-aspect-ratio-001.html 22 23 /LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-img-item-percent-max-height-001.html -
trunk/Source/WebCore/ChangeLog
r272337 r272338 1 2021-02-03 Ziran Sun <zsun@igalia.com> 2 3 the nested grid container which has replaced item with 'max-height' has wrong width(0px). 4 https://bugs.webkit.org/show_bug.cgi?id=219194 5 6 Reviewed by Javier Fernandez. 7 8 Width of a nested grid container with margin:auto returns 0 when their item has "max-height". 9 This causes the grid item's position wrong due to the wrongly comuputed auto-margin value. 10 This change is to check whether the preferred logical width is dirty when the grid area changes. 11 12 This is an import of Chromium change at 13 https://chromium-review.googlesource.com/c/chromium/src/+/2503910 14 This change also imported needsPreferredWidthsRecalculation() from Chromium to RenderReplaced to 15 address the test case specified here. 16 17 Test: imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-auto-margin-and-replaced-item-001.html 18 19 * rendering/GridTrackSizingAlgorithm.cpp: 20 (WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild const): 21 (WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild const): 22 * rendering/RenderReplaced.cpp: 23 (WebCore::RenderReplaced::needsPreferredWidthsRecalculation const): 24 * rendering/RenderReplaced.h: 25 1 26 2021-02-03 Sihui Liu <sihui_liu@appe.com> 2 27 -
trunk/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp
r269509 r272338 776 776 // FIXME: It's unclear if we should return the intrinsic width or the preferred width. 777 777 // See http://lists.w3.org/Archives/Public/www-style/2013Jan/0245.html 778 if (child.needsPreferredWidthsRecalculation()) 779 child.setPreferredLogicalWidthsDirty(true); 778 780 return child.minPreferredLogicalWidth() + GridLayoutFunctions::marginLogicalSizeForChild(*renderGrid(), childInlineDirection, child) + m_algorithm.baselineOffsetForChild(child, gridAxisForDirection(direction())); 779 781 } … … 790 792 // FIXME: It's unclear if we should return the intrinsic width or the preferred width. 791 793 // See http://lists.w3.org/Archives/Public/www-style/2013Jan/0245.html 794 if (child.needsPreferredWidthsRecalculation()) 795 child.setPreferredLogicalWidthsDirty(true); 792 796 return child.maxPreferredLogicalWidth() + GridLayoutFunctions::marginLogicalSizeForChild(*renderGrid(), childInlineDirection, child) + m_algorithm.baselineOffsetForChild(child, gridAxisForDirection(direction())); 793 797 } -
trunk/Source/WebCore/rendering/RenderReplaced.cpp
r271638 r272338 793 793 } 794 794 795 } 795 bool RenderReplaced::needsPreferredWidthsRecalculation() const 796 { 797 // If the height is a percentage and the width is auto, then the containingBlocks's height changing can cause this node to change it's preferred width because it maintains aspect ratio. 798 return hasRelativeLogicalHeight() && style().logicalWidth().isAuto(); 799 } 800 801 } -
trunk/Source/WebCore/rendering/RenderReplaced.h
r271638 r272338 46 46 47 47 bool isContentLikelyVisibleInViewport(); 48 bool needsPreferredWidthsRecalculation() const override; 48 49 49 50 protected:
Note: See TracChangeset
for help on using the changeset viewer.