Properties that take <position> should not accept 3 values
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 Oct 2019 20:32:16 +0000 (20:32 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 Oct 2019 20:32:16 +0000 (20:32 +0000)
commitb4f3373d39b2a78bf5e107fe7605e43e2eece382
treef6dedfa6f205c1dabf46dc4c7bcebffbdce0fbcb
parent451d5db44bd0c8ab89bba9e74d385d3abab9d21e
Properties that take <position> should not accept 3 values
https://bugs.webkit.org/show_bug.cgi?id=189142
LayoutTests/imported/w3c:

<rdar://problem/44110851>

Reviewed by Antti Koivisto.

New PASS results.

* web-platform-tests/css/css-images/parsing/gradient-position-invalid-expected.txt:
* web-platform-tests/css/css-images/parsing/object-position-invalid-expected.txt:
* web-platform-tests/css/css-shapes/parsing/shape-outside-invalid-position-expected.txt:

Source/WebCore:

Reviewed by Antti Koivisto.

The resolution in https://github.com/w3c/csswg-drafts/issues/2140 changed the syntax for <position>,
disallowing the 3-value syntax. This is used in object-position, gradients and shapes. background-position
continues to use the old syntax.

Fix CSS parsing accordingly.

Tested by css-images WPT, by shapes tests, and object-position tests.

* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::consumePerspectiveOrigin):
(WebCore::consumeBasicShapeCircle):
(WebCore::consumeBasicShapeEllipse):
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::consumeBackgroundPosition):
(WebCore::CSSPropertyParser::consumeBackgroundShorthand):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::backgroundPositionFromThreeValues):
(WebCore::CSSPropertyParserHelpers::positionFromFourValues):
(WebCore::CSSPropertyParserHelpers::consumePosition):
(WebCore::CSSPropertyParserHelpers::consumeRadialGradient):
(WebCore::CSSPropertyParserHelpers::consumeConicGradient):
(WebCore::CSSPropertyParserHelpers::positionFromThreeOrFourValues): Deleted.
* css/parser/CSSPropertyParserHelpers.h:

LayoutTests:

Reviewed by Antti Koivisto.

Land some FAIL results for these shapes tests. They should get removed when
the css/css-shapes WPT are imported (webkit.org/b/203441), though the WPT
haven't been updated for the new syntax either.

* css3/shapes/shape-outside/values/shape-outside-circle-002-expected.txt:
* css3/shapes/shape-outside/values/shape-outside-circle-004-expected.txt:
* css3/shapes/shape-outside/values/shape-outside-ellipse-002-expected.txt:
* css3/shapes/shape-outside/values/shape-outside-ellipse-004-expected.txt:
* fast/css/object-position/parsing-object-position-expected.txt:
* fast/css/object-position/parsing-object-position.html: Remove the invalid position test.
* fast/shapes/parsing/parsing-shape-outside-expected.txt:
* fast/shapes/parsing/parsing-test-utils.js:  Remove the invalid position tests.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251668 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
LayoutTests/ChangeLog
LayoutTests/css3/shapes/shape-outside/values/shape-outside-circle-002-expected.txt
LayoutTests/css3/shapes/shape-outside/values/shape-outside-circle-004-expected.txt
LayoutTests/css3/shapes/shape-outside/values/shape-outside-ellipse-002-expected.txt
LayoutTests/css3/shapes/shape-outside/values/shape-outside-ellipse-004-expected.txt
LayoutTests/fast/css/object-position/parsing-object-position-expected.txt
LayoutTests/fast/css/object-position/parsing-object-position.html
LayoutTests/fast/shapes/parsing/parsing-shape-outside-expected.txt
LayoutTests/fast/shapes/parsing/parsing-test-utils.js
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/css/css-images/parsing/gradient-position-invalid-expected.txt
LayoutTests/imported/w3c/web-platform-tests/css/css-images/parsing/object-position-invalid-expected.txt
LayoutTests/imported/w3c/web-platform-tests/css/css-shapes/parsing/shape-outside-invalid-position-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/css/parser/CSSPropertyParser.cpp
Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp
Source/WebCore/css/parser/CSSPropertyParserHelpers.h