Negative radii in radial gradients should be rejected.
authorjh718.park@samsung.com <jh718.park@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Oct 2019 17:30:16 +0000 (17:30 +0000)
committerjh718.park@samsung.com <jh718.park@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Oct 2019 17:30:16 +0000 (17:30 +0000)
commit2b54303c10a2acc785cc2a79117c868ab263944a
tree4a66befaa85ed31b55ef920a3b4078d3f654273c
parent0ad4898628aedeaa436577524bafd94145dab172
Negative radii in radial gradients should be rejected.
https://bugs.webkit.org/show_bug.cgi?id=202412

Per the spec, https://drafts.csswg.org/css-images-3/#radial-gradients
"Negative values are invalid.",
we reject negative radii values in radial-gradient.

This patch rejects negative radii during radial-gradient parsing
for both webkit prefixed and non-prefixed ones.

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

* web-platform-tests/compat/webkit-radial-gradient-radii-expected.txt: Added.
* web-platform-tests/compat/webkit-radial-gradient-radii.html: Added.
* web-platform-tests/css/css-backgrounds/parsing/background-image-invalid-expected.txt: Added.
* web-platform-tests/css/css-backgrounds/parsing/background-image-invalid.html: Added.

Source/WebCore:

Tests: imported/blink/css-parser/webkit-gradient.html
       imported/w3c/web-platform-tests/compat/webkit-radial-gradient-radii.html
       imported/w3c/web-platform-tests/css/css-backgrounds/parsing/background-image-invalid.html

* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradient):
(WebCore::CSSPropertyParserHelpers::consumeDeprecatedRadialGradient):
(WebCore::CSSPropertyParserHelpers::consumeRadialGradient):

LayoutTests:

* imported/blink/css-parser/webkit-gradient-expected.txt: Added.
* imported/blink/css-parser/webkit-gradient.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250730 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/imported/blink/css-parser/webkit-gradient-expected.txt [new file with mode: 0644]
LayoutTests/imported/blink/css-parser/webkit-gradient.html [new file with mode: 0644]
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/compat/webkit-radial-gradient-radii-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/compat/webkit-radial-gradient-radii.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/parsing/background-image-invalid-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/parsing/background-image-invalid.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp