Implement currentColor support for CSS gradients
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 1 Oct 2011 01:43:20 +0000 (01:43 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 1 Oct 2011 01:43:20 +0000 (01:43 +0000)
commit02bf4544dfd31b1c97c46184e1e52ee4c066e647
tree591cdab315b8e249ee7baa8ca4bef2a2bf9a0bca
parenta19d1d3d611d3bab66e54ae245163c4b583806d5
Implement currentColor support for CSS gradients
https://bugs.webkit.org/show_bug.cgi?id=58730

Patch by David Barr <davidbarr@chromium.org> on 2011-09-30
Reviewed by Adam Barth.

Source/WebCore:

Allow currentColor as a CSS3 gradient color-stop.

Test: fast/css/linear-gradient-currentcolor.html

* css/CSSGradientValue.cpp:
(WebCore::CSSGradientValue::isCacheable): Make currentColor uncacheable since the
background image may be invalidated if currentColor is used as a gradient stop and
the value of the 'color' property changes.
* css/CSSParser.cpp:
(WebCore::parseGradientColorOrKeyword): Accept the currentColor keyword.
* rendering/style/StyleGeneratedImage.cpp:
(WebCore::StyleGeneratedImage::image): Initialize document styleSelector so that
currentColor may be computed for a StyleGeneratedImage.

LayoutTests:

* fast/css/linear-gradient-currentcolor-expected.txt: Added.
* fast/css/linear-gradient-currentcolor.html: Added.
* platform/chromium/test_expectations.txt:
* platform/mac/fast/css/linear-gradient-currentcolor-expected.png: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@96449 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css/linear-gradient-currentcolor-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/linear-gradient-currentcolor.html [new file with mode: 0644]
LayoutTests/platform/chromium/test_expectations.txt
LayoutTests/platform/mac/fast/css/linear-gradient-currentcolor-expected.png [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSGradientValue.cpp
Source/WebCore/css/CSSParser.cpp
Source/WebCore/rendering/style/StyleGeneratedImage.cpp