[webkit-reviews] review granted: [Bug 128980] [CSS Grid Layout] Implementation of the grid-template shorthand. : [Attachment 228512] Implementation of the grid-template shorthand.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Apr 24 16:58:51 PDT 2014


Darin Adler <darin at apple.com> has granted Javier Fernandez
<jfernandez at igalia.com>'s request for review:
Bug 128980: [CSS Grid Layout] Implementation of the grid-template shorthand.
https://bugs.webkit.org/show_bug.cgi?id=128980

Attachment 228512: Implementation of the grid-template shorthand.
https://bugs.webkit.org/attachment.cgi?id=228512&action=review

------- Additional Comments from Darin Adler <darin at apple.com>
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


More information about the webkit-reviews mailing list