Changeset 272711 in webkit
- Timestamp:
- Feb 11, 2021 12:44:54 AM (17 months ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 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)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/percentage-height-in-flexbox-expected.txt (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
r272651 r272711 1 2021-02-11 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 * web-platform-tests/css/css-sizing/percentage-height-in-flexbox-expected.txt: Added. 13 14 1 15 2021-02-10 Manuel Rego Casasnovas <rego@igalia.com> 2 16 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/w3c-import.log
r272367 r272711 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-expected.html 22 /LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-auto-margin-and-replaced-item-001.html 21 23 /LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-automatic-minimum-intrinsic-aspect-ratio-001.html 22 24 /LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-img-item-percent-max-height-001.html -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/percentage-height-in-flexbox-expected.txt
r270578 r272711 2 2 3 3 PASS #target offsetSize matches #container offsetSize 4 FAIL #target offsetSize matches #container offsetSize after resize assert_equals: expected 50 but got 100 4 PASS #target offsetSize matches #container offsetSize after resize 5 5 -
trunk/Source/WebCore/ChangeLog
r272709 r272711 1 2021-02-11 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 It's a reland of r272338, which got reverted because it broken 13 imported/w3c/web-platform-tests/css/css-sizing/percentage-height-in-flexbox.html on ios. This change 14 actually fixes the test failure in the flexbox test. Hence, updating test expectation file of 15 the flexbox test seems working. 16 17 This is an import of Chromium change at 18 https://chromium-review.googlesource.com/c/chromium/src/+/2503910 19 This change also imported needsPreferredWidthsRecalculation() from Chromium to RenderReplaced to 20 address the test case specified here. 21 22 Test: imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-auto-margin-and-replaced-item-001.html 23 24 * rendering/GridTrackSizingAlgorithm.cpp: 25 (WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild const): 26 (WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild const): 27 * rendering/RenderReplaced.cpp: 28 (WebCore::RenderReplaced::needsPreferredWidthsRecalculation const): 29 * rendering/RenderReplaced.h: 30 1 31 2021-02-10 Jer Noble <jer.noble@apple.com> 2 32 -
trunk/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp
r272367 r272711 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
r272367 r272711 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
r272367 r272711 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.