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

Issue 1323053004: [CSS Grid Layout] Flex tracks sizing alg must handle 0fr values (Closed)

Created:
5 years, 3 months ago by jfernandez
Modified:
5 years, 2 months ago
CC:
darktears, apavlov+blink_chromium.org, blink-reviews, blink-reviews-css, blink-reviews-rendering, dglazkov+blink, eae+blinkwatch, jchaffraix+rendering, leviw+renderwatch, pdr+renderingwatchlist_chromium.org, Manuel Rego, rwlbuis, svillar, szager+layoutwatch_chromium.org, zoltan1
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[CSS Grid Layout] Flex tracks sizing alg must handle 0fr values We don't allow 0 as flexible size value, which is not following current specs; it just states that it must be a non-negative value. This patch adds such change in the parser but some additional logic must be added as well to handle 0 values during the flex tracks sizing algorithm. The old algorithm didn't take 0 values into account, so there is the risk of division by zero. Additionally, it was not handling fraction values in the best way. The last versions of the spec changed this algorithm in order to handle fraction values so that they don't cause exponential grow of tracks using values bigger than 1. This patch implements also such new algorithm, so we can deal not only with 0 values, but managing fraction values properly. BUG=520477 Committed: https://crrev.com/993d4f780cb06a25b21613fead8fceca12dcdf6a Cr-Commit-Position: refs/heads/master@{#351301}

Patch Set 1 #

Patch Set 2 : Removed the GridTrackForNormalization data structure. #

Patch Set 3 : Function normalizedFlexFraction moved #

Total comments: 12

Patch Set 4 : Applied suggested changes. #

Total comments: 2

Patch Set 5 : Iterations instead of recursion and references for the HashSet #

Patch Set 6 : Using inline capacity in Vector initialization. #

Patch Set 7 : Pointers for the hashset and recursion only for computing the unit size. #

Total comments: 9

Patch Set 8 : Applied suggested changes. #

Patch Set 9 : Using LayoutUnits when required. #

Patch Set 10 : Just some changes in some variable names. #

Total comments: 1

Patch Set 11 : Applied last suggested changes. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+280 lines, -84 lines) Patch
M third_party/WebKit/LayoutTests/fast/css-grid-layout/flex-and-minmax-content-resolution-rows.html View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/fast/css-grid-layout/flex-content-resolution-columns.html View 1 2 3 4 5 6 7 8 4 chunks +66 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/css-grid-layout/flex-content-resolution-columns-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/css-grid-layout/flex-content-resolution-rows.html View 1 2 3 4 5 6 7 8 6 chunks +103 lines, -3 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/css-grid-layout/flex-content-resolution-rows-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +9 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/css-grid-layout/flex-factor-sum-less-than-1.html View 1 2 3 4 5 6 7 8 2 chunks +13 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/css-grid-layout/flex-factor-sum-less-than-1-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-columns-rows-get-set-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +8 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/css-grid-layout/non-grid-columns-rows-get-set-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +8 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/css-grid-layout/resources/grid-columns-rows-get-set.js View 1 2 3 4 5 6 7 8 2 chunks +5 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/css-grid-layout/resources/non-grid-columns-rows-get-set.js View 1 2 3 4 5 6 7 8 2 chunks +5 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutGrid.h View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutGrid.cpp View 1 2 3 4 5 6 7 8 9 10 6 chunks +51 lines, -74 lines 0 comments Download

Messages

Total messages: 26 (7 generated)
jfernandez
5 years, 3 months ago (2015-09-07 12:57:44 UTC) #2
svillar
Really nice patch. It simplifies a lot the fr resolution code and makes it far ...
5 years, 3 months ago (2015-09-08 13:27:07 UTC) #3
jfernandez
On 2015/09/08 13:27:07, svillar wrote: > Really nice patch. It simplifies a lot the fr ...
5 years, 3 months ago (2015-09-09 09:22:31 UTC) #4
jfernandez
Replied to your review comments and preparing a new patch with the suggested changes. https://codereview.chromium.org/1323053004/diff/40001/LayoutTests/fast/css-grid-layout/flex-and-minmax-content-resolution-rows.html ...
5 years, 3 months ago (2015-09-09 09:23:22 UTC) #5
jfernandez
Added a new patch for review.
5 years, 3 months ago (2015-09-09 11:15:51 UTC) #6
svillar
lgtm
5 years, 3 months ago (2015-09-09 16:50:50 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1323053004/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1323053004/60001
5 years, 3 months ago (2015-09-09 21:11:30 UTC) #9
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/97904)
5 years, 3 months ago (2015-09-09 21:21:42 UTC) #11
Timothy Loh
On 2015/09/09 21:21:42, commit-bot: I haz the power wrote: > Try jobs failed on following ...
5 years, 3 months ago (2015-09-09 23:59:56 UTC) #12
esprehn
This creates tons of copies of the HashSet every time you call that function, do ...
5 years, 3 months ago (2015-09-10 01:03:14 UTC) #14
jfernandez
New iterative approach to avoid recursion and using references to avoid copying the HashSet.
5 years, 3 months ago (2015-09-15 17:37:47 UTC) #15
jfernandez
@svillar didn't like the iterative version, so I've cooked a new patch, using recursion only ...
5 years, 3 months ago (2015-09-18 20:29:23 UTC) #16
svillar
Nice job, I'm liking it again. I was tempted to give it a go but ...
5 years, 3 months ago (2015-09-23 14:57:16 UTC) #17
jfernandez
https://codereview.chromium.org/1323053004/diff/120001/Source/core/layout/LayoutGrid.cpp File Source/core/layout/LayoutGrid.cpp (right): https://codereview.chromium.org/1323053004/diff/120001/Source/core/layout/LayoutGrid.cpp#newcode516 Source/core/layout/LayoutGrid.cpp:516: double hypotheticalFactorUnitSize = flexFactorSum > 1 ? leftOverSpace / ...
5 years, 2 months ago (2015-09-24 08:16:36 UTC) #18
jfernandez
Added a new patch which uses LayoutUnit for availableSpace and baseSize, as requested. I had ...
5 years, 2 months ago (2015-09-25 11:42:20 UTC) #19
svillar
Go go go!!! lgtm https://codereview.chromium.org/1323053004/diff/200001/third_party/WebKit/Source/core/layout/LayoutGrid.cpp File third_party/WebKit/Source/core/layout/LayoutGrid.cpp (right): https://codereview.chromium.org/1323053004/diff/200001/third_party/WebKit/Source/core/layout/LayoutGrid.cpp#newcode514 third_party/WebKit/Source/core/layout/LayoutGrid.cpp:514: double hypotheticalFactorUnitSize = leftOverSpace / ...
5 years, 2 months ago (2015-09-29 09:08:19 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1323053004/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1323053004/220001
5 years, 2 months ago (2015-09-29 11:15:08 UTC) #24
commit-bot: I haz the power
Committed patchset #11 (id:220001)
5 years, 2 months ago (2015-09-29 13:10:17 UTC) #25
commit-bot: I haz the power
5 years, 2 months ago (2015-09-29 13:12:01 UTC) #26
Message was sent while issue was closed.
Patchset 11 (id:??) landed as
https://crrev.com/993d4f780cb06a25b21613fead8fceca12dcdf6a
Cr-Commit-Position: refs/heads/master@{#351301}

Powered by Google App Engine
This is Rietveld 408576698