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

Issue 2135703002: [css-grid] Fix crash when using auto repeat for indefinite widths (Closed)

Created:
4 years, 5 months ago by svillar
Modified:
4 years, 5 months ago
CC:
chromium-reviews, jfernandez, szager+layoutwatch_chromium.org, zoltan1, blink-reviews-layout_chromium.org, pdr+renderingwatchlist_chromium.org, leviw+renderwatch, jchaffraix+rendering, blink-reviews, eae+blinkwatch
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[css-grid] Fix crash when using auto repeat for indefinite widths The computeAutoRepeatTracksCount() call needs to know the available size in order to compute a number of repetitions. When computing the preferred logical widths that size is indefinite so it should just return 1. The problem is that instead it was directly calling another methods that were reentering the preferred size computation. That lead to a situation of never ending recursive calls to the preferred widths code. As we know whether we're computing the intrinsic sizes or not, we can leverage that knowledge and do not call the method in that case (the number of repetitions would be 0 or 1 depending on whether auto-fit|fill was specified or not). Made some of the attributes mutable as they are modified by the intrinsic size computation. Moved the clean up of those attributes to a new method. We'll eventually need to change the current code so that we could call the track sizing algorithm without affecting the internal state of the layout object. BUG=621517 Committed: https://crrev.com/1c073ae5204b186aa0695ecedc80abc5225d85a4 Cr-Commit-Position: refs/heads/master@{#405529}

Patch Set 1 #

Total comments: 7

Patch Set 2 : Test improvements #

Total comments: 11

Patch Set 3 : Simplest approach #

Unified diffs Side-by-side diffs Delta from patch set Stats (+48 lines, -5 lines) Patch
A third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-indefinite-size-auto-repeat-crash.html View 1 1 chunk +31 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-indefinite-size-auto-repeat-crash-expected.txt View 1 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutGrid.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutGrid.cpp View 1 2 4 chunks +13 lines, -4 lines 0 comments Download

Messages

Total messages: 23 (6 generated)
svillar
Sending out for review
4 years, 5 months ago (2016-07-08 14:21:00 UTC) #2
Manuel Rego
I'm not sure about some of the changes, check the comments inline. https://codereview.chromium.org/2135703002/diff/1/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-indefinite-size-auto-repeat-crash.html File third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-indefinite-size-auto-repeat-crash.html ...
4 years, 5 months ago (2016-07-11 09:47:42 UTC) #3
svillar1
Thanks for the review! https://codereview.chromium.org/2135703002/diff/1/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-indefinite-size-auto-repeat-crash.html File third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-indefinite-size-auto-repeat-crash.html (right): https://codereview.chromium.org/2135703002/diff/1/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-indefinite-size-auto-repeat-crash.html#newcode16 third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-indefinite-size-auto-repeat-crash.html:16: <div class="grid autoFit"><span></span></div> On 2016/07/11 ...
4 years, 5 months ago (2016-07-11 10:34:48 UTC) #4
Manuel Rego
Ok thanks for the explanation. Non-owner LGTM. https://codereview.chromium.org/2135703002/diff/1/third_party/WebKit/Source/core/layout/LayoutGrid.cpp File third_party/WebKit/Source/core/layout/LayoutGrid.cpp (right): https://codereview.chromium.org/2135703002/diff/1/third_party/WebKit/Source/core/layout/LayoutGrid.cpp#newcode532 third_party/WebKit/Source/core/layout/LayoutGrid.cpp:532: clearGridDataAndMarkAsDirty(); On ...
4 years, 5 months ago (2016-07-11 11:10:57 UTC) #7
svillar
https://codereview.chromium.org/2135703002/diff/20001/third_party/WebKit/Source/core/layout/LayoutGrid.cpp File third_party/WebKit/Source/core/layout/LayoutGrid.cpp (right): https://codereview.chromium.org/2135703002/diff/20001/third_party/WebKit/Source/core/layout/LayoutGrid.cpp#newcode1627 third_party/WebKit/Source/core/layout/LayoutGrid.cpp:1627: { On 2016/07/11 11:10:57, Manuel Rego wrote: > Maybe ...
4 years, 5 months ago (2016-07-11 11:48:00 UTC) #8
jfernandez
https://codereview.chromium.org/2135703002/diff/20001/third_party/WebKit/Source/core/layout/LayoutGrid.cpp File third_party/WebKit/Source/core/layout/LayoutGrid.cpp (right): https://codereview.chromium.org/2135703002/diff/20001/third_party/WebKit/Source/core/layout/LayoutGrid.cpp#newcode1392 third_party/WebKit/Source/core/layout/LayoutGrid.cpp:1392: void LayoutGrid::placeItemsOnGrid(SizingOperation inlineAxisSizingOperation) Why we need to know whether ...
4 years, 5 months ago (2016-07-11 12:52:22 UTC) #9
svillar
https://codereview.chromium.org/2135703002/diff/20001/third_party/WebKit/Source/core/layout/LayoutGrid.cpp File third_party/WebKit/Source/core/layout/LayoutGrid.cpp (right): https://codereview.chromium.org/2135703002/diff/20001/third_party/WebKit/Source/core/layout/LayoutGrid.cpp#newcode1392 third_party/WebKit/Source/core/layout/LayoutGrid.cpp:1392: void LayoutGrid::placeItemsOnGrid(SizingOperation inlineAxisSizingOperation) On 2016/07/11 12:52:22, jfernandez wrote: > ...
4 years, 5 months ago (2016-07-11 14:18:43 UTC) #10
eae
https://codereview.chromium.org/2135703002/diff/20001/third_party/WebKit/Source/core/layout/LayoutGrid.h File third_party/WebKit/Source/core/layout/LayoutGrid.h (right): https://codereview.chromium.org/2135703002/diff/20001/third_party/WebKit/Source/core/layout/LayoutGrid.h#newcode215 third_party/WebKit/Source/core/layout/LayoutGrid.h:215: mutable GridRepresentation m_grid; A const clear method and mutable ...
4 years, 5 months ago (2016-07-12 17:38:48 UTC) #11
svillar
On 2016/07/12 17:38:48, eae wrote: > https://codereview.chromium.org/2135703002/diff/20001/third_party/WebKit/Source/core/layout/LayoutGrid.h > File third_party/WebKit/Source/core/layout/LayoutGrid.h (right): > > https://codereview.chromium.org/2135703002/diff/20001/third_party/WebKit/Source/core/layout/LayoutGrid.h#newcode215 > ...
4 years, 5 months ago (2016-07-13 09:13:21 UTC) #12
eae
On 2016/07/13 09:13:21, svillar wrote: > On 2016/07/12 17:38:48, eae wrote: > > > https://codereview.chromium.org/2135703002/diff/20001/third_party/WebKit/Source/core/layout/LayoutGrid.h ...
4 years, 5 months ago (2016-07-13 16:26:49 UTC) #13
Manuel Rego
New simplified version looks much better to me. I keep my non-owner LGTM. :-)
4 years, 5 months ago (2016-07-14 06:13:06 UTC) #14
jfernandez
It's really a better patch, LGTM
4 years, 5 months ago (2016-07-14 09:49:52 UTC) #15
eae
Much better, thank you! LGTM
4 years, 5 months ago (2016-07-14 16:33:04 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2135703002/40001
4 years, 5 months ago (2016-07-14 16:33:39 UTC) #18
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 5 months ago (2016-07-14 19:08:04 UTC) #20
commit-bot: I haz the power
CQ bit was unchecked.
4 years, 5 months ago (2016-07-14 19:08:27 UTC) #21
commit-bot: I haz the power
4 years, 5 months ago (2016-07-14 19:10:38 UTC) #23
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/1c073ae5204b186aa0695ecedc80abc5225d85a4
Cr-Commit-Position: refs/heads/master@{#405529}

Powered by Google App Engine
This is Rietveld 408576698