Update Alignment shorthands to the spec now that they are not ambiguous
authorjfernandez@igalia.com <jfernandez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Apr 2018 20:06:53 +0000 (20:06 +0000)
committerjfernandez@igalia.com <jfernandez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Apr 2018 20:06:53 +0000 (20:06 +0000)
commitce74b408ac01a02f89c2995edc3c29b9f86daa1a
treee87e1d2261491a80e7775b951f37d596ccaacd91
parentf13ead37690d8b7510b8c0f13d62e54246f37f1d
Update Alignment shorthands to the spec now that they are not ambiguous
https://bugs.webkit.org/show_bug.cgi?id=184812

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

Imported new Web Platform Tests from the css-align test suite.
Additionally, updated the ones we already have to verify the new shorthand syntax is correct.

* resources/import-expectations.json:
* web-platform-tests/css/css-align/OWNERS: Added.
* web-platform-tests/css/css-align/content-distribution/place-content-shorthand-001.html:
* web-platform-tests/css/css-align/content-distribution/place-content-shorthand-002.html:
* web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt:
* web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html:
* web-platform-tests/css/css-align/default-alignment/parse-justify-items-001.html:
* web-platform-tests/css/css-align/default-alignment/parse-justify-items-003.html:
* web-platform-tests/css/css-align/default-alignment/place-items-shorthand-001.html:
* web-platform-tests/css/css-align/default-alignment/place-items-shorthand-002.html:
* web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt:
* web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html:
* web-platform-tests/css/css-align/default-alignment/shorthand-serialization-001-expected.txt: Added.
* web-platform-tests/css/css-align/default-alignment/shorthand-serialization-001.html: Added.
* web-platform-tests/css/css-align/default-alignment/w3c-import.log:
* web-platform-tests/css/css-align/gaps/column-gap-parsing-001-expected.txt:
* web-platform-tests/css/css-align/gaps/column-gap-parsing-001.html:
* web-platform-tests/css/css-align/gaps/gap-normal-computed-001-expected.txt: Added.
* web-platform-tests/css/css-align/gaps/gap-normal-computed-001.html: Added.
* web-platform-tests/css/css-align/gaps/gap-normal-used-001-expected.xht: Added.
* web-platform-tests/css/css-align/gaps/gap-normal-used-001.html: Added.
* web-platform-tests/css/css-align/gaps/gap-normal-used-002-expected.xht: Added.
* web-platform-tests/css/css-align/gaps/gap-normal-used-002.html: Added.
* web-platform-tests/css/css-align/gaps/gap-parsing-001-expected.txt:
* web-platform-tests/css/css-align/gaps/gap-parsing-001.html:
* web-platform-tests/css/css-align/gaps/grid-column-gap-parsing-001-expected.txt:
* web-platform-tests/css/css-align/gaps/grid-column-gap-parsing-001.html:
* web-platform-tests/css/css-align/gaps/grid-gap-parsing-001-expected.txt:
* web-platform-tests/css/css-align/gaps/grid-gap-parsing-001.html:
* web-platform-tests/css/css-align/gaps/grid-row-gap-parsing-001-expected.txt:
* web-platform-tests/css/css-align/gaps/grid-row-gap-parsing-001.html:
* web-platform-tests/css/css-align/gaps/row-gap-parsing-001-expected.txt:
* web-platform-tests/css/css-align/gaps/row-gap-parsing-001.html:
* web-platform-tests/css/css-align/gaps/w3c-import.log:
* web-platform-tests/css/css-align/resources/alignment-parsing-utils.js:
* web-platform-tests/css/css-align/self-alignment/place-self-shorthand-001.html:
* web-platform-tests/css/css-align/self-alignment/place-self-shorthand-002.html:
* web-platform-tests/css/css-align/self-alignment/place-self-shorthand-004-expected.txt:
* web-platform-tests/css/css-align/self-alignment/place-self-shorthand-004.html:
* web-platform-tests/css/css-align/w3c-import.log: Added.

Source/WebCore:

Now that the issue [1] about the syntax ambiguity has been resolved we
don't need to use the custom syntax anymore. The Alignment shorthands
use now the simple syntax, defined based on the longhands' syntax.

Since we allow all the values valid for each longhand, we'll update
in this CL the corresponding web platform tests. Additionally, this CL
updates also the shorthand serialization tests [2], which didn't
consider the new value 'legacy' for justify-items (and place-items) due
to the bug [3] Firefox still has pending to be fixed.

[1] https://github.com/w3c/csswg-drafts/issues/1001
[2] css/css-align/default-alignment/shorthand-serialization-001.html
[3] https://bugzilla.mozilla.org/show_bug.cgi?id=1363875

Tests: imported/w3c/web-platform-tests/css/css-align/default-alignment/shorthand-serialization-001.html
       imported/w3c/web-platform-tests/css/css-align/gaps/gap-normal-computed-001.html
       imported/w3c/web-platform-tests/css/css-align/gaps/gap-normal-used-001.html
       imported/w3c/web-platform-tests/css/css-align/gaps/gap-normal-used-002.html

* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::consumePlaceContentShorthand): Using the justify-content and align-content parsing logic to parse the shorthand.
(WebCore::CSSPropertyParser::consumePlaceItemsShorthand): Using the justify-items and align-items parsing logic to parse the shorthand.
(WebCore::CSSPropertyParser::consumePlaceSelfShorthand): Using the justify-self and align-self parsing logic to parse the shorthand.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230848 268f45cc-cd09-0410-ab3c-d52691b4dbfc
38 files changed:
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/css/css-align/OWNERS [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-align/content-distribution/place-content-shorthand-001-expected.txt
LayoutTests/imported/w3c/web-platform-tests/css/css-align/content-distribution/place-content-shorthand-001.html
LayoutTests/imported/w3c/web-platform-tests/css/css-align/content-distribution/place-content-shorthand-002-expected.txt
LayoutTests/imported/w3c/web-platform-tests/css/css-align/content-distribution/place-content-shorthand-002.html
LayoutTests/imported/w3c/web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt
LayoutTests/imported/w3c/web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html
LayoutTests/imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-justify-items-001-expected.txt
LayoutTests/imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-justify-items-001.html
LayoutTests/imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-justify-items-003-expected.txt
LayoutTests/imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-justify-items-003.html
LayoutTests/imported/w3c/web-platform-tests/css/css-align/default-alignment/place-items-shorthand-001-expected.txt
LayoutTests/imported/w3c/web-platform-tests/css/css-align/default-alignment/place-items-shorthand-001.html
LayoutTests/imported/w3c/web-platform-tests/css/css-align/default-alignment/place-items-shorthand-002-expected.txt
LayoutTests/imported/w3c/web-platform-tests/css/css-align/default-alignment/place-items-shorthand-002.html
LayoutTests/imported/w3c/web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt
LayoutTests/imported/w3c/web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html
LayoutTests/imported/w3c/web-platform-tests/css/css-align/default-alignment/shorthand-serialization-001-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-align/default-alignment/shorthand-serialization-001.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-align/default-alignment/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/css/css-align/gaps/gap-normal-computed-001-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-align/gaps/gap-normal-computed-001.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-align/gaps/gap-normal-used-001-expected.xht [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-align/gaps/gap-normal-used-001.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-align/gaps/gap-normal-used-002-expected.xht [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-align/gaps/gap-normal-used-002.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-align/gaps/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/css/css-align/resources/alignment-parsing-utils.js
LayoutTests/imported/w3c/web-platform-tests/css/css-align/self-alignment/place-self-shorthand-001-expected.txt
LayoutTests/imported/w3c/web-platform-tests/css/css-align/self-alignment/place-self-shorthand-001.html
LayoutTests/imported/w3c/web-platform-tests/css/css-align/self-alignment/place-self-shorthand-002-expected.txt
LayoutTests/imported/w3c/web-platform-tests/css/css-align/self-alignment/place-self-shorthand-002.html
LayoutTests/imported/w3c/web-platform-tests/css/css-align/self-alignment/place-self-shorthand-004-expected.txt
LayoutTests/imported/w3c/web-platform-tests/css/css-align/self-alignment/place-self-shorthand-004.html
LayoutTests/imported/w3c/web-platform-tests/css/css-align/w3c-import.log [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/parser/CSSPropertyParser.cpp