Bug 128980 - [CSS Grid Layout] Implementation of the grid-template shorthand.
Summary: [CSS Grid Layout] Implementation of the grid-template shorthand.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 129041
Blocks: 127987 132122
  Show dependency treegraph
 
Reported: 2014-02-18 10:02 PST by Javier Fernandez
Modified: 2014-04-25 09:44 PDT (History)
12 users (show)

See Also:


Attachments
Implementation of the grid-template shorthand. (57.83 KB, patch)
2014-04-03 09:28 PDT, Javier Fernandez
no flags Details | Formatted Diff | Diff
Applied suggested changes. (57.86 KB, patch)
2014-04-25 03:14 PDT, Javier Fernandez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Javier Fernandez 2014-02-18 10:02:37 PST
The grid-template property is a shorthand for setting grid-template-columns, grid-template-rows, and grid-template-areas in a single declaration.
Comment 1 Javier Fernandez 2014-04-03 09:28:13 PDT
Created attachment 228512 [details]
Implementation of the grid-template shorthand.
Comment 2 WebKit Commit Bot 2014-04-03 09:29:52 PDT
Attachment 228512 [details] did not pass style-queue:


ERROR: Source/WebCore/css/CSSParser.cpp:5266:  Wrong number of spaces before statement. (expected: 24)  [whitespace/indent] [4]
Total errors found: 1 in 12 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Javier Fernandez 2014-04-03 09:32:39 PDT
(In reply to comment #2)
> Attachment 228512 [details] did not pass style-queue:
> 
> 
> ERROR: Source/WebCore/css/CSSParser.cpp:5266:  Wrong number of spaces before statement. (expected: 24)  [whitespace/indent] [4]
> Total errors found: 1 in 12 files
> 
> 
> If any of these errors are false positives, please file a bug against check-webkit-style.

I think this issue is already addressed in bug #128751
Comment 4 Darin Adler 2014-04-24 16:59:13 PDT
Comment on attachment 228512 [details]
Implementation of the grid-template shorthand.

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

> Source/WebCore/css/CSSParser.cpp:4809
> +    size_t rowCount = 0;
> +    size_t columnCount = 0;

size_t seems like overkill for these. I don’t think we handle those kinds of huge row and column counts. Why not just “unsigned”?

> Source/WebCore/css/CSSParser.cpp:4811
> +    RefPtr<CSSValueList> templateRows = CSSValueList::createSpaceSeparated();

Why create this just before an early return? I suggest moving this declaration down.

> Source/WebCore/css/CSSParser.cpp:4817
> +    while (m_valueList->current()) {

could write this as a do/while to avoid the redundant check at the start of the loop

> Source/WebCore/css/CSSParser.cpp:4837
> +            templateRows->append(value);

value.release() would avoid a bit of reference count churn

> Source/WebCore/css/CSSParser.cpp:4853
> +        addProperty(CSSPropertyWebkitGridTemplateColumns,  cssValuePool().createIdentifierValue(CSSValueNone), important);

Extra space here after the comma.

> Source/WebCore/css/CSSParser.cpp:4895
> +            addProperty(CSSPropertyWebkitGridTemplateColumns, columnsValue, important);

columnsValue.release()

> Source/WebCore/css/CSSParser.cpp:4896
> +            addProperty(CSSPropertyWebkitGridTemplateRows, rowsValue, important);

rowsValue.release()

> Source/WebCore/css/CSSParser.cpp:5029
> +    return values;

values.release()

> Source/WebCore/css/CSSParser.cpp:5273
> +    if (!gridRowNames.length())

isEmpty is preferred over !length

> Source/WebCore/css/CSSParser.cpp:5296
> +        for (lookAheadColumn = currentColumn; lookAheadColumn < (columnCount - 1); ++lookAheadColumn) {

Parentheses here don’t make the code clearer. I suggest omitting them.

> Source/WebCore/css/CSSParser.h:50
> +
> +

Extra space here. Just one blank line will do.

> Source/WebCore/css/CSSParser.h:77
> +#if ENABLE(CSS_GRID_LAYOUT)
> +class CSSGridLineNamesValue;
> +#endif

Not really helpful to put forward declarations inside an #if. I suggest just declaring this unconditionally.

> Source/WebCore/css/CSSParser.h:178
> +    void parseGridLineNames(CSSParserValueList&, CSSValueList&, CSSGridLineNamesValue* = 0);

nullptr
Comment 5 Javier Fernandez 2014-04-25 03:14:19 PDT
Created attachment 230158 [details]
Applied suggested changes.
Comment 6 WebKit Commit Bot 2014-04-25 03:19:05 PDT
Attachment 230158 [details] did not pass style-queue:


ERROR: Source/WebCore/css/CSSParser.cpp:5265:  Wrong number of spaces before statement. (expected: 24)  [whitespace/indent] [4]
Total errors found: 1 in 12 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Javier Fernandez 2014-04-25 03:32:38 PDT
(In reply to comment #6)
> Attachment 230158 [details] did not pass style-queue:
> 
> 
> ERROR: Source/WebCore/css/CSSParser.cpp:5265:  Wrong number of spaces before statement. (expected: 24)  [whitespace/indent] [4]
> Total errors found: 1 in 12 files
> 
> 
> If any of these errors are false positives, please file a bug against check-webkit-style.

I think this issue is already addressed in bug #128751
Comment 8 WebKit Commit Bot 2014-04-25 05:07:21 PDT
Comment on attachment 230158 [details]
Applied suggested changes.

Clearing flags on attachment: 230158

Committed r167799: <http://trac.webkit.org/changeset/167799>
Comment 9 WebKit Commit Bot 2014-04-25 05:07:27 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Javier Fernandez 2014-04-25 07:05:30 PDT
This broke the Debug build. fixing it in bug #132194.
Comment 11 Javier Fernandez 2014-04-25 09:44:49 PDT
This broke the Debug build. fixing it in bug #132197