[CSS Grid Layout] Align the grid track code with the specification's production rules
authorjchaffraix@webkit.org <jchaffraix@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Nov 2012 23:59:55 +0000 (23:59 +0000)
committerjchaffraix@webkit.org <jchaffraix@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Nov 2012 23:59:55 +0000 (23:59 +0000)
commit63067d8ec19b5a7c0c1058885a7c5fc0c31f6918
treec3cd0452bbdf0cc3dea99ba85169f6857fb1975f
parent7df2c099083c1baab1d230ccec02de686ccddc14
[CSS Grid Layout] Align the grid track code with the specification's production rules
https://bugs.webkit.org/show_bug.cgi?id=103703

Reviewed by Alexis Menard.

In order to support more of the syntax and make the code more readable, this change
splits following the grammar's production rules (see
http://dev.w3.org/csswg/css3-grid-layout/#grid-definition-columns-and-grid-definit).

Refactoring covered by existing tests.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForGridTrackMinMax):
(WebCore::valueForGridTrackGroup):
(WebCore::valueForGridTrackList):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseGridTrackList):
(WebCore::CSSParser::parseGridTrackGroup):
(WebCore::CSSParser::parseGridTrackMinMax):
* css/CSSParser.h:
* css/StyleResolver.cpp:
(WebCore::createGridTrackMinMax):
(WebCore::createGridTrackGroup):
(WebCore::createGridTrackList):
Mechanical split of the parsing, resolving and computed style code into
<track-list>, <track-group>, <track-minmax> and <track-breadth> parts.

* css/CSSParser.cpp:
(WebCore::CSSParser::parseGridBreadth):
Changed this function to just parse a single value (without any extra logic).

* css/StyleResolver.cpp:
(WebCore::createGridTrackBreadth):
Changed this function to take a Length as it is used to parse a <track-breadth>.
The goal is for it to be the low-level function createGridTrackMinmax will call on
each function parameter.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136294 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSParser.h
Source/WebCore/css/StyleResolver.cpp