Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(536)

Issue 146833018: [CSS Grid Layout] Fix missing layout in flexible and content sized columns (Closed)

Created:
6 years, 10 months ago by Manuel Rego
Modified:
6 years, 10 months ago
CC:
blink-reviews, bemjb+rendering_chromium.org, dsinclair, zoltan1, eae+blinkwatch, leviw+renderwatch, jchaffraix+rendering, svillar, jfernandez
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

[CSS Grid Layout] Fix missing layout in flexible and content sized columns RenderGrid::logicalContentHeightForChild() is called for some items at the beginning of RenderGrid::layoutGridItems() from RenderGrid::computeUsedBreadthOfGridTracks(). This causes that the comparison inside the for loop in RenderGrid::layoutGridItems() does not detect width changes, so elements won't be marked as needsLayout. So the comparison is done in RenderGrid::logicalContentHeightForChild() and the element is marked to perform a layout if the width has changed. The issue can be reproduced easily with a simple grid with one flexible or content sized column, all the available width is not used. On top of that, when you resize the window the flexible or content sized columns are not updating their size properly. Perftest Layout/auto-grid-lots-of-data.html is around 4% worse, which is expected as we're adding a missing layout. TEST=fast/css-grid-layout/flex-content-sized-column-use-available-width.html,fast/css-grid-layout/flex-content-sized-columns-resize.html Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=166914

Patch Set 1 #

Total comments: 1

Patch Set 2 : #

Patch Set 3 : Move check to RenderGrid::resolveContentBasedTrackSizingFunctions() #

Total comments: 5

Patch Set 4 : New version of the patch fixing layout tests and comming back to original approach #

Unified diffs Side-by-side diffs Delta from patch set Stats (+152 lines, -2 lines) Patch
A LayoutTests/fast/css-grid-layout/flex-content-sized-column-use-available-width.html View 1 2 1 chunk +32 lines, -0 lines 0 comments Download
A LayoutTests/fast/css-grid-layout/flex-content-sized-column-use-available-width-expected.html View 1 2 1 chunk +27 lines, -0 lines 0 comments Download
A LayoutTests/fast/css-grid-layout/flex-content-sized-columns-resize.html View 1 2 3 1 chunk +41 lines, -0 lines 0 comments Download
A LayoutTests/fast/css-grid-layout/flex-content-sized-columns-resize-expected.html View 1 2 3 1 chunk +48 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderGrid.cpp View 1 2 3 1 chunk +4 lines, -2 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
Manuel Rego
6 years, 10 months ago (2014-01-28 16:27:19 UTC) #1
Julien - ping for review
https://codereview.chromium.org/146833018/diff/1/Source/core/rendering/RenderGrid.cpp File Source/core/rendering/RenderGrid.cpp (right): https://codereview.chromium.org/146833018/diff/1/Source/core/rendering/RenderGrid.cpp#newcode568 Source/core/rendering/RenderGrid.cpp:568: if (child->style()->logicalHeight().isPercent() || oldOverrideContainingBlockContentLogicalWidth != overrideContainingBlockContentLogicalWidth) Quick question: why ...
6 years, 10 months ago (2014-01-29 02:14:07 UTC) #2
Manuel Rego
On 2014/01/29 02:14:07, Julien Chaffraix - PST wrote: > Quick question: why is this check ...
6 years, 10 months ago (2014-01-29 22:18:22 UTC) #3
Manuel Rego
New patch has been uploaded for review only issuing a layout for items in flexible ...
6 years, 10 months ago (2014-01-29 23:42:05 UTC) #4
Manuel Rego
On 2014/01/29 02:14:07, Julien Chaffraix - PST wrote: > Quick question: why is this check ...
6 years, 10 months ago (2014-01-31 14:04:45 UTC) #5
Julien - ping for review
lgtm on the original approach. https://codereview.chromium.org/146833018/diff/40001/LayoutTests/fast/css-grid-layout/flex-content-sized-columns-resize.html File LayoutTests/fast/css-grid-layout/flex-content-sized-columns-resize.html (right): https://codereview.chromium.org/146833018/diff/40001/LayoutTests/fast/css-grid-layout/flex-content-sized-columns-resize.html#newcode33 LayoutTests/fast/css-grid-layout/flex-content-sized-columns-resize.html:33: testRunner.useUnfortunateSynchronousResizeMode(); O_o https://codereview.chromium.org/146833018/diff/40001/LayoutTests/fast/css-grid-layout/flex-content-sized-columns-resize.html#newcode42 LayoutTests/fast/css-grid-layout/flex-content-sized-columns-resize.html:42: ...
6 years, 10 months ago (2014-02-07 00:13:57 UTC) #6
Manuel Rego
On 2014/02/07 00:13:57, Julien Chaffraix - PST wrote: > lgtm on the original approach. Uploaded ...
6 years, 10 months ago (2014-02-07 23:13:59 UTC) #7
Manuel Rego
The CQ bit was checked by rego@igalia.com
6 years, 10 months ago (2014-02-11 09:39:46 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rego@igalia.com/146833018/110001
6 years, 10 months ago (2014-02-11 09:40:00 UTC) #9
commit-bot: I haz the power
6 years, 10 months ago (2014-02-11 11:47:04 UTC) #10
Message was sent while issue was closed.
Change committed as 166914

Powered by Google App Engine
This is Rietveld 408576698