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

Issue 802243003: [CSS Grid Layout] Incorrect sizing of tracks with non-spanning items (Closed)

Created:
6 years ago by svillar
Modified:
5 years, 11 months ago
CC:
blink-reviews, blink-reviews-rendering, Dominik Röttsches, eae+blinkwatch, jchaffraix+rendering, jfernandez, leviw+renderwatch, pdr+renderingwatchlist_chromium.org, Manuel Rego, svillar, zoltan1
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

[CSS Grid Layout] Incorrect sizing of tracks with non-spanning items Content sized tracks with non-spanning grid items were not properly sized because the growth limit (maxBreadth) was sometimes infinity (-1) after calling resolveContentBasedTrackSizingFunctions() when it should not. This CL adds an special initialization phase for non-spanning grid items as the new track sizing algorithm describes. Granted, that was handled in the old algorithm in distributeSpaceToTracks() as a special case. The problem is that it regressed after the optimization added in r179621 because that method is no longer called when the space to distribute is 0. That's why we could fix this by allowing calls to distributeSpaceToTracks() with spaceToDistribute>=0 but by fixing it with an explicit initialization we get two nice side effects: 1) our implementation is now closer to the new algorithm and the initialization is now explicit in the code instead of a side effect of calling distributeSpaceToTracks() with no space to be distributed. 2) the performance of auto-grid-lots-of-data.html improves dramatically (296 vs 508 runs/s) mainly because the handling of non-spanning grid items is greatly simplified (we save sortings, hash lookups, function calls...). Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=188457

Patch Set 1 #

Total comments: 6

Patch Set 2 : Rebased + Test fixes #

Total comments: 4

Patch Set 3 : Patch for landing #

Patch Set 4 : Patch for landing v2 #

Patch Set 5 : Patch for landing v3 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+160 lines, -20 lines) Patch
M LayoutTests/fast/css-grid-layout/grid-content-sized-columns-resolution.html View 1 2 chunks +2 lines, -2 lines 0 comments Download
M LayoutTests/fast/css-grid-layout/grid-content-sized-columns-resolution-expected.txt View 1 2 chunks +2 lines, -2 lines 0 comments Download
A LayoutTests/fast/css-grid-layout/grid-initialize-span-one-items.html View 1 1 chunk +88 lines, -0 lines 0 comments Download
A LayoutTests/fast/css-grid-layout/grid-initialize-span-one-items-expected.txt View 1 1 chunk +33 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderGrid.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/rendering/RenderGrid.cpp View 1 2 3 4 3 chunks +25 lines, -2 lines 0 comments Download
M Source/core/rendering/style/GridTrackSize.h View 1 3 chunks +9 lines, -14 lines 0 comments Download

Messages

Total messages: 19 (6 generated)
svillar
6 years ago (2014-12-23 12:15:38 UTC) #2
Julien - ping for review
https://codereview.chromium.org/802243003/diff/1/LayoutTests/fast/css-grid-layout/grid-initialize-span-one-items.html File LayoutTests/fast/css-grid-layout/grid-initialize-span-one-items.html (right): https://codereview.chromium.org/802243003/diff/1/LayoutTests/fast/css-grid-layout/grid-initialize-span-one-items.html#newcode1 LayoutTests/fast/css-grid-layout/grid-initialize-span-one-items.html:1: <html> You've forgotten the DOCTYPE :( http://1funny.com/wp-content/uploads/2011/05/sad-cat.jpg https://codereview.chromium.org/802243003/diff/1/LayoutTests/fast/css-grid-layout/grid-initialize-span-one-items.html#newcode23 LayoutTests/fast/css-grid-layout/grid-initialize-span-one-items.html:23: ...
5 years, 11 months ago (2015-01-02 10:56:39 UTC) #3
svillar
Thanks for the review! https://codereview.chromium.org/802243003/diff/1/LayoutTests/fast/css-grid-layout/minmax-spanning-resolution-columns.html File LayoutTests/fast/css-grid-layout/minmax-spanning-resolution-columns.html (right): https://codereview.chromium.org/802243003/diff/1/LayoutTests/fast/css-grid-layout/minmax-spanning-resolution-columns.html#newcode195 LayoutTests/fast/css-grid-layout/minmax-spanning-resolution-columns.html:195: <div class="sizedToGridArea firstRowBothColumn" data-expected-width="145" data-expected-height="50">XXX ...
5 years, 11 months ago (2015-01-02 11:36:54 UTC) #4
svillar
I've rebased it against the recent changes. I've had also to update some test results ...
5 years, 11 months ago (2015-01-12 16:06:33 UTC) #5
svillar
Unfortunately I had to rebase before uploading this new patch, but it was mandatory in ...
5 years, 11 months ago (2015-01-12 16:08:48 UTC) #6
Julien - ping for review
lgtm https://codereview.chromium.org/802243003/diff/20001/LayoutTests/fast/css-grid-layout/grid-content-sized-columns-resolution-expected.txt File LayoutTests/fast/css-grid-layout/grid-content-sized-columns-resolution-expected.txt (right): https://codereview.chromium.org/802243003/diff/20001/LayoutTests/fast/css-grid-layout/grid-content-sized-columns-resolution-expected.txt#newcode16 LayoutTests/fast/css-grid-layout/grid-content-sized-columns-resolution-expected.txt:16: PASS window.getComputedStyle(gridAutoAndAutoUnsortedConstrained, '').getPropertyValue('grid-template-columns') is "10px 30px" Interesting, the ...
5 years, 11 months ago (2015-01-14 09:59:28 UTC) #7
svillar
Thanks for the review! https://codereview.chromium.org/802243003/diff/20001/LayoutTests/fast/css-grid-layout/grid-content-sized-columns-resolution-expected.txt File LayoutTests/fast/css-grid-layout/grid-content-sized-columns-resolution-expected.txt (right): https://codereview.chromium.org/802243003/diff/20001/LayoutTests/fast/css-grid-layout/grid-content-sized-columns-resolution-expected.txt#newcode16 LayoutTests/fast/css-grid-layout/grid-content-sized-columns-resolution-expected.txt:16: PASS window.getComputedStyle(gridAutoAndAutoUnsortedConstrained, '').getPropertyValue('grid-template-columns') is "10px ...
5 years, 11 months ago (2015-01-14 10:11:56 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/802243003/60001
5 years, 11 months ago (2015-01-14 15:55:27 UTC) #10
commit-bot: I haz the power
Try jobs failed on following builders: mac_blink_rel on tryserver.blink (http://build.chromium.org/p/tryserver.blink/builders/mac_blink_rel/builds/38716)
5 years, 11 months ago (2015-01-14 16:08:41 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/802243003/80001
5 years, 11 months ago (2015-01-14 16:11:45 UTC) #14
commit-bot: I haz the power
Try jobs failed on following builders: linux_blink_dbg on tryserver.blink (http://build.chromium.org/p/tryserver.blink/builders/linux_blink_dbg/builds/40859)
5 years, 11 months ago (2015-01-14 18:52:45 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/802243003/80001
5 years, 11 months ago (2015-01-15 07:29:50 UTC) #18
commit-bot: I haz the power
5 years, 11 months ago (2015-01-15 09:55:22 UTC) #19
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=188457

Powered by Google App Engine
This is Rietveld 408576698