Again a recent change on the spec, introducing a new option to define the track breadths: https://github.com/w3c/csswg-drafts/commit/3bc73f80 The syntax is: fit-content( [ <length> | <percentage> ] ) See: https://drafts.csswg.org/css-grid/#valdef-grid-template-columns-fit-content
Before working on this we should read carefully: https://github.com/w3c/csswg-drafts/issues/209
Working on this
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1993c05386140afe56921048784bf3ca449f4b63 commit 1993c05386140afe56921048784bf3ca449f4b63 Author: svillar <svillar@igalia.com> Date: Wed Aug 31 17:40:15 2016 [css-grid] Implement fit-content track size This CL implements the new <fit-content> track size which is defined as follows: "Represents the formula min(max-content, max(auto, argument)), which is calculated similar to auto (i.e. minmax(auto, max-content)), except that the track size is clamped at argument if it is greater than the auto minimum." From the parsing POV fit-content was implemented as a new type of function which only takes one argument. That forced us to refactor some code because minmax() was the only allowed function for <track-size>s so far. The implementation key is a new attribute in GridTrack called growthLimitCap which is precisely the attribute of fit-content(). Some parts of the track sizing algorithm were adapted to this change like for example the sorting of tracks by growth potential (we need to consider the caps). BUG= 618972 Review-Url: https://codereview.chromium.org/2287113004 Cr-Commit-Position: refs/heads/master@{#415676} [add] https://crrev.com/1993c05386140afe56921048784bf3ca449f4b63/third_party/WebKit/LayoutTests/fast/css-grid-layout/fit-content-columns-expected.html [add] https://crrev.com/1993c05386140afe56921048784bf3ca449f4b63/third_party/WebKit/LayoutTests/fast/css-grid-layout/fit-content-columns.html [add] https://crrev.com/1993c05386140afe56921048784bf3ca449f4b63/third_party/WebKit/LayoutTests/fast/css-grid-layout/fit-content-rows-expected.html [add] https://crrev.com/1993c05386140afe56921048784bf3ca449f4b63/third_party/WebKit/LayoutTests/fast/css-grid-layout/fit-content-rows.html [modify] https://crrev.com/1993c05386140afe56921048784bf3ca449f4b63/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-auto-columns-rows-get-set-expected.txt [modify] https://crrev.com/1993c05386140afe56921048784bf3ca449f4b63/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-auto-columns-rows-get-set.html [modify] https://crrev.com/1993c05386140afe56921048784bf3ca449f4b63/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-columns-rows-get-set-expected.txt [modify] https://crrev.com/1993c05386140afe56921048784bf3ca449f4b63/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-columns-rows-get-set.html [modify] https://crrev.com/1993c05386140afe56921048784bf3ca449f4b63/third_party/WebKit/LayoutTests/fast/css-grid-layout/resources/grid-columns-rows-get-set.js [modify] https://crrev.com/1993c05386140afe56921048784bf3ca449f4b63/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp [modify] https://crrev.com/1993c05386140afe56921048784bf3ca449f4b63/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp [modify] https://crrev.com/1993c05386140afe56921048784bf3ca449f4b63/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp [modify] https://crrev.com/1993c05386140afe56921048784bf3ca449f4b63/third_party/WebKit/Source/core/layout/LayoutGrid.cpp [modify] https://crrev.com/1993c05386140afe56921048784bf3ca449f4b63/third_party/WebKit/Source/core/layout/LayoutGrid.h [modify] https://crrev.com/1993c05386140afe56921048784bf3ca449f4b63/third_party/WebKit/Source/core/style/GridTrackSize.h
Comment 1 by r...@igalia.com
, Jun 21 2016