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

Issue 18532004: Implement 'grid-template' parsing (Closed)

Created:
7 years, 5 months ago by Julien - ping for review
Modified:
7 years, 4 months ago
Reviewers:
esprehn, ojan
CC:
blink-reviews, eae+blinkwatch, leviw+renderwatch, dglazkov+blink, apavlov+blink_chromium.org, jchaffraix+rendering, darktears, eseidel, esprehn
Visibility:
Public.

Description

Implement 'grid-template' parsing This change makes us recognize grid-template, parse it, store it and return properly to JavaScript. The specification mandates to validate to check that the areas defined by 'grid-template' are rectangular which involves a lot of the CSSParser code. Because validating involves building the grid areas, a new CSSValue was introduced to hold the computed value. Note that we have to track the explicit size of the named grid areas as the named grid areas (".") are not tracked in our HashMap of grid areas. BUG=258092 TEST=fast/css-grid-layout/grid-template-get-set.html Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=155199

Patch Set 1 #

Patch Set 2 : Same change, forgot to update css-properties-as-js-properties.html result #

Total comments: 15

Patch Set 3 : Rebaselined and updated after Ojan's and Elliott's comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+496 lines, -4 lines) Patch
A LayoutTests/fast/css-grid-layout/grid-template-get-set.html View 1 chunk +124 lines, -0 lines 0 comments Download
A LayoutTests/fast/css-grid-layout/grid-template-get-set-expected.txt View 1 chunk +31 lines, -0 lines 0 comments Download
M LayoutTests/webexposed/css-properties-as-js-properties-expected.txt View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/core.gypi View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/css/CSSComputedStyleDeclaration.cpp View 1 2 2 chunks +9 lines, -0 lines 0 comments Download
A Source/core/css/CSSGridTemplateValue.h View 1 2 1 chunk +76 lines, -0 lines 0 comments Download
A Source/core/css/CSSGridTemplateValue.cpp View 1 2 1 chunk +87 lines, -0 lines 0 comments Download
M Source/core/css/CSSParser.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/css/CSSParser-in.cpp View 1 2 3 chunks +80 lines, -0 lines 0 comments Download
M Source/core/css/CSSProperty.cpp View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/css/CSSPropertyNames.in View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/css/CSSValue.h View 1 2 2 chunks +2 lines, -0 lines 0 comments Download
M Source/core/css/CSSValue.cpp View 1 2 4 chunks +8 lines, -0 lines 0 comments Download
M Source/core/css/resolver/StyleBuilderCustom.cpp View 1 2 2 chunks +27 lines, -0 lines 0 comments Download
M Source/core/page/UseCounter.cpp View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M Source/core/rendering/style/GridCoordinate.h View 3 chunks +19 lines, -0 lines 0 comments Download
M Source/core/rendering/style/RenderStyle.h View 1 2 3 chunks +9 lines, -0 lines 0 comments Download
M Source/core/rendering/style/StyleGridData.h View 1 2 3 chunks +8 lines, -1 line 0 comments Download
M Source/core/rendering/style/StyleGridData.cpp View 2 chunks +8 lines, -2 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
Julien - ping for review
7 years, 5 months ago (2013-07-09 00:34:25 UTC) #1
Julien - ping for review
Any taker for this CSS parsing change. Maybe ojan?
7 years, 4 months ago (2013-07-29 20:49:20 UTC) #2
ojan
lgtm Sorry it took so long to get to this. The size of the patch ...
7 years, 4 months ago (2013-07-29 23:03:28 UTC) #3
esprehn
There's an operator for comparing strings with chars so you don't need that extra static. ...
7 years, 4 months ago (2013-07-29 23:27:36 UTC) #4
Julien - ping for review
https://codereview.chromium.org/18532004/diff/3001/Source/core/css/CSSGridTemplateValue.cpp File Source/core/css/CSSGridTemplateValue.cpp (right): https://codereview.chromium.org/18532004/diff/3001/Source/core/css/CSSGridTemplateValue.cpp#newcode76 Source/core/css/CSSGridTemplateValue.cpp:76: builder.append('\''); On 2013/07/29 23:03:28, ojan wrote: > Does the ...
7 years, 4 months ago (2013-07-30 18:43:33 UTC) #5
ojan
Tab, a couple spec things for your consideration... https://codereview.chromium.org/18532004/diff/3001/Source/core/css/CSSGridTemplateValue.cpp File Source/core/css/CSSGridTemplateValue.cpp (right): https://codereview.chromium.org/18532004/diff/3001/Source/core/css/CSSGridTemplateValue.cpp#newcode76 Source/core/css/CSSGridTemplateValue.cpp:76: builder.append('\''); ...
7 years, 4 months ago (2013-07-30 18:53:48 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jchaffraix@chromium.org/18532004/15001
7 years, 4 months ago (2013-07-30 21:37:20 UTC) #7
commit-bot: I haz the power
Change committed as 155199
7 years, 4 months ago (2013-07-31 01:38:41 UTC) #8
TabAtkins
7 years, 4 months ago (2013-07-31 16:56:22 UTC) #9
Message was sent while issue was closed.
On 2013/07/30 18:53:48, ojan wrote:
> Tab, a couple spec things for your consideration...
> 
>
https://codereview.chromium.org/18532004/diff/3001/Source/core/css/CSSGridTem...
> File Source/core/css/CSSGridTemplateValue.cpp (right):
> 
>
https://codereview.chromium.org/18532004/diff/3001/Source/core/css/CSSGridTem...
> Source/core/css/CSSGridTemplateValue.cpp:76: builder.append('\'');
> On 2013/07/30 18:43:33, Julien Chaffraix wrote:
> > On 2013/07/29 23:03:28, ojan wrote:
> > > Does the spec cover whether to serialize with single or double quotes?
> > 
> > The spec doesn't say anything about that. We accept <string> so either is
> fine.
> 
> I'd like the spec to be explicit. Don't need to block this patch on it, but a
> FIXME would be nice. Incompatibilities between browsers on whether they
> serialize using single or double quotes with fonts has been a huge pain for
web
> developers.

CSS in general doesn't specify this yet.  It's a bad problem.

We should already have code that serializes these basic data types, right?  That
said, use double quotes.

>
https://codereview.chromium.org/18532004/diff/3001/Source/core/css/CSSParser-...
> File Source/core/css/CSSParser-in.cpp (right):
> 
>
https://codereview.chromium.org/18532004/diff/3001/Source/core/css/CSSParser-...
> Source/core/css/CSSParser-in.cpp:4752: gridRowNames.split(' ', columnNames);
> On 2013/07/30 18:43:33, Julien Chaffraix wrote:
> > On 2013/07/29 23:03:28, ojan wrote:
> > > Does the spec say what to do if there are multiple spaces in a row?
> > 
> > Not explicitly (the grammar is <string>+). It would be dumb not to squash /
> > ignore multiple spaces in a row though as it would prevent doing a nice
ASCII
> > art representation of the grid.
> 
> Makes sense to me. We should make the spec explicit if possible.

The CSS parsing spec <http://dev.w3.org/csswg/css-syntax/> squashes whitespace.

Powered by Google App Engine
This is Rietveld 408576698