Accept 8 and 4 value hex colors (#RRGGBBAA)
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Nov 2015 17:49:46 +0000 (17:49 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Nov 2015 17:49:46 +0000 (17:49 +0000)
commit2d7bda2b0cebd8a96a36bce03a9ca51ad509e179
tree0a236f9c3dc0e93bd52670f3456b1dfc3a8f838e
parentdafb44eeef0e9300369d048bce44240fa902c318
Accept 8 and 4 value hex colors (#RRGGBBAA)
https://bugs.webkit.org/show_bug.cgi?id=150853
<rdar://problem/23380930>

Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

Delete these tests. The have been updated in the original repository,
so we'll get the new versions soon. Meanwhile, they are covered by
other tests.

* canvas/2d.fillStyle.parse.invalid.hex4-expected.txt: Removed.
* canvas/2d.fillStyle.parse.invalid.hex4.html: Removed.
* canvas/2d.fillStyle.parse.invalid.hex8-expected.txt: Removed.
* canvas/2d.fillStyle.parse.invalid.hex8.html: Removed.
* css/css-color-3/t421-rgb-hex-parsing-f.xht:

Source/WebCore:

CSS Color Level 4 allows #RGBA and #RRGGBBAA values
for colors.

Test: fast/css/hex-colors.html

* platform/graphics/Color.cpp:
(WebCore::parseHexColorInternal): Update the color parsing for
the new syntax.

LayoutTests:

Add a new test for hex colors that covers 4 and 8 value forms.
Also update existing tests now that the syntax has changed.

For the deleted philip tests, they are now in the W3C web-latform-tests import.

* canvas/philip/tests/2d.fillStyle.parse.invalid.hex4-expected.txt: Removed.
* canvas/philip/tests/2d.fillStyle.parse.invalid.hex4.html: Removed.
* canvas/philip/tests/2d.fillStyle.parse.invalid.hex8-expected.txt: Removed.
* canvas/philip/tests/2d.fillStyle.parse.invalid.hex8.html: Removed.
* fast/css/hex-colors-expected.txt: Added.
* fast/css/hex-colors.html: Added.
* fast/css/invalid-hex-color-expected.txt:
* fast/css/invalid-hex-color.html:
* fast/css/invalid-predefined-color-expected.txt:
* fast/css/invalid-predefined-color.html:
* fast/css/script-tests/invalid-predefined-color.js:
* fast/dom/attribute-legacy-colors-expected.txt:
* fast/dom/script-tests/attribute-legacy-colors.js:
* svg/dom/rgb-color-parser-expected.txt:
* svg/dom/rgb-color-parser.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192023 268f45cc-cd09-0410-ab3c-d52691b4dbfc
24 files changed:
LayoutTests/ChangeLog
LayoutTests/canvas/philip/tests/2d.fillStyle.parse.invalid.hex4-expected.txt [deleted file]
LayoutTests/canvas/philip/tests/2d.fillStyle.parse.invalid.hex4.html [deleted file]
LayoutTests/canvas/philip/tests/2d.fillStyle.parse.invalid.hex8-expected.txt [deleted file]
LayoutTests/canvas/philip/tests/2d.fillStyle.parse.invalid.hex8.html [deleted file]
LayoutTests/fast/css/hex-colors-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/hex-colors.html [new file with mode: 0644]
LayoutTests/fast/css/invalid-hex-color-expected.txt
LayoutTests/fast/css/invalid-hex-color.html
LayoutTests/fast/css/invalid-predefined-color-expected.txt
LayoutTests/fast/css/invalid-predefined-color.html
LayoutTests/fast/css/script-tests/invalid-predefined-color.js
LayoutTests/fast/dom/attribute-legacy-colors-expected.txt
LayoutTests/fast/dom/script-tests/attribute-legacy-colors.js
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/canvas/2d.fillStyle.parse.invalid.hex4-expected.txt [deleted file]
LayoutTests/imported/w3c/canvas/2d.fillStyle.parse.invalid.hex4.html [deleted file]
LayoutTests/imported/w3c/canvas/2d.fillStyle.parse.invalid.hex8-expected.txt [deleted file]
LayoutTests/imported/w3c/canvas/2d.fillStyle.parse.invalid.hex8.html [deleted file]
LayoutTests/imported/w3c/css/css-color-3/t421-rgb-hex-parsing-f.xht
LayoutTests/svg/dom/rgb-color-parser-expected.txt
LayoutTests/svg/dom/rgb-color-parser.html
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/Color.cpp