Bug 108397 - [CSS Grid Layout] Add parsing for grid-auto-flow
Summary: [CSS Grid Layout] Add parsing for grid-auto-flow
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Julien Chaffraix
URL:
Keywords:
Depends on:
Blocks: 103316
  Show dependency treegraph
 
Reported: 2013-01-30 15:59 PST by Julien Chaffraix
Modified: 2013-02-04 11:16 PST (History)
9 users (show)

See Also:


Attachments
Proposed change I. (20.12 KB, patch)
2013-01-30 16:12 PST, Julien Chaffraix
no flags Details | Formatted Diff | Diff
Proposed change II: won't commit it until next week to wait for some spec update. (20.68 KB, patch)
2013-02-01 10:11 PST, Julien Chaffraix
no flags Details | Formatted Diff | Diff
Patch for landing (20.36 KB, patch)
2013-02-04 10:21 PST, Julien Chaffraix
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Julien Chaffraix 2013-01-30 15:59:38 PST
As a first step into supporting the auto-placement algorithm specified in the specification, we need to be able to parse and apply grid-auto-flow. See http://dev.w3.org/csswg/css3-grid-layout/#grid-auto-flow-property for the details.

Patch forthcoming.
Comment 1 Julien Chaffraix 2013-01-30 16:12:42 PST
Created attachment 185610 [details]
Proposed change I.
Comment 2 Tony Chang 2013-01-31 10:04:46 PST
Comment on attachment 185610 [details]
Proposed change I.

View in context: https://bugs.webkit.org/attachment.cgi?id=185610&action=review

> Source/WebCore/css/CSSParser.cpp:2520
> +    case CSSPropertyWebkitGridAutoFlow:
> +        if (id == CSSValueNone || id == CSSValueRows || id == CSSValueColumns)
> +            validPrimitive = true;
> +        break;

I think this should go in isValidKeywordPropertyAndValue.

> Source/WebCore/css/CSSPrimitiveValueMappings.h:4117
> +

Remove this extra blank line.

> Source/WebCore/css/CSSValueKeywords.in:1005
> +// -webkit-grid-auto-flow
> +// none
> +columns
> +rows

Can you ask on www-style if we can make these column/row to match flex-flow?  It's OK to check this in, but we shouldn't make web devs have to think whether the values need to be plural or not.

> Source/WebCore/rendering/style/RenderStyleConstants.h:494
> +enum GridAutoFlow {
> +    AutoFlowNone,
> +    AutoFlowColumns,
> +    AutoFlowRows
> +};

Nit: Should this be on one line like many of the other enums?

> LayoutTests/fast/css-grid-layout/grid-auto-flow-get-set.html:19
> +.gridAutoFlowNone {
> +    -webkit-grid-auto-flow: none;
> +}
> +.gridAutoFlowColumns {
> +    -webkit-grid-auto-flow: columns;
> +}
> +.gridAutoFlowRows {
> +    -webkit-grid-auto-flow: rows;
> +}
> +.gridAutoFlowInherit {

Can we move these into resources/grid.css?
Comment 3 Julien Chaffraix 2013-01-31 11:20:13 PST
Comment on attachment 185610 [details]
Proposed change I.

View in context: https://bugs.webkit.org/attachment.cgi?id=185610&action=review

>> Source/WebCore/css/CSSValueKeywords.in:1005
>> +rows
> 
> Can you ask on www-style if we can make these column/row to match flex-flow?  It's OK to check this in, but we shouldn't make web devs have to think whether the values need to be plural or not.

Asked on www-style: http://lists.w3.org/Archives/Public/www-style/2013Jan/0634.html

>> Source/WebCore/rendering/style/RenderStyleConstants.h:494
>> +};
> 
> Nit: Should this be on one line like many of the other enums?

This is not our usual style to put everything on one line, but nothing matches our usual style in RenderStyleConstants :(

>> LayoutTests/fast/css-grid-layout/grid-auto-flow-get-set.html:19
>> +.gridAutoFlowInherit {
> 
> Can we move these into resources/grid.css?

SGTM, only the valid values above though, I don't see much use in sharing the wrong values.
Comment 4 Julien Chaffraix 2013-02-01 10:11:34 PST
Created attachment 186071 [details]
Proposed change II: won't commit it until next week to wait for some spec update.
Comment 5 Ojan Vafai 2013-02-01 10:54:55 PST
Comment on attachment 186071 [details]
Proposed change II: won't commit it until next week to wait for some spec update.

Seems fine. Don't think we need to block on the spec discussion. We can always change the names of the values later if the spec changes differently than how we expect.
Comment 6 Tony Chang 2013-02-01 11:07:22 PST
Comment on attachment 186071 [details]
Proposed change II: won't commit it until next week to wait for some spec update.

View in context: https://bugs.webkit.org/attachment.cgi?id=186071&action=review

> LayoutTests/fast/css-grid-layout/resources/grid-auto-flow-get-set.js:4
> +description('Test that setting and getting grid-auto-flow works as expected');
> +
> +debug("Test getting -webkit-auto-flow set through CSS");
> +var gridAutoFlowNone = document.getElementById("gridAutoFlowNone");

Nit: I would inline this in the test file. It seems unlikely that we're going to reuse this .js file and it's not a pure js test.
Comment 7 Build Bot 2013-02-01 14:08:18 PST
Comment on attachment 186071 [details]
Proposed change II: won't commit it until next week to wait for some spec update.

Attachment 186071 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/16336087
Comment 8 Ojan Vafai 2013-02-01 20:56:49 PST
Comment on attachment 186071 [details]
Proposed change II: won't commit it until next week to wait for some spec update.

View in context: https://bugs.webkit.org/attachment.cgi?id=186071&action=review

>> LayoutTests/fast/css-grid-layout/resources/grid-auto-flow-get-set.js:4
>> +var gridAutoFlowNone = document.getElementById("gridAutoFlowNone");
> 
> Nit: I would inline this in the test file. It seems unlikely that we're going to reuse this .js file and it's not a pure js test.

+1 external files in tests are always a pain to maintain.
Comment 9 Julien Chaffraix 2013-02-04 10:17:05 PST
Comment on attachment 186071 [details]
Proposed change II: won't commit it until next week to wait for some spec update.

View in context: https://bugs.webkit.org/attachment.cgi?id=186071&action=review

> Don't think we need to block on the spec discussion. We can always change the names of the values later if the spec changes differently than how we expect.

That was because the W3C F2F is going on right now and grid layout will be discussed (also Tab / fantasai took over the editorship) so this week will be rocky.

>>> LayoutTests/fast/css-grid-layout/resources/grid-auto-flow-get-set.js:4
>>> +var gridAutoFlowNone = document.getElementById("gridAutoFlowNone");
>> 
>> Nit: I would inline this in the test file. It seems unlikely that we're going to reuse this .js file and it's not a pure js test.
> 
> +1 external files in tests are always a pain to maintain.

Fair enough.
Comment 10 Julien Chaffraix 2013-02-04 10:21:30 PST
Created attachment 186413 [details]
Patch for landing
Comment 11 WebKit Review Bot 2013-02-04 11:15:55 PST
Comment on attachment 186413 [details]
Patch for landing

Clearing flags on attachment: 186413

Committed r141787: <http://trac.webkit.org/changeset/141787>
Comment 12 WebKit Review Bot 2013-02-04 11:16:00 PST
All reviewed patches have been landed.  Closing bug.