WebCore: Fix for <rdar://problem/6942706> ER: Add a CSS property that allows
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Oct 2009 23:34:16 +0000 (23:34 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Oct 2009 23:34:16 +0000 (23:34 +0000)
commit7e027f30d79cb820464f237375e067611c249f00
tree8e699e38ccf78548ffdf0547427670871bcc8b06
parentc0e506e1c84277869ad803f40a1fa3b4fc9728a6
WebCore: Fix for <rdar://problem/6942706> ER: Add a CSS property that allows
shadows to work for SVG content
-and corresponding-
https://bugs.webkit.org/show_bug.cgi?id=30479

Reviewed by Dan Bernstein.

This patch adds a new SVG-specific CSS property called -webkit-
shadow that has the same syntax as -webkit-box-shadow

Add CSSPropertyWebkitShadow to the list of SVG CSS properties, and
make valueForShadow a member function rather than a static function
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::):
(WebCore::CSSComputedStyleDeclaration::valueForShadow):
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/CSSComputedStyleDeclaration.h:

Call valueForShadow for CSSPropertyWebkitShadow
* css/SVGCSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getSVGPropertyCSSValue):

Do standard CSS stuff for CSSPropertyWebkitShadow
* css/SVGCSSParser.cpp:
(WebCore::CSSParser::parseSVGValue):
* css/SVGCSSPropertyNames.in:
* css/SVGCSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::applySVGProperty):

Set the appropriate shadow on the paint context if we have one.
This seems to be all we have to do to have an SVG-shaped shadow.
* rendering/SVGRenderSupport.cpp:
(WebCore::SVGRenderBase::prepareToRenderSVGContent):

Add shadow to SVGRenderStyle. I added a new macro that I don't like
just because that's the way things are done here right now.
* rendering/style/SVGRenderStyle.cpp:
(WebCore::SVGRenderStyle::SVGRenderStyle):
(WebCore::SVGRenderStyle::operator==):
* rendering/style/SVGRenderStyle.h:
* rendering/style/SVGRenderStyleDefs.cpp:
(StyleShadowSVGData::StyleShadowSVGData):
(StyleShadowSVGData::operator==):
* rendering/style/SVGRenderStyleDefs.h:
(WebCore::StyleShadowSVGData::create):
(WebCore::StyleShadowSVGData::copy):
(WebCore::StyleShadowSVGData::operator!=):

LayoutTests: Tests for <rdar://problem/6942706> ER: Add a CSS property that
allows shadows to work for SVG content
-and corresponding-
https://bugs.webkit.org/show_bug.cgi?id=30479

Reviewed by Dan Bernstein.

New results that include -webkit-shadow:
* platform/mac/fast/css/getComputedStyle/computed-style-expected.txt:
* platform/mac/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:

New tests and their results.
* platform/mac/svg/css/arrow-with-shadow-expected.checksum: Added.
* platform/mac/svg/css/arrow-with-shadow-expected.png: Added.
* platform/mac/svg/css/arrow-with-shadow-expected.txt: Added.
* platform/mac/svg/css/circle-in-mask-with-shadow-expected.checksum: Added.
* platform/mac/svg/css/circle-in-mask-with-shadow-expected.png: Added.
* platform/mac/svg/css/circle-in-mask-with-shadow-expected.txt: Added.
* platform/mac/svg/css/clippath-with-shadow-expected.checksum: Added.
* platform/mac/svg/css/clippath-with-shadow-expected.png: Added.
* platform/mac/svg/css/clippath-with-shadow-expected.txt: Added.
* platform/mac/svg/css/group-with-shadow-expected.checksum: Added.
* platform/mac/svg/css/group-with-shadow-expected.png: Added.
* platform/mac/svg/css/group-with-shadow-expected.txt: Added.
* platform/mac/svg/css/mask-with-shadow-expected.checksum: Added.
* platform/mac/svg/css/mask-with-shadow-expected.png: Added.
* platform/mac/svg/css/mask-with-shadow-expected.txt: Added.
* platform/mac/svg/css/path-with-shadow-expected.checksum: Added.
* platform/mac/svg/css/path-with-shadow-expected.png: Added.
* platform/mac/svg/css/path-with-shadow-expected.txt: Added.
* platform/mac/svg/css/stars-with-shadow-expected.checksum: Added.
* platform/mac/svg/css/stars-with-shadow-expected.png: Added.
* platform/mac/svg/css/stars-with-shadow-expected.txt: Added.
* platform/mac/svg/filters/shadow-on-filter-expected.checksum: Added.
* platform/mac/svg/filters/shadow-on-filter-expected.png: Added.
* platform/mac/svg/filters/shadow-on-filter-expected.txt: Added.
* platform/mac/svg/filters/shadow-on-rect-with-filter-expected.checksum: Added.
* platform/mac/svg/filters/shadow-on-rect-with-filter-expected.png: Added.
* platform/mac/svg/filters/shadow-on-rect-with-filter-expected.txt: Added.
* svg/css/arrow-with-shadow.svg: Added.
* svg/css/circle-in-mask-with-shadow.svg: Added.
* svg/css/clippath-with-shadow.svg: Added.
* svg/css/getComputedStyle-basic-expected.txt:
* svg/css/group-with-shadow.svg: Added.
* svg/css/mask-with-shadow.svg: Added.
* svg/css/path-with-shadow.svg: Added.
* svg/css/stars-with-shadow.html: Added.
* svg/filters/shadow-on-filter.svg: Added.
* svg/filters/shadow-on-rect-with-filter.svg: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@49959 268f45cc-cd09-0410-ab3c-d52691b4dbfc
53 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac/fast/css/getComputedStyle/computed-style-expected.txt
LayoutTests/platform/mac/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt
LayoutTests/platform/mac/svg/css/arrow-with-shadow-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/svg/css/arrow-with-shadow-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/svg/css/arrow-with-shadow-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/svg/css/circle-in-mask-with-shadow-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/svg/css/circle-in-mask-with-shadow-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/svg/css/circle-in-mask-with-shadow-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/svg/css/clippath-with-shadow-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/svg/css/clippath-with-shadow-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/svg/css/clippath-with-shadow-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/svg/css/group-with-shadow-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/svg/css/group-with-shadow-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/svg/css/group-with-shadow-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/svg/css/mask-with-shadow-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/svg/css/mask-with-shadow-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/svg/css/mask-with-shadow-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/svg/css/path-with-shadow-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/svg/css/path-with-shadow-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/svg/css/path-with-shadow-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/svg/css/stars-with-shadow-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/svg/css/stars-with-shadow-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/svg/css/stars-with-shadow-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/svg/filters/shadow-on-filter-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/svg/filters/shadow-on-filter-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/svg/filters/shadow-on-filter-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/svg/filters/shadow-on-rect-with-filter-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/svg/filters/shadow-on-rect-with-filter-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/svg/filters/shadow-on-rect-with-filter-expected.txt [new file with mode: 0644]
LayoutTests/svg/css/arrow-with-shadow.svg [new file with mode: 0644]
LayoutTests/svg/css/circle-in-mask-with-shadow.svg [new file with mode: 0644]
LayoutTests/svg/css/clippath-with-shadow.svg [new file with mode: 0644]
LayoutTests/svg/css/getComputedStyle-basic-expected.txt
LayoutTests/svg/css/group-with-shadow.svg [new file with mode: 0644]
LayoutTests/svg/css/mask-with-shadow.svg [new file with mode: 0644]
LayoutTests/svg/css/path-with-shadow.svg [new file with mode: 0644]
LayoutTests/svg/css/stars-with-shadow.html [new file with mode: 0644]
LayoutTests/svg/filters/shadow-on-filter.svg [new file with mode: 0644]
LayoutTests/svg/filters/shadow-on-rect-with-filter.svg [new file with mode: 0644]
WebCore/ChangeLog
WebCore/css/CSSComputedStyleDeclaration.cpp
WebCore/css/CSSComputedStyleDeclaration.h
WebCore/css/CSSParser.cpp
WebCore/css/SVGCSSComputedStyleDeclaration.cpp
WebCore/css/SVGCSSParser.cpp
WebCore/css/SVGCSSPropertyNames.in
WebCore/css/SVGCSSStyleSelector.cpp
WebCore/rendering/SVGRenderSupport.cpp
WebCore/rendering/style/SVGRenderStyle.cpp
WebCore/rendering/style/SVGRenderStyle.h
WebCore/rendering/style/SVGRenderStyleDefs.cpp
WebCore/rendering/style/SVGRenderStyleDefs.h