[CSS Grid Layout] Fix grid-template-areas parsing to avoid spaces
authorrego@igalia.com <rego@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Jun 2015 21:01:17 +0000 (21:01 +0000)
committerrego@igalia.com <rego@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Jun 2015 21:01:17 +0000 (21:01 +0000)
commita14cc73fa766b6b21e0bc0acb0e56655c366c203
tree241a862b9aa4fef868a80c4b8111705884116986
parentc6a749ee41938573b551234a7d44df23c2f31f7a
[CSS Grid Layout] Fix grid-template-areas parsing to avoid spaces
https://bugs.webkit.org/show_bug.cgi?id=145860

Reviewed by Sergio Villar Senin.

Source/WebCore:

The spec doesn't require to have spaces between unnamed and named areas
in grid-template-areas syntax. But spaces are currently required in our
code.

This was confirmed in the CSS WG mailing list:
https://lists.w3.org/Archives/Public/www-style/2015May/0239.html

This patch updates grid-template-areas parsing to allow the possibility
of removing spaces between unnamed and named areas.

Added new cases to fast/css-grid-layout/grid-template-areas-get-set.html.

* css/CSSParser.cpp:
(WebCore::parseGridTemplateAreasColumnNames): New helper method to
determine the column names split by white spaces or dots.
(WebCore::CSSParser::parseGridTemplateAreasRow): Use the new helper
method to get the column names.
(WebCore::containsOnlyDots): Deleted. Not needed anymore as
parseGridTemplateAreasColumnNames() is using a single dot for unnamed
grid areas (despite of being defined with 1 or more dots).

LayoutTests:

* fast/css-grid-layout/grid-template-areas-get-set-expected.txt:
* fast/css-grid-layout/grid-template-areas-get-set.html: Add new test
cases.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185520 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css-grid-layout/grid-template-areas-get-set-expected.txt
LayoutTests/fast/css-grid-layout/grid-template-areas-get-set.html
Source/WebCore/ChangeLog
Source/WebCore/css/CSSParser.cpp