Changeset 217705 in webkit
- Timestamp:
- Jun 2, 2017 2:08:15 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r217704 r217705 1 2017-06-02 Javier Fernandez <jfernandez@igalia.com> 2 3 [css-grid] Margin wrong applied when stretching an orthogonal item in fixed size track 4 https://bugs.webkit.org/show_bug.cgi?id=172590 5 6 Reviewed by Sergio Villar Senin. 7 8 * TestExpectations: 2 tests pass now but 3 more fail because of bug #172836 9 * fast/css-grid-layout/grid-item-stretching-must-not-depend-on-previous-layouts-expected.html: Added. 10 * fast/css-grid-layout/grid-item-stretching-must-not-depend-on-previous-layouts.html: Added. 11 1 12 2017-06-02 Zan Dobersek <zdobersek@igalia.com> 2 13 -
trunk/LayoutTests/TestExpectations
r217670 r217705 285 285 webkit.org/b/165062 fast/css-grid-layout/grid-baseline.html [ ImageOnlyFailure ] 286 286 webkit.org/b/165062 fast/css-grid-layout/grid-baseline-margins.html [ ImageOnlyFailure ] 287 webkit.org/b/172590 imported/w3c/web-platform-tests/css/css-grid-1/abspos/orthogonal-positioned-grid-items-013.html [ ImageOnlyFailure ]288 webkit.org/b/172590 imported/w3c/web-platform-tests/css/css-grid-1/abspos/orthogonal-positioned-grid-items-017.html [ ImageOnlyFailure ]289 287 webkit.org/b/149891 imported/w3c/web-platform-tests/css/css-grid-1/grid-layout-properties.html [ Failure ] 290 288 webkit.org/b/169271 imported/w3c/web-platform-tests/css/css-grid-1/grid-items/grid-items-sizing-alignment-001.html [ ImageOnlyFailure ] 289 webkit.org/b/172836 imported/w3c/web-platform-tests/css/css-grid-1/alignment/grid-self-alignment-stretch-014.html [ Failure ] 290 webkit.org/b/172836 imported/w3c/web-platform-tests/css/css-grid-1/alignment/grid-self-alignment-stretch-vertical-rl-014.html [ Failure ] 291 webkit.org/b/172836 imported/w3c/web-platform-tests/css/css-grid-1/alignment/grid-self-alignment-stretch-vertical-lr-014.html [ Failure ] 291 292 292 293 # selectors4 -
trunk/LayoutTests/imported/w3c/ChangeLog
r217652 r217705 1 2017-06-02 Javier Fernandez <jfernandez@igalia.com> 2 3 [css-grid] Margin wrong applied when stretching an orthogonal item in fixed size track 4 https://bugs.webkit.org/show_bug.cgi?id=172590 5 6 Reviewed by Sergio Villar Senin. 7 8 All the test cases of these tests pass with this change, so updating their expectations accordingly. 9 10 * web-platform-tests/css/css-grid-1/alignment/grid-self-alignment-stretch-006-expected.txt: 11 * web-platform-tests/css/css-grid-1/alignment/grid-self-alignment-stretch-vertical-lr-006-expected.txt: 12 * web-platform-tests/css/css-grid-1/alignment/grid-self-alignment-stretch-vertical-rl-006-expected.txt: 13 1 14 2017-06-01 Javier Fernandez <jfernandez@igalia.com> 2 15 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid-1/alignment/grid-self-alignment-stretch-006-expected.txt
r217652 r217705 10 10 XX XXX 11 11 12 FAIL .grid 1 assert_equals: 13 <div class="grid"> 14 <div data-offset-x="0" data-offset-y="0" data-expected-width="90" data-expected-height="60" class="firstRowFirstColumn">X XX X</div> 15 <div data-offset-x="100" data-offset-y="0" data-expected-width="40" data-expected-height="130" class="firstRowSecondColumn">XX X<br>X XXX<br>X<br>XX XXX</div> 16 <div data-offset-x="0" data-offset-y="150" data-expected-width="10" data-expected-height="60" class="secondRowFirstColumn">X XX X</div> 17 <div data-offset-x="100" data-offset-y="150" data-expected-width="130" data-expected-height="90" class="secondRowSecondColumn">XX X<br>X XXX<br>X<br>XX XXX</div> 18 </div> 19 width expected 90 but got 100 12 PASS .grid 1 20 13 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid-1/alignment/grid-self-alignment-stretch-vertical-lr-006-expected.txt
r217652 r217705 10 10 XX XXX 11 11 12 FAIL .grid 1 assert_equals: 13 <div class="grid"> 14 <div data-offset-x="0" data-offset-y="0" data-expected-width="60" data-expected-height="90" class="firstRowFirstColumn">X XX X</div> 15 <div data-offset-x="0" data-offset-y="100" data-expected-width="130" data-expected-height="40" class="firstRowSecondColumn">XX X<br>X XXX<br>X<br>XX XXX</div> 16 <div data-offset-x="150" data-offset-y="0" data-expected-width="60" data-expected-height="10" class="secondRowFirstColumn">X XX X</div> 17 <div data-offset-x="150" data-offset-y="100" data-expected-width="90" data-expected-height="130" class="secondRowSecondColumn">XX X<br>X XXX<br>X<br>XX XXX</div> 18 </div> 19 height expected 90 but got 100 12 PASS .grid 1 20 13 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid-1/alignment/grid-self-alignment-stretch-vertical-rl-006-expected.txt
r217652 r217705 10 10 XX XXX 11 11 12 FAIL .grid 1 assert_equals: 13 <div class="grid"> 14 <div data-offset-x="190" data-offset-y="0" data-expected-width="60" data-expected-height="90" class="firstRowFirstColumn">X XX X</div> 15 <div data-offset-x="100" data-offset-y="100" data-expected-width="130" data-expected-height="40" class="firstRowSecondColumn">XX X<br>X XXX<br>X<br>XX XXX</div> 16 <div data-offset-x="40" data-offset-y="0" data-expected-width="60" data-expected-height="10" class="secondRowFirstColumn">X XX X</div> 17 <div data-offset-x="0" data-offset-y="100" data-expected-width="90" data-expected-height="130" class="secondRowSecondColumn">XX X<br>X XXX<br>X<br>XX XXX</div> 18 </div> 19 height expected 90 but got 100 12 PASS .grid 1 20 13 -
trunk/Source/WebCore/ChangeLog
r217702 r217705 1 2017-06-02 Javier Fernandez <jfernandez@igalia.com> 2 3 [css-grid] Margin wrong applied when stretching an orthogonal item in fixed size track 4 https://bugs.webkit.org/show_bug.cgi?id=172590 5 6 Reviewed by Sergio Villar Senin. 7 8 We need to consider orthogonality when using the item's logical margin to 9 compute the available space for stretching. 10 11 The issue this patch fixes is only reproducible when the grid layout logic 12 is executed several times, since probably the item doesn't need to be 13 laid out again. In such cases, we just get the cached logical margins 14 but we were not taking orthogonality into account. 15 16 Test: fast/css-grid-layout/grid-item-stretching-must-not-depend-on-previous-layouts.html 17 18 * rendering/RenderGrid.cpp: 19 (WebCore::RenderGrid::layoutBlock): 20 (WebCore::RenderGrid::marginLogicalSizeForChild): 21 (WebCore::RenderGrid::availableAlignmentSpaceForChildBeforeStretching): 22 * rendering/RenderGrid.h: 23 1 24 2017-06-01 Carlos Garcia Campos <cgarcia@igalia.com> 2 25 -
trunk/Source/WebCore/rendering/RenderGrid.cpp
r217486 r217705 1136 1136 } 1137 1137 1138 // FIXME: This logic is shared by RenderFlexibleBox, so it should be moved to RenderBox. 1139 LayoutUnit RenderGrid::marginLogicalHeightForChild(const RenderBox& child) const 1140 { 1141 return isHorizontalWritingMode() ? child.verticalMarginExtent() : child.horizontalMarginExtent(); 1138 LayoutUnit RenderGrid::marginLogicalSizeForChild(GridTrackSizingDirection direction, const RenderBox& child) const 1139 { 1140 return flowAwareDirectionForChild(child, direction) == ForColumns ? child.marginLogicalWidth() : child.marginLogicalHeight(); 1142 1141 } 1143 1142 … … 1162 1161 // children are laid out, so we can't use the child cached values. Hence, we need to 1163 1162 // compute margins in order to determine the available height before stretching. 1164 return gridAreaBreadthForChild - (child.needsLayout() ? computeMarginLogicalSizeForChild(ForRows, child) : marginLogicalHeightForChild(child)); 1163 GridTrackSizingDirection childBlockFlowDirection = flowAwareDirectionForChild(child, ForRows); 1164 return gridAreaBreadthForChild - (child.needsLayout() ? computeMarginLogicalSizeForChild(childBlockFlowDirection, child) : marginLogicalSizeForChild(childBlockFlowDirection, child)); 1165 1165 } 1166 1166 -
trunk/Source/WebCore/rendering/RenderGrid.h
r215800 r217705 131 131 132 132 void paintChildren(PaintInfo& forSelf, const LayoutPoint& paintOffset, PaintInfo& forChild, bool usePrintRect) override; 133 LayoutUnit marginLogical HeightForChild(const RenderBox&) const;133 LayoutUnit marginLogicalSizeForChild(GridTrackSizingDirection, const RenderBox&) const; 134 134 LayoutUnit computeMarginLogicalSizeForChild(GridTrackSizingDirection, const RenderBox&) const; 135 135 LayoutUnit availableAlignmentSpaceForChildBeforeStretching(LayoutUnit gridAreaBreadthForChild, const RenderBox&) const;
Note: See TracChangeset
for help on using the changeset viewer.