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)
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

index 72ca523..2832c2f 100644 (file)
@@ -1,3 +1,55 @@
+2009-10-22  Beth Dakin  <bdakin@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        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
+
+        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.
+
 2009-10-22  Shu Chang  <Chang.Shu@nokia.com>
 
         Reviewed by Eric Seidel.
index 6f126ec..db70179 100644 (file)
@@ -204,6 +204,7 @@ text-anchor: start;
 writing-mode: lr-tb;
 glyph-orientation-horizontal: 0deg;
 glyph-orientation-vertical: auto;
+-webkit-shadow: none;
 
 Other attributes that the computed style class supports:
 
index fecf3ca..ca5ae06 100644 (file)
@@ -203,6 +203,7 @@ Computed style of an element whose parent's 'display' value is 'none':
     writing-mode: lr-tb
     glyph-orientation-horizontal: 0deg
     glyph-orientation-vertical: auto
+    -webkit-shadow: none
     background-position-x: 0%
     background-position-y: 0%
     border-spacing: 0px 0px
diff --git a/LayoutTests/platform/mac/svg/css/arrow-with-shadow-expected.checksum b/LayoutTests/platform/mac/svg/css/arrow-with-shadow-expected.checksum
new file mode 100644 (file)
index 0000000..5026606
--- /dev/null
@@ -0,0 +1 @@
+8245282c6aa37263afb7254bbc0d4a3d
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/css/arrow-with-shadow-expected.png b/LayoutTests/platform/mac/svg/css/arrow-with-shadow-expected.png
new file mode 100644 (file)
index 0000000..523677f
Binary files /dev/null and b/LayoutTests/platform/mac/svg/css/arrow-with-shadow-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/css/arrow-with-shadow-expected.txt b/LayoutTests/platform/mac/svg/css/arrow-with-shadow-expected.txt
new file mode 100644 (file)
index 0000000..2e86b23
--- /dev/null
@@ -0,0 +1,7 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderSVGRoot {svg} at (79.97,23.98) size 570.03x378.71
+    RenderSVGContainer {g} at (79.97,23.98) size 570.03x378.71 [transform={m=((2.00,0.00)(0.00,2.00)) t=(0.00,0.00)}]
+      RenderSVGContainer {a} at (79.97,23.98) size 570.03x378.71
+        RenderPath {path} at (79.97,23.98) size 570.03x378.71 [stroke={[type=SOLID] [color=#0000FF] [stroke width=20.00]}] [data="M185.00,40.00 L85.00,40.00 L85.00,28.00 L40.00,64.00 L85.00,100.00 L85.00,88.00 L185.00,88.00 Z"]
diff --git a/LayoutTests/platform/mac/svg/css/circle-in-mask-with-shadow-expected.checksum b/LayoutTests/platform/mac/svg/css/circle-in-mask-with-shadow-expected.checksum
new file mode 100644 (file)
index 0000000..270c9d4
--- /dev/null
@@ -0,0 +1 @@
+366eae5af2b10c0ad04b7ae159d0a25b
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/css/circle-in-mask-with-shadow-expected.png b/LayoutTests/platform/mac/svg/css/circle-in-mask-with-shadow-expected.png
new file mode 100644 (file)
index 0000000..dd62b20
Binary files /dev/null and b/LayoutTests/platform/mac/svg/css/circle-in-mask-with-shadow-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/css/circle-in-mask-with-shadow-expected.txt b/LayoutTests/platform/mac/svg/css/circle-in-mask-with-shadow-expected.txt
new file mode 100644 (file)
index 0000000..67132c8
--- /dev/null
@@ -0,0 +1,21 @@
+KRenderingPaintServer {id="maskedGradient" [type=LINEAR-GRADIENT] [stops=[(0.00,#0000FF), (1.00,#FF0000)]] [start=(0,0)] [end=(1,1)]}
+KCanvasResource {id="mask_1" [type=MASKER]}
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 450x500
+  RenderSVGRoot {svg} at (0,0) size 300x300
+    RenderSVGContainer {g} at (0,0) size 300x300
+      RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+        RenderSVGHiddenContainer {linearGradient} at (0,0) size 0x0
+          RenderSVGGradientStop {stop} at (0,0) size 0x0
+          RenderSVGGradientStop {stop} at (0,0) size 0x0
+        RenderPath {rect} at (0,0) size 300x300 [fill={[type=LINEAR-GRADIENT] [stops=[(0.00,#0000FF), (1.00,#FF0000)]] [start=(0,0)] [end=(1,1)]}] [data="M0.00,0.00 L300.00,0.00 L300.00,300.00 L0.00,300.00 Z"]
+        RenderSVGContainer {mask} at (5,5) size 210x210
+          RenderPath {circle} at (5,5) size 100x100 [fill={[type=SOLID] [color=#FFFFFF]}] [data="M105.00,55.00 L104.90,58.14 L104.61,61.27 L104.11,64.37 L103.43,67.43 L102.55,70.45 L101.49,73.41 L100.24,76.29 L98.82,79.09 L97.22,81.79 L95.45,84.39 L93.53,86.87 L91.45,89.23 L89.23,91.45 L86.87,93.53 L84.39,95.45 L81.79,97.22 L79.09,98.82 L76.29,100.24 L73.41,101.49 L70.45,102.55 L67.43,103.43 L64.37,104.11 L61.27,104.61 L58.14,104.90 L55.00,105.00 L51.86,104.90 L48.73,104.61 L45.63,104.11 L42.57,103.43 L39.55,102.55 L36.59,101.49 L33.71,100.24 L30.91,98.82 L28.21,97.22 L25.61,95.45 L23.13,93.53 L20.77,91.45 L18.55,89.23 L16.47,86.87 L14.55,84.39 L12.78,81.79 L11.18,79.09 L9.76,76.29 L8.51,73.41 L7.45,70.45 L6.57,67.43 L5.89,64.37 L5.39,61.27 L5.10,58.14 L5.00,55.00 L5.10,51.86 L5.39,48.73 L5.89,45.63 L6.57,42.57 L7.45,39.55 L8.51,36.59 L9.76,33.71 L11.18,30.91 L12.78,28.21 L14.55,25.61 L16.47,23.13 L18.55,20.77 L20.77,18.55 L23.13,16.47 L25.61,14.55 L28.21,12.78 L30.91,11.18 L33.71,9.76 L36.59,8.51 L39.55,7.45 L42.57,6.57 L45.63,5.89 L48.73,5.39 L51.86,5.10 L55.00,5.00 L58.14,5.10 L61.27,5.39 L64.37,5.89 L67.43,6.57 L70.45,7.45 L73.41,8.51 L76.29,9.76 L79.09,11.18 L81.79,12.78 L84.39,14.55 L86.87,16.47 L89.23,18.55 L91.45,20.77 L93.53,23.13 L95.45,25.61 L97.22,28.21 L98.82,30.91 L100.24,33.71 L101.49,36.59 L102.55,39.55 L103.43,42.57 L104.11,45.63 L104.61,48.73 L104.90,51.86 Z"]
+          RenderPath {circle} at (5,115) size 100x100 [fill={[type=SOLID] [color=#FFFFFF]}] [data="M105.00,165.00 L104.90,168.14 L104.61,171.27 L104.11,174.37 L103.43,177.43 L102.55,180.45 L101.49,183.41 L100.24,186.29 L98.82,189.09 L97.22,191.79 L95.45,194.39 L93.53,196.87 L91.45,199.23 L89.23,201.45 L86.87,203.53 L84.39,205.45 L81.79,207.22 L79.09,208.82 L76.29,210.24 L73.41,211.49 L70.45,212.55 L67.43,213.43 L64.37,214.11 L61.27,214.61 L58.14,214.90 L55.00,215.00 L51.86,214.90 L48.73,214.61 L45.63,214.11 L42.57,213.43 L39.55,212.55 L36.59,211.49 L33.71,210.24 L30.91,208.82 L28.21,207.22 L25.61,205.45 L23.13,203.53 L20.77,201.45 L18.55,199.23 L16.47,196.87 L14.55,194.39 L12.78,191.79 L11.18,189.09 L9.76,186.29 L8.51,183.41 L7.45,180.45 L6.57,177.43 L5.89,174.37 L5.39,171.27 L5.10,168.14 L5.00,165.00 L5.10,161.86 L5.39,158.73 L5.89,155.63 L6.57,152.57 L7.45,149.55 L8.51,146.59 L9.76,143.71 L11.18,140.91 L12.78,138.21 L14.55,135.61 L16.47,133.13 L18.55,130.77 L20.77,128.55 L23.13,126.47 L25.61,124.55 L28.21,122.78 L30.91,121.18 L33.71,119.76 L36.59,118.51 L39.55,117.45 L42.57,116.57 L45.63,115.89 L48.73,115.39 L51.86,115.10 L55.00,115.00 L58.14,115.10 L61.27,115.39 L64.37,115.89 L67.43,116.57 L70.45,117.45 L73.41,118.51 L76.29,119.76 L79.09,121.18 L81.79,122.78 L84.39,124.55 L86.87,126.47 L89.23,128.55 L91.45,130.77 L93.53,133.13 L95.45,135.61 L97.22,138.21 L98.82,140.91 L100.24,143.71 L101.49,146.59 L102.55,149.55 L103.43,152.57 L104.11,155.63 L104.61,158.73 L104.90,161.86 Z"]
+          RenderPath {circle} at (115,5) size 100x100 [fill={[type=SOLID] [color=#FFFFFF]}] [data="M215.00,55.00 L214.90,58.14 L214.61,61.27 L214.11,64.37 L213.43,67.43 L212.55,70.45 L211.49,73.41 L210.24,76.29 L208.82,79.09 L207.22,81.79 L205.45,84.39 L203.53,86.87 L201.45,89.23 L199.23,91.45 L196.87,93.53 L194.39,95.45 L191.79,97.22 L189.09,98.82 L186.29,100.24 L183.41,101.49 L180.45,102.55 L177.43,103.43 L174.37,104.11 L171.27,104.61 L168.14,104.90 L165.00,105.00 L161.86,104.90 L158.73,104.61 L155.63,104.11 L152.57,103.43 L149.55,102.55 L146.59,101.49 L143.71,100.24 L140.91,98.82 L138.21,97.22 L135.61,95.45 L133.13,93.53 L130.77,91.45 L128.55,89.23 L126.47,86.87 L124.55,84.39 L122.78,81.79 L121.18,79.09 L119.76,76.29 L118.51,73.41 L117.45,70.45 L116.57,67.43 L115.89,64.37 L115.39,61.27 L115.10,58.14 L115.00,55.00 L115.10,51.86 L115.39,48.73 L115.89,45.63 L116.57,42.57 L117.45,39.55 L118.51,36.59 L119.76,33.71 L121.18,30.91 L122.78,28.21 L124.55,25.61 L126.47,23.13 L128.55,20.77 L130.77,18.55 L133.13,16.47 L135.61,14.55 L138.21,12.78 L140.91,11.18 L143.71,9.76 L146.59,8.51 L149.55,7.45 L152.57,6.57 L155.63,5.89 L158.73,5.39 L161.86,5.10 L165.00,5.00 L168.14,5.10 L171.27,5.39 L174.37,5.89 L177.43,6.57 L180.45,7.45 L183.41,8.51 L186.29,9.76 L189.09,11.18 L191.79,12.78 L194.39,14.55 L196.87,16.47 L199.23,18.55 L201.45,20.77 L203.53,23.13 L205.45,25.61 L207.22,28.21 L208.82,30.91 L210.24,33.71 L211.49,36.59 L212.55,39.55 L213.43,42.57 L214.11,45.63 L214.61,48.73 L214.90,51.86 Z"]
+          RenderPath {circle} at (115,115) size 100x100 [fill={[type=SOLID] [color=#FFFFFF]}] [data="M215.00,165.00 L214.90,168.14 L214.61,171.27 L214.11,174.37 L213.43,177.43 L212.55,180.45 L211.49,183.41 L210.24,186.29 L208.82,189.09 L207.22,191.79 L205.45,194.39 L203.53,196.87 L201.45,199.23 L199.23,201.45 L196.87,203.53 L194.39,205.45 L191.79,207.22 L189.09,208.82 L186.29,210.24 L183.41,211.49 L180.45,212.55 L177.43,213.43 L174.37,214.11 L171.27,214.61 L168.14,214.90 L165.00,215.00 L161.86,214.90 L158.73,214.61 L155.63,214.11 L152.57,213.43 L149.55,212.55 L146.59,211.49 L143.71,210.24 L140.91,208.82 L138.21,207.22 L135.61,205.45 L133.13,203.53 L130.77,201.45 L128.55,199.23 L126.47,196.87 L124.55,194.39 L122.78,191.79 L121.18,189.09 L119.76,186.29 L118.51,183.41 L117.45,180.45 L116.57,177.43 L115.89,174.37 L115.39,171.27 L115.10,168.14 L115.00,165.00 L115.10,161.86 L115.39,158.73 L115.89,155.63 L116.57,152.57 L117.45,149.55 L118.51,146.59 L119.76,143.71 L121.18,140.91 L122.78,138.21 L124.55,135.61 L126.47,133.13 L128.55,130.77 L130.77,128.55 L133.13,126.47 L135.61,124.55 L138.21,122.78 L140.91,121.18 L143.71,119.76 L146.59,118.51 L149.55,117.45 L152.57,116.57 L155.63,115.89 L158.73,115.39 L161.86,115.10 L165.00,115.00 L168.14,115.10 L171.27,115.39 L174.37,115.89 L177.43,116.57 L180.45,117.45 L183.41,118.51 L186.29,119.76 L189.09,121.18 L191.79,122.78 L194.39,124.55 L196.87,126.47 L199.23,128.55 L201.45,130.77 L203.53,133.13 L205.45,135.61 L207.22,138.21 L208.82,140.91 L210.24,143.71 L211.49,146.59 L212.55,149.55 L213.43,152.57 L214.11,155.63 L214.61,158.73 L214.90,161.86 Z"]
+      RenderSVGContainer {g} at (0,0) size 300x300
+        RenderSVGContainer {use} at (0,0) size 300x300
+          RenderSVGContainer {g} at (0,0) size 300x300
+            RenderPath {rect} at (0,0) size 300x300 [fill={[type=LINEAR-GRADIENT] [stops=[(0.00,#0000FF), (1.00,#FF0000)]] [start=(0,0)] [end=(1,1)]}] [data="M0.00,0.00 L300.00,0.00 L300.00,300.00 L0.00,300.00 Z"]
diff --git a/LayoutTests/platform/mac/svg/css/clippath-with-shadow-expected.checksum b/LayoutTests/platform/mac/svg/css/clippath-with-shadow-expected.checksum
new file mode 100644 (file)
index 0000000..215a511
--- /dev/null
@@ -0,0 +1 @@
+3aa16a092fe25416b039cd3ea92f1ead
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/css/clippath-with-shadow-expected.png b/LayoutTests/platform/mac/svg/css/clippath-with-shadow-expected.png
new file mode 100644 (file)
index 0000000..0ca2df4
Binary files /dev/null and b/LayoutTests/platform/mac/svg/css/clippath-with-shadow-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/css/clippath-with-shadow-expected.txt b/LayoutTests/platform/mac/svg/css/clippath-with-shadow-expected.txt
new file mode 100644 (file)
index 0000000..d5b687b
--- /dev/null
@@ -0,0 +1,8 @@
+KCanvasResource {id="clip" [type=CLIPPER] [clip data=[[winding=NON-ZERO] [path=M0.00,0.00 L200.00,0.00 L200.00,200.00 L0.00,200.00 Z]]]}
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderSVGRoot {svg} at (0,0) size 400x200
+    RenderPath {rect} at (0,0) size 200x200 [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00 L200.00,0.00 L200.00,200.00 L0.00,200.00 Z"]
+    RenderPath {rect} at (0,0) size 200x200 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-200.00,0.00)}] [data="M200.00,0.00 L400.00,0.00 L400.00,200.00 L200.00,200.00 Z"]
+    RenderPath {rect} at (0,0) size 400x200 [fill={[type=SOLID] [color=#008000]}] [clip path="clip"] [data="M0.00,0.00 L400.00,0.00 L400.00,200.00 L0.00,200.00 Z"]
diff --git a/LayoutTests/platform/mac/svg/css/group-with-shadow-expected.checksum b/LayoutTests/platform/mac/svg/css/group-with-shadow-expected.checksum
new file mode 100644 (file)
index 0000000..d21a3eb
--- /dev/null
@@ -0,0 +1 @@
+90529b52e5002f0e9d21d06773bd0ce5
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/css/group-with-shadow-expected.png b/LayoutTests/platform/mac/svg/css/group-with-shadow-expected.png
new file mode 100644 (file)
index 0000000..df88e16
Binary files /dev/null and b/LayoutTests/platform/mac/svg/css/group-with-shadow-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/css/group-with-shadow-expected.txt b/LayoutTests/platform/mac/svg/css/group-with-shadow-expected.txt
new file mode 100644 (file)
index 0000000..c9db360
--- /dev/null
@@ -0,0 +1,10 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderSVGRoot {svg} at (31.67,31.67) size 253.33x281.67
+    RenderSVGContainer {g} at (31.67,31.67) size 253.33x281.67 [transform={m=((2.00,0.00)(0.00,2.00)) t=(0.00,0.00)}]
+      RenderPath {line} at (33.33,31.67) size 250x3.33 [stroke={[type=SOLID] [color=#800080]}] [fill={[type=SOLID] [color=#000000]}] [data="M10.00,10.00 L85.00,10.00"]
+      RenderPath {rect} at (31.67,65) size 253.33x170 [stroke={[type=SOLID] [color=#800080]}] [fill={[type=SOLID] [color=#800080]}] [data="M10.00,20.00 L85.00,20.00 L85.00,70.00 L10.00,70.00 Z"]
+      RenderSVGText {text} at (10,90) size 75x18 contains 1 chunk(s)
+        RenderSVGInlineText {#text} at (0,-14) size 75x18
+          chunk 1 text run 1 at (10.00,90.00) startOffset 0 endOffset 12 width 75.00: "Hello there!"
diff --git a/LayoutTests/platform/mac/svg/css/mask-with-shadow-expected.checksum b/LayoutTests/platform/mac/svg/css/mask-with-shadow-expected.checksum
new file mode 100644 (file)
index 0000000..0fcd1df
--- /dev/null
@@ -0,0 +1 @@
+e920ef08b2013822c36c33bea729c239
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/css/mask-with-shadow-expected.png b/LayoutTests/platform/mac/svg/css/mask-with-shadow-expected.png
new file mode 100644 (file)
index 0000000..df3fff1
Binary files /dev/null and b/LayoutTests/platform/mac/svg/css/mask-with-shadow-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/css/mask-with-shadow-expected.txt b/LayoutTests/platform/mac/svg/css/mask-with-shadow-expected.txt
new file mode 100644 (file)
index 0000000..67132c8
--- /dev/null
@@ -0,0 +1,21 @@
+KRenderingPaintServer {id="maskedGradient" [type=LINEAR-GRADIENT] [stops=[(0.00,#0000FF), (1.00,#FF0000)]] [start=(0,0)] [end=(1,1)]}
+KCanvasResource {id="mask_1" [type=MASKER]}
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 450x500
+  RenderSVGRoot {svg} at (0,0) size 300x300
+    RenderSVGContainer {g} at (0,0) size 300x300
+      RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+        RenderSVGHiddenContainer {linearGradient} at (0,0) size 0x0
+          RenderSVGGradientStop {stop} at (0,0) size 0x0
+          RenderSVGGradientStop {stop} at (0,0) size 0x0
+        RenderPath {rect} at (0,0) size 300x300 [fill={[type=LINEAR-GRADIENT] [stops=[(0.00,#0000FF), (1.00,#FF0000)]] [start=(0,0)] [end=(1,1)]}] [data="M0.00,0.00 L300.00,0.00 L300.00,300.00 L0.00,300.00 Z"]
+        RenderSVGContainer {mask} at (5,5) size 210x210
+          RenderPath {circle} at (5,5) size 100x100 [fill={[type=SOLID] [color=#FFFFFF]}] [data="M105.00,55.00 L104.90,58.14 L104.61,61.27 L104.11,64.37 L103.43,67.43 L102.55,70.45 L101.49,73.41 L100.24,76.29 L98.82,79.09 L97.22,81.79 L95.45,84.39 L93.53,86.87 L91.45,89.23 L89.23,91.45 L86.87,93.53 L84.39,95.45 L81.79,97.22 L79.09,98.82 L76.29,100.24 L73.41,101.49 L70.45,102.55 L67.43,103.43 L64.37,104.11 L61.27,104.61 L58.14,104.90 L55.00,105.00 L51.86,104.90 L48.73,104.61 L45.63,104.11 L42.57,103.43 L39.55,102.55 L36.59,101.49 L33.71,100.24 L30.91,98.82 L28.21,97.22 L25.61,95.45 L23.13,93.53 L20.77,91.45 L18.55,89.23 L16.47,86.87 L14.55,84.39 L12.78,81.79 L11.18,79.09 L9.76,76.29 L8.51,73.41 L7.45,70.45 L6.57,67.43 L5.89,64.37 L5.39,61.27 L5.10,58.14 L5.00,55.00 L5.10,51.86 L5.39,48.73 L5.89,45.63 L6.57,42.57 L7.45,39.55 L8.51,36.59 L9.76,33.71 L11.18,30.91 L12.78,28.21 L14.55,25.61 L16.47,23.13 L18.55,20.77 L20.77,18.55 L23.13,16.47 L25.61,14.55 L28.21,12.78 L30.91,11.18 L33.71,9.76 L36.59,8.51 L39.55,7.45 L42.57,6.57 L45.63,5.89 L48.73,5.39 L51.86,5.10 L55.00,5.00 L58.14,5.10 L61.27,5.39 L64.37,5.89 L67.43,6.57 L70.45,7.45 L73.41,8.51 L76.29,9.76 L79.09,11.18 L81.79,12.78 L84.39,14.55 L86.87,16.47 L89.23,18.55 L91.45,20.77 L93.53,23.13 L95.45,25.61 L97.22,28.21 L98.82,30.91 L100.24,33.71 L101.49,36.59 L102.55,39.55 L103.43,42.57 L104.11,45.63 L104.61,48.73 L104.90,51.86 Z"]
+          RenderPath {circle} at (5,115) size 100x100 [fill={[type=SOLID] [color=#FFFFFF]}] [data="M105.00,165.00 L104.90,168.14 L104.61,171.27 L104.11,174.37 L103.43,177.43 L102.55,180.45 L101.49,183.41 L100.24,186.29 L98.82,189.09 L97.22,191.79 L95.45,194.39 L93.53,196.87 L91.45,199.23 L89.23,201.45 L86.87,203.53 L84.39,205.45 L81.79,207.22 L79.09,208.82 L76.29,210.24 L73.41,211.49 L70.45,212.55 L67.43,213.43 L64.37,214.11 L61.27,214.61 L58.14,214.90 L55.00,215.00 L51.86,214.90 L48.73,214.61 L45.63,214.11 L42.57,213.43 L39.55,212.55 L36.59,211.49 L33.71,210.24 L30.91,208.82 L28.21,207.22 L25.61,205.45 L23.13,203.53 L20.77,201.45 L18.55,199.23 L16.47,196.87 L14.55,194.39 L12.78,191.79 L11.18,189.09 L9.76,186.29 L8.51,183.41 L7.45,180.45 L6.57,177.43 L5.89,174.37 L5.39,171.27 L5.10,168.14 L5.00,165.00 L5.10,161.86 L5.39,158.73 L5.89,155.63 L6.57,152.57 L7.45,149.55 L8.51,146.59 L9.76,143.71 L11.18,140.91 L12.78,138.21 L14.55,135.61 L16.47,133.13 L18.55,130.77 L20.77,128.55 L23.13,126.47 L25.61,124.55 L28.21,122.78 L30.91,121.18 L33.71,119.76 L36.59,118.51 L39.55,117.45 L42.57,116.57 L45.63,115.89 L48.73,115.39 L51.86,115.10 L55.00,115.00 L58.14,115.10 L61.27,115.39 L64.37,115.89 L67.43,116.57 L70.45,117.45 L73.41,118.51 L76.29,119.76 L79.09,121.18 L81.79,122.78 L84.39,124.55 L86.87,126.47 L89.23,128.55 L91.45,130.77 L93.53,133.13 L95.45,135.61 L97.22,138.21 L98.82,140.91 L100.24,143.71 L101.49,146.59 L102.55,149.55 L103.43,152.57 L104.11,155.63 L104.61,158.73 L104.90,161.86 Z"]
+          RenderPath {circle} at (115,5) size 100x100 [fill={[type=SOLID] [color=#FFFFFF]}] [data="M215.00,55.00 L214.90,58.14 L214.61,61.27 L214.11,64.37 L213.43,67.43 L212.55,70.45 L211.49,73.41 L210.24,76.29 L208.82,79.09 L207.22,81.79 L205.45,84.39 L203.53,86.87 L201.45,89.23 L199.23,91.45 L196.87,93.53 L194.39,95.45 L191.79,97.22 L189.09,98.82 L186.29,100.24 L183.41,101.49 L180.45,102.55 L177.43,103.43 L174.37,104.11 L171.27,104.61 L168.14,104.90 L165.00,105.00 L161.86,104.90 L158.73,104.61 L155.63,104.11 L152.57,103.43 L149.55,102.55 L146.59,101.49 L143.71,100.24 L140.91,98.82 L138.21,97.22 L135.61,95.45 L133.13,93.53 L130.77,91.45 L128.55,89.23 L126.47,86.87 L124.55,84.39 L122.78,81.79 L121.18,79.09 L119.76,76.29 L118.51,73.41 L117.45,70.45 L116.57,67.43 L115.89,64.37 L115.39,61.27 L115.10,58.14 L115.00,55.00 L115.10,51.86 L115.39,48.73 L115.89,45.63 L116.57,42.57 L117.45,39.55 L118.51,36.59 L119.76,33.71 L121.18,30.91 L122.78,28.21 L124.55,25.61 L126.47,23.13 L128.55,20.77 L130.77,18.55 L133.13,16.47 L135.61,14.55 L138.21,12.78 L140.91,11.18 L143.71,9.76 L146.59,8.51 L149.55,7.45 L152.57,6.57 L155.63,5.89 L158.73,5.39 L161.86,5.10 L165.00,5.00 L168.14,5.10 L171.27,5.39 L174.37,5.89 L177.43,6.57 L180.45,7.45 L183.41,8.51 L186.29,9.76 L189.09,11.18 L191.79,12.78 L194.39,14.55 L196.87,16.47 L199.23,18.55 L201.45,20.77 L203.53,23.13 L205.45,25.61 L207.22,28.21 L208.82,30.91 L210.24,33.71 L211.49,36.59 L212.55,39.55 L213.43,42.57 L214.11,45.63 L214.61,48.73 L214.90,51.86 Z"]
+          RenderPath {circle} at (115,115) size 100x100 [fill={[type=SOLID] [color=#FFFFFF]}] [data="M215.00,165.00 L214.90,168.14 L214.61,171.27 L214.11,174.37 L213.43,177.43 L212.55,180.45 L211.49,183.41 L210.24,186.29 L208.82,189.09 L207.22,191.79 L205.45,194.39 L203.53,196.87 L201.45,199.23 L199.23,201.45 L196.87,203.53 L194.39,205.45 L191.79,207.22 L189.09,208.82 L186.29,210.24 L183.41,211.49 L180.45,212.55 L177.43,213.43 L174.37,214.11 L171.27,214.61 L168.14,214.90 L165.00,215.00 L161.86,214.90 L158.73,214.61 L155.63,214.11 L152.57,213.43 L149.55,212.55 L146.59,211.49 L143.71,210.24 L140.91,208.82 L138.21,207.22 L135.61,205.45 L133.13,203.53 L130.77,201.45 L128.55,199.23 L126.47,196.87 L124.55,194.39 L122.78,191.79 L121.18,189.09 L119.76,186.29 L118.51,183.41 L117.45,180.45 L116.57,177.43 L115.89,174.37 L115.39,171.27 L115.10,168.14 L115.00,165.00 L115.10,161.86 L115.39,158.73 L115.89,155.63 L116.57,152.57 L117.45,149.55 L118.51,146.59 L119.76,143.71 L121.18,140.91 L122.78,138.21 L124.55,135.61 L126.47,133.13 L128.55,130.77 L130.77,128.55 L133.13,126.47 L135.61,124.55 L138.21,122.78 L140.91,121.18 L143.71,119.76 L146.59,118.51 L149.55,117.45 L152.57,116.57 L155.63,115.89 L158.73,115.39 L161.86,115.10 L165.00,115.00 L168.14,115.10 L171.27,115.39 L174.37,115.89 L177.43,116.57 L180.45,117.45 L183.41,118.51 L186.29,119.76 L189.09,121.18 L191.79,122.78 L194.39,124.55 L196.87,126.47 L199.23,128.55 L201.45,130.77 L203.53,133.13 L205.45,135.61 L207.22,138.21 L208.82,140.91 L210.24,143.71 L211.49,146.59 L212.55,149.55 L213.43,152.57 L214.11,155.63 L214.61,158.73 L214.90,161.86 Z"]
+      RenderSVGContainer {g} at (0,0) size 300x300
+        RenderSVGContainer {use} at (0,0) size 300x300
+          RenderSVGContainer {g} at (0,0) size 300x300
+            RenderPath {rect} at (0,0) size 300x300 [fill={[type=LINEAR-GRADIENT] [stops=[(0.00,#0000FF), (1.00,#FF0000)]] [start=(0,0)] [end=(1,1)]}] [data="M0.00,0.00 L300.00,0.00 L300.00,300.00 L0.00,300.00 Z"]
diff --git a/LayoutTests/platform/mac/svg/css/path-with-shadow-expected.checksum b/LayoutTests/platform/mac/svg/css/path-with-shadow-expected.checksum
new file mode 100644 (file)
index 0000000..a37ebc7
--- /dev/null
@@ -0,0 +1 @@
+9ef6bc624b1aaa6746c6646a4043331e
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/css/path-with-shadow-expected.png b/LayoutTests/platform/mac/svg/css/path-with-shadow-expected.png
new file mode 100644 (file)
index 0000000..883afc9
Binary files /dev/null and b/LayoutTests/platform/mac/svg/css/path-with-shadow-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/css/path-with-shadow-expected.txt b/LayoutTests/platform/mac/svg/css/path-with-shadow-expected.txt
new file mode 100644 (file)
index 0000000..3d13e67
--- /dev/null
@@ -0,0 +1,5 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderSVGRoot {svg} at (200,200) size 100x200
+    RenderPath {path} at (200,200) size 100x200 [fill={[type=SOLID] [color=#0000FF]}] [data="M200.00,200.00 L300.00,200.00 L300.00,400.00 L200.00,400.00 Z"]
diff --git a/LayoutTests/platform/mac/svg/css/stars-with-shadow-expected.checksum b/LayoutTests/platform/mac/svg/css/stars-with-shadow-expected.checksum
new file mode 100644 (file)
index 0000000..a7e555f
--- /dev/null
@@ -0,0 +1 @@
+f36bf924947b0f90389be023e33745f9
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/css/stars-with-shadow-expected.png b/LayoutTests/platform/mac/svg/css/stars-with-shadow-expected.png
new file mode 100644 (file)
index 0000000..590a020
Binary files /dev/null and b/LayoutTests/platform/mac/svg/css/stars-with-shadow-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/css/stars-with-shadow-expected.txt b/LayoutTests/platform/mac/svg/css/stars-with-shadow-expected.txt
new file mode 100644 (file)
index 0000000..d990f8b
--- /dev/null
@@ -0,0 +1,9 @@
+layer at (0,0) size 785x616
+  RenderView at (0,0) size 785x600
+layer at (0,0) size 785x616
+  RenderBlock {HTML} at (0,0) size 785x616
+    RenderBody {BODY} at (8,8) size 769x600
+      RenderSVGRoot {svg} at (40.19,36.70) size 426.11x128.98
+        RenderPath {path} at (40.19,36.70) size 135.62x128.98 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,100.00)}] [stroke={[type=SOLID] [color=#800080] [stroke width=10.00]}] [fill={[type=SOLID] [color=#999999]}] [data="M0.00,30.00 L-35.27,48.54 L-28.53,9.27 L-57.06,-18.54 L-17.63,-24.27 L-0.00,-60.00 L17.63,-24.27 L57.06,-18.54 L28.53,9.27 L35.27,48.54 Z"]
+        RenderPath {path} at (190.19,36.70) size 135.62x128.98 [transform={m=((1.00,0.00)(0.00,1.00)) t=(250.00,100.00)}] [stroke={[type=SOLID] [color=#800080] [stroke width=10.00]}] [fill={[type=SOLID] [color=#999999]}] [data="M0.00,30.00 L-35.27,48.54 L-28.53,9.27 L-57.06,-18.54 L-17.63,-24.27 L-0.00,-60.00 L17.63,-24.27 L57.06,-18.54 L28.53,9.27 L35.27,48.54 Z"]
+        RenderPath {path} at (349.70,46.70) size 116.60x110.89 [transform={m=((1.00,0.00)(0.00,1.00)) t=(400.00,100.00)}] [stroke={[type=SOLID] [color=#800080] [stroke width=10.00]}] [fill={[type=SOLID] [color=#999999]}] [data="M0.00,25.00 L-29.39,40.45 L-23.78,7.73 L-47.55,-15.45 L-14.69,-20.23 L-0.00,-50.00 L14.69,-20.23 L47.55,-15.45 L23.78,7.73 L29.39,40.45 Z"]
diff --git a/LayoutTests/platform/mac/svg/filters/shadow-on-filter-expected.checksum b/LayoutTests/platform/mac/svg/filters/shadow-on-filter-expected.checksum
new file mode 100644 (file)
index 0000000..4ba085a
--- /dev/null
@@ -0,0 +1 @@
+3344f651fa82a0b24368d45059d9cf75
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/filters/shadow-on-filter-expected.png b/LayoutTests/platform/mac/svg/filters/shadow-on-filter-expected.png
new file mode 100644 (file)
index 0000000..45c4fa3
Binary files /dev/null and b/LayoutTests/platform/mac/svg/filters/shadow-on-filter-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/filters/shadow-on-filter-expected.txt b/LayoutTests/platform/mac/svg/filters/shadow-on-filter-expected.txt
new file mode 100644 (file)
index 0000000..a04d7ba
--- /dev/null
@@ -0,0 +1,6 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderSVGRoot {svg} at (200,200) size 300x300
+    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+    RenderPath {rect} at (200,200) size 300x300 [fill={[type=SOLID] [color=#008000]}] [filter=filter] [data="M200.00,200.00 L500.00,200.00 L500.00,500.00 L200.00,500.00 Z"]
diff --git a/LayoutTests/platform/mac/svg/filters/shadow-on-rect-with-filter-expected.checksum b/LayoutTests/platform/mac/svg/filters/shadow-on-rect-with-filter-expected.checksum
new file mode 100644 (file)
index 0000000..5acb9b5
--- /dev/null
@@ -0,0 +1 @@
+9c0b9a20081563ed988c0e8f91f225b7
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/filters/shadow-on-rect-with-filter-expected.png b/LayoutTests/platform/mac/svg/filters/shadow-on-rect-with-filter-expected.png
new file mode 100644 (file)
index 0000000..bedd83e
Binary files /dev/null and b/LayoutTests/platform/mac/svg/filters/shadow-on-rect-with-filter-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/filters/shadow-on-rect-with-filter-expected.txt b/LayoutTests/platform/mac/svg/filters/shadow-on-rect-with-filter-expected.txt
new file mode 100644 (file)
index 0000000..a04d7ba
--- /dev/null
@@ -0,0 +1,6 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderSVGRoot {svg} at (200,200) size 300x300
+    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+    RenderPath {rect} at (200,200) size 300x300 [fill={[type=SOLID] [color=#008000]}] [filter=filter] [data="M200.00,200.00 L500.00,200.00 L500.00,500.00 L200.00,500.00 Z"]
diff --git a/LayoutTests/svg/css/arrow-with-shadow.svg b/LayoutTests/svg/css/arrow-with-shadow.svg
new file mode 100644 (file)
index 0000000..1cb9b5c
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">
+
+<svg version="1.1" baseProfile="basic" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
+
+       <desc id="test-desc">Shadowy Arrow</desc>
+       <g id="test-body-content" transform="scale(2)" style="-webkit-shadow: 5px 5px 5px grey">
+               <a xlink:href="resources/link-target.html">
+                       <path fill="none" stroke-width="20" stroke="blue" d="M 185,40 h -100 v -12 l -45 36 l 45 36 v -12 h 100 z"/>
+               </a>
+       </g>
+</svg>
diff --git a/LayoutTests/svg/css/circle-in-mask-with-shadow.svg b/LayoutTests/svg/css/circle-in-mask-with-shadow.svg
new file mode 100644 (file)
index 0000000..8a2c72c
--- /dev/null
@@ -0,0 +1,36 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+
+<?xml-stylesheet type="text/css" href="../resources/test.css" ?>
+
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="body" width="450" height="500" viewBox="0 0 450 500">
+
+    <g id="testContent" class="legend" text-anchor="middle">
+
+        <defs>
+
+        <linearGradient id="maskedGradient" x1="0" x2="1" y1="0" y2="1" color-interpolation="linearRGB">
+            <stop offset="0" stop-color="blue" />
+            <stop offset="1" stop-color="red" />
+        </linearGradient>
+
+        <rect id="masked" width="300" height="300" fill="url(#maskedGradient)" />
+
+        <mask id="mask_1">
+            <circle cx="55" cy="55" r="50" fill="#ffffff" style="-webkit-shadow:5px 5px 5px red" />
+            <circle cx="55" cy="165" r="50" fill="#ffffff" style="-webkit-shadow:5px 5px 5px red" />
+            <circle cx="165" cy="55" r="50" fill="#ffffff" style="-webkit-shadow:5px 5px 5px red" />
+            <circle cx="165" cy="165" r="50" fill="#ffffff" style="-webkit-shadow:5px 5px 5px red" />
+        </mask>
+
+     
+        </defs>
+
+
+        <g>
+            <use xlink:href="#masked" mask="url(#mask_1)"/>
+        </g>
+    </g>
+    
+</svg>
diff --git a/LayoutTests/svg/css/clippath-with-shadow.svg b/LayoutTests/svg/css/clippath-with-shadow.svg
new file mode 100644 (file)
index 0000000..bc80d67
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   version="1.0">
+  <rect fill="red" x="0" y="0" width="200" height="200" />
+  <rect x="200" y="0" fill="none" width="200" height="200" transform="translate(-200,0)" id="crect" />
+  <clipPath id="clip" style="-webkit-shadow: 5px 5px 5px grey"><use xlink:href="#crect" /></clipPath>
+  <rect fill="green" stroke="none" x="0" y="0" width="400" height="200" clip-path="url(#clip)" />
+</svg>
index e3c77e9..c207796 100644 (file)
@@ -406,6 +406,8 @@ rect: style.getPropertyValue(glyph-orientation-horizontal) : 0deg
 rect: style.getPropertyCSSValue(glyph-orientation-horizontal) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(glyph-orientation-vertical) : auto
 rect: style.getPropertyCSSValue(glyph-orientation-vertical) : [object CSSPrimitiveValue]
+rect: style.getPropertyValue(-webkit-shadow) : none
+rect: style.getPropertyCSSValue(-webkit-shadow) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(background-attachment) : scroll
 g: style.getPropertyCSSValue(background-attachment) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(background-clip) : border-box
@@ -814,4 +816,6 @@ g: style.getPropertyValue(glyph-orientation-horizontal) : 0deg
 g: style.getPropertyCSSValue(glyph-orientation-horizontal) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(glyph-orientation-vertical) : auto
 g: style.getPropertyCSSValue(glyph-orientation-vertical) : [object CSSPrimitiveValue]
+g: style.getPropertyValue(-webkit-shadow) : none
+g: style.getPropertyCSSValue(-webkit-shadow) : [object CSSPrimitiveValue]
 
diff --git a/LayoutTests/svg/css/group-with-shadow.svg b/LayoutTests/svg/css/group-with-shadow.svg
new file mode 100644 (file)
index 0000000..00711de
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">
+
+<svg version="1.1" baseProfile="basic" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
+
+       <desc id="test-desc">Shadowy Group</desc>
+       <g id="test-body-content" transform="scale(2)" style="-webkit-shadow:5px 5px 5px grey">
+      <line x1="10" y1="10" x2="85" y2="10"
+          style="stroke: purple;"/>
+
+      <rect x="10" y="20" height="50" width="75"
+          style="stroke: purple; fill: purple"/>
+
+      <text x="10" y="90" style="stroke: purple; fill: red">
+        Hello there!</text>
+    </g>
+
+</svg>
diff --git a/LayoutTests/svg/css/mask-with-shadow.svg b/LayoutTests/svg/css/mask-with-shadow.svg
new file mode 100644 (file)
index 0000000..8b784d7
--- /dev/null
@@ -0,0 +1,36 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+
+<?xml-stylesheet type="text/css" href="../resources/test.css" ?>
+
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="body" width="450" height="500" viewBox="0 0 450 500">
+
+    <g id="testContent" class="legend" text-anchor="middle">
+
+        <defs>
+
+        <linearGradient id="maskedGradient" x1="0" x2="1" y1="0" y2="1" color-interpolation="linearRGB">
+            <stop offset="0" stop-color="blue" />
+            <stop offset="1" stop-color="red" />
+        </linearGradient>
+
+        <rect id="masked" width="300" height="300" fill="url(#maskedGradient)" />
+
+        <mask id="mask_1" style="-webkit-shadow:5px 5px 5px grey">
+            <circle cx="55" cy="55" r="50" fill="#ffffff" />
+            <circle cx="55" cy="165" r="50" fill="#ffffff" />
+            <circle cx="165" cy="55" r="50" fill="#ffffff" />
+            <circle cx="165" cy="165" r="50" fill="#ffffff" />
+        </mask>
+
+     
+        </defs>
+
+
+        <g>
+            <use xlink:href="#masked" mask="url(#mask_1)"/>
+        </g>
+    </g>
+    
+</svg>
diff --git a/LayoutTests/svg/css/path-with-shadow.svg b/LayoutTests/svg/css/path-with-shadow.svg
new file mode 100644 (file)
index 0000000..0c678e5
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg">
+<path mask="url(#mask)" fill="blue" d="M 200 200 l 100 0 l 0 200 l -100 0 Z" style="-webkit-shadow: 5px 5px 5px grey"/>
+</svg>
diff --git a/LayoutTests/svg/css/stars-with-shadow.html b/LayoutTests/svg/css/stars-with-shadow.html
new file mode 100644 (file)
index 0000000..0d5ac58
--- /dev/null
@@ -0,0 +1,72 @@
+<html>
+<head>
+<script language="javascript">
+<!--
+
+SVG_NS = 'http://www.w3.org/2000/svg';
+
+function pathFromStar (radius, innerRadius, sides) {
+    var path = [];
+    for (var i = 0; i < sides * 2; ++i) {
+        var theta = Math.PI * i / sides + (Math.PI / 2);
+        var r = (i % 2) ? radius : innerRadius;
+        var x = r * Math.cos(theta);
+        var y = r * Math.sin(theta);
+        path.push((i ? 'L' : 'M'), x, y);
+    }
+    path.push('Z');
+    return path.join(' ');
+}
+
+function newSvgElement (tagName, parentNode, attrs) {
+    var node = document.createElementNS(SVG_NS, tagName);
+    if (attrs) {
+        for (var k in attrs) {
+            node.setAttribute(k, attrs[k]);
+        }
+    }
+    if (parentNode) {
+        parentNode.appendChild(node);
+    }
+    return node;
+}
+
+function setCenterPosition (node, x, y) {
+    node.setAttribute('transform', 'translate($1, $2)'
+        .replace('$1', x)
+        .replace('$2', y));
+}
+
+window.addEventListener('load', function () {
+
+    var svgContainer = newSvgElement('svg', document.body);
+    var shapes = [
+        { pos: [ 100, 100 ], size: 60 },
+        { pos: [ 250, 100 ], size: 60 },
+        { pos: [ 400, 100 ], size: 50 }
+    ];
+    for (var i = 0; i < shapes.length; ++i) {
+        var shape = shapes[i];
+        var node = newSvgElement('path', svgContainer, {
+            d: pathFromStar(shape.size, shape.size / 2, 5),
+            fill: '#999',
+            stroke: 'purple',
+            'stroke-width': 10,
+        });
+        setCenterPosition(node, shape.pos[0], shape.pos[1]);
+        node.id = 'svg';
+    }
+});
+
+//-->
+</script>
+
+<style>
+    #svg {
+        -webkit-shadow: 5px 5px 5px #888;
+    }
+</style>
+</head>
+<body>
+</body>
+</html>
diff --git a/LayoutTests/svg/filters/shadow-on-filter.svg b/LayoutTests/svg/filters/shadow-on-filter.svg
new file mode 100644 (file)
index 0000000..255f10a
--- /dev/null
@@ -0,0 +1,11 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<defs>
+<filter primitiveUnits="objectBoundingBox" id="filter" x="-50%" y="-50%" width="160%" height="160%" style="-webkit-shadow:10px 10px 3px purple;">
+<feFlood x="-40%" y="-40%" width="50%" height="50%" flood-color="red" style="-webkit-shadow:-4px -4px 0px blue;" result="flood1"/>
+<feFlood x="-20%" y="-20%" width="50%" height="50%" flood-color="green" result="flood2"/>
+<feComposite in="flood1" in2="flood2" width="120%" height="120%" result="comp1" style="-webkit-shadow:4px -1px 3px green;"/>
+<feGaussianBlur stdDeviation="4 4" style="-webkit-shadow: 6px 4px 8px yellow;"/>
+</filter>
+</defs>
+<rect x="200" y="200" width="300" height="300" fill="green" style="filter:url(#filter);"/>
+</svg>
diff --git a/LayoutTests/svg/filters/shadow-on-rect-with-filter.svg b/LayoutTests/svg/filters/shadow-on-rect-with-filter.svg
new file mode 100644 (file)
index 0000000..1b97a36
--- /dev/null
@@ -0,0 +1,11 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<defs>
+<filter primitiveUnits="objectBoundingBox" id="filter" x="-50%" y="-50%" width="160%" height="160%" >
+<feFlood x="-40%" y="-40%" width="50%" height="50%" flood-color="red" result="flood1"/>
+<feFlood x="-20%" y="-20%" width="50%" height="50%" flood-color="green" result="flood2"/>
+<feComposite in="flood1" in2="flood2" width="120%" height="120%" result="comp1" />
+<feGaussianBlur stdDeviation="4 4" />
+</filter>
+</defs>
+<rect x="200" y="200" width="300" height="300" fill="green" style="filter:url(#filter);-webkit-shadow:-10px -10px 3px orange;"/>
+</svg>
index 6544d04..48ebcb1 100644 (file)
@@ -1,3 +1,53 @@
+2009-10-22  Beth Dakin  <bdakin@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        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
+
+        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!=):
+
 2009-10-22  Joanmarie Diggs  <joanmarie.diggs@gmail.com>
  
         Reviewed by Xan Lopez.
index 4e067ce..793ef81 100644 (file)
@@ -260,30 +260,13 @@ static const int computedProperties[] = {
     CSSPropertyTextAnchor,
     CSSPropertyWritingMode,
     CSSPropertyGlyphOrientationHorizontal,
-    CSSPropertyGlyphOrientationVertical
+    CSSPropertyGlyphOrientationVertical,
+    CSSPropertyWebkitShadow
 #endif
 };
 
 const unsigned numComputedProperties = sizeof(computedProperties) / sizeof(computedProperties[0]);
 
-static PassRefPtr<CSSValue> valueForShadow(const ShadowData* shadow, CSSPropertyID propertyID)
-{
-    if (!shadow)
-        return CSSPrimitiveValue::createIdentifier(CSSValueNone);
-
-    RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
-    for (const ShadowData* s = shadow; s; s = s->next) {
-        RefPtr<CSSPrimitiveValue> x = CSSPrimitiveValue::create(s->x, CSSPrimitiveValue::CSS_PX);
-        RefPtr<CSSPrimitiveValue> y = CSSPrimitiveValue::create(s->y, CSSPrimitiveValue::CSS_PX);
-        RefPtr<CSSPrimitiveValue> blur = CSSPrimitiveValue::create(s->blur, CSSPrimitiveValue::CSS_PX);
-        RefPtr<CSSPrimitiveValue> spread = propertyID == CSSPropertyTextShadow ? 0 : CSSPrimitiveValue::create(s->spread, CSSPrimitiveValue::CSS_PX);
-        RefPtr<CSSPrimitiveValue> style = propertyID == CSSPropertyTextShadow || s->style == Normal ? 0 : CSSPrimitiveValue::createIdentifier(CSSValueInset);
-        RefPtr<CSSPrimitiveValue> color = CSSPrimitiveValue::createColor(s->color.rgb());
-        list->prepend(ShadowValue::create(x.release(), y.release(), blur.release(), spread.release(), style.release(), color.release()));
-    }
-    return list.release();
-}
-
 static int valueForRepeatRule(int rule)
 {
     switch (rule) {
@@ -571,6 +554,26 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getFontSizeCSSValuePreferringK
     return CSSPrimitiveValue::create(style->fontDescription().computedPixelSize(), CSSPrimitiveValue::CSS_PX);
 }
 
+PassRefPtr<CSSValue> CSSComputedStyleDeclaration::valueForShadow(const ShadowData* shadow, int id) const
+{
+    if (!shadow)
+        return CSSPrimitiveValue::createIdentifier(CSSValueNone);
+
+    CSSPropertyID propertyID = static_cast<CSSPropertyID>(id);
+
+    RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
+    for (const ShadowData* s = shadow; s; s = s->next) {
+        RefPtr<CSSPrimitiveValue> x = CSSPrimitiveValue::create(s->x, CSSPrimitiveValue::CSS_PX);
+        RefPtr<CSSPrimitiveValue> y = CSSPrimitiveValue::create(s->y, CSSPrimitiveValue::CSS_PX);
+        RefPtr<CSSPrimitiveValue> blur = CSSPrimitiveValue::create(s->blur, CSSPrimitiveValue::CSS_PX);
+        RefPtr<CSSPrimitiveValue> spread = propertyID == CSSPropertyTextShadow ? 0 : CSSPrimitiveValue::create(s->spread, CSSPrimitiveValue::CSS_PX);
+        RefPtr<CSSPrimitiveValue> style = propertyID == CSSPropertyTextShadow || s->style == Normal ? 0 : CSSPrimitiveValue::createIdentifier(CSSValueInset);
+        RefPtr<CSSPrimitiveValue> color = CSSPrimitiveValue::createColor(s->color.rgb());
+        list->prepend(ShadowValue::create(x.release(), y.release(), blur.release(), spread.release(), style.release(), color.release()));
+    }
+    return list.release();
+}
+
 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int propertyID) const
 {
     return getPropertyCSSValue(propertyID, UpdateLayout);
@@ -777,7 +780,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
         case CSSPropertyWebkitBoxReflect:
             return valueForReflection(style->boxReflect());
         case CSSPropertyWebkitBoxShadow:
-            return valueForShadow(style->boxShadow(), static_cast<CSSPropertyID>(propertyID));
+            return valueForShadow(style->boxShadow(), propertyID);
         case CSSPropertyCaptionSide:
             return CSSPrimitiveValue::create(style->captionSide());
         case CSSPropertyClear:
@@ -1061,7 +1064,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
         case CSSPropertyTextIndent:
             return CSSPrimitiveValue::create(style->textIndent());
         case CSSPropertyTextShadow:
-            return valueForShadow(style->textShadow(), static_cast<CSSPropertyID>(propertyID));
+            return valueForShadow(style->textShadow(), propertyID);
         case CSSPropertyTextRendering:
             return CSSPrimitiveValue::create(style->fontDescription().textRenderingMode());
         case CSSPropertyTextOverflow:
index c1f34c3..842a995 100644 (file)
@@ -27,6 +27,7 @@
 namespace WebCore {
 
 class CSSMutableStyleDeclaration;
+class ShadowData;
 
 enum EUpdateLayout { DoNotUpdateLayout = false, UpdateLayout = true };
 
@@ -66,6 +67,8 @@ private:
     virtual String removeProperty(int propertyID, ExceptionCode&);
     virtual void setProperty(int propertyId, const String& value, bool important, ExceptionCode&);
 
+    PassRefPtr<CSSValue> valueForShadow(const ShadowData*, int) const;
+
     RefPtr<Node> m_node;
 };
 
index 02b1ad8..4299cf0 100644 (file)
@@ -3744,7 +3744,11 @@ bool CSSParser::parseShadow(int propId, bool important)
                 // Other operators aren't legal or we aren't done with the current shadow
                 // value.  Treat as invalid.
                 return false;
-            
+#if ENABLE(SVG)
+            // -webkit-shadow does not support multiple values.
+            if (static_cast<CSSPropertyID>(propId) == CSSPropertyWebkitShadow)
+                return false;
+#endif            
             // The value is good.  Commit it.
             context.commitValue();
         } else if (validUnit(val, FLength, true)) {
index e8492d4..1f19983 100644 (file)
@@ -166,6 +166,8 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getSVGPropertyCSSValue(int pro
 
             return 0;
         }
+        case CSSPropertyWebkitShadow:
+            return valueForShadow(svgStyle->shadow(), propertyID);
         case CSSPropertyMarker:
         case CSSPropertyEnableBackground:
         case CSSPropertyColorProfile:
index 0ae9fbc..8730e49 100644 (file)
@@ -257,6 +257,11 @@ bool CSSParser::parseSVGValue(int propId, bool important)
                 m_valueList->next();
         }
         break;
+    case CSSPropertyWebkitShadow:
+        if (id == CSSValueNone)
+            valid_primitive = true;
+        else
+            return parseShadow(propId, important);
 
     /* shorthand properties */
     case CSSPropertyMarker:
index e400ffe..809eabe 100644 (file)
@@ -46,3 +46,5 @@ glyph-orientation-vertical
 kerning
 text-anchor
 writing-mode
+
+-webkit-shadow
index b81b4f2..7e4483f 100644 (file)
@@ -37,6 +37,7 @@
 #include "CSSPropertyNames.h"
 #include "CSSValueList.h"
 #include "Document.h"
+#include "ShadowValue.h"
 #include "SVGColor.h"
 #include "SVGNames.h"
 #include "SVGPaint.h"
@@ -526,6 +527,35 @@ void CSSStyleSelector::applySVGProperty(int id, CSSValue* value)
             // Silently ignoring this property for now
             // http://bugs.webkit.org/show_bug.cgi?id=6022
             break;
+        case CSSPropertyWebkitShadow: {
+            if (isInherit)
+                return svgstyle->setShadow(m_parentStyle->svgStyle()->shadow() ? new ShadowData(*m_parentStyle->svgStyle()->shadow()) : 0);
+            if (isInitial || primitiveValue) // initial | none
+                return svgstyle->setShadow(0);
+
+            if (!value->isValueList())
+                return;
+
+            float zoomFactor = m_style->effectiveZoom();
+
+            CSSValueList *list = static_cast<CSSValueList*>(value);
+            ASSERT(list->length() == 1);
+            ShadowValue* item = static_cast<ShadowValue*>(list->itemWithoutBoundsCheck(0));
+            int x = item->x->computeLengthInt(style(), m_rootElementStyle, zoomFactor);
+            int y = item->y->computeLengthInt(style(), m_rootElementStyle, zoomFactor);
+            int blur = item->blur ? item->blur->computeLengthInt(style(), m_rootElementStyle, zoomFactor) : 0;
+            Color color;
+            if (item->color)
+                color = getColorFromPrimitiveValue(item->color.get());
+
+            // -webkit-shadow does should not have a spread or style
+            ASSERT(!item->spread);
+            ASSERT(!item->style);
+                
+            ShadowData* shadowData = new ShadowData(x, y, blur, 0, Normal, color.isValid() ? color : Color::transparent);
+            svgstyle->setShadow(shadowData);
+            return;
+        }
         default:
             // If you crash here, it's because you added a css property and are not handling it
             // in either this switch statement or the one in CSSStyleSelector::applyProperty
index 0f295e4..ea087f9 100644 (file)
@@ -94,6 +94,9 @@ void SVGRenderBase::prepareToRenderSVGContent(RenderObject* object, RenderObject
         paintInfo.context->beginTransparencyLayer(opacity);
     }
 
+    if (ShadowData* shadow = svgStyle->shadow())
+        paintInfo.context->setShadow(IntSize(shadow->x, shadow->y), shadow->blur, shadow->color); 
+
 #if ENABLE(FILTERS)
     AtomicString filterId(svgStyle->filter());
 #endif
index 1289b06..e8827c4 100644 (file)
@@ -51,6 +51,7 @@ SVGRenderStyle::SVGRenderStyle()
     mask = defaultStyle->mask;
     misc = defaultStyle->misc;
     markers = defaultStyle->markers;
+    shadowSVG = defaultStyle->shadowSVG;
 
     setBitDefaults();
 }
@@ -67,6 +68,7 @@ SVGRenderStyle::SVGRenderStyle(CreateDefaultType)
     mask.init();
     misc.init();
     markers.init();
+    shadowSVG.init();
 }
 
 SVGRenderStyle::SVGRenderStyle(const SVGRenderStyle& other)
@@ -80,6 +82,7 @@ SVGRenderStyle::SVGRenderStyle(const SVGRenderStyle& other)
     mask = other.mask;
     misc = other.misc;
     markers = other.markers;
+    shadowSVG = other.shadowSVG;
 
     svg_inherited_flags = other.svg_inherited_flags;
     svg_noninherited_flags = other.svg_noninherited_flags;
@@ -93,7 +96,7 @@ bool SVGRenderStyle::operator==(const SVGRenderStyle& o) const
 {
     return (fill == o.fill && stroke == o.stroke && text == o.text &&
         stops == o.stops && clip == o.clip && mask == o.mask &&
-        misc == o.misc && markers == o.markers &&
+        misc == o.misc && markers == o.markers && shadowSVG == o.shadowSVG &&
         svg_inherited_flags == o.svg_inherited_flags &&
         svg_noninherited_flags == o.svg_noninherited_flags);
 }
index e50d349..12477d7 100644 (file)
@@ -30,6 +30,7 @@
 #include "GraphicsTypes.h"
 #include "SVGPaint.h"
 #include "SVGRenderStyleDefs.h"
+#include "ShadowData.h"
 
 #include <wtf/Platform.h>
 
@@ -98,6 +99,8 @@ namespace WebCore {
         SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(Color, misc, lightingColor, LightingColor, lightingColor, Color(255, 255, 255))
         SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL_REFCOUNTED(CSSValue, misc, baselineShiftValue, BaselineShiftValue, baselineShiftValue, 0)
 
+        SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL_OWNPTR(ShadowData, shadowSVG, shadow, Shadow, shadow, 0)
+
         // convenience
         bool hasStroke() const { return (strokePaint()->paintType() != SVGPaint::SVG_PAINTTYPE_NONE); }
         bool hasFill() const { return (fillPaint()->paintType() != SVGPaint::SVG_PAINTTYPE_NONE); }
@@ -172,6 +175,7 @@ namespace WebCore {
         DataRef<StyleClipData> clip;
         DataRef<StyleMaskData> mask;
         DataRef<StyleMiscData> misc;
+        DataRef<StyleShadowSVGData> shadowSVG;
 
     private:
         enum CreateDefaultType { CreateDefault };
index f5faad3..2ed1d8f 100644 (file)
@@ -213,6 +213,25 @@ bool StyleMiscData::operator==(const StyleMiscData &other) const
            && baselineShiftValue == other.baselineShiftValue;
 }
 
+StyleShadowSVGData::StyleShadowSVGData()
+{
+}
+
+StyleShadowSVGData::StyleShadowSVGData(const StyleShadowSVGData& other)
+    : RefCounted<StyleShadowSVGData>()
+    , shadow(other.shadow ? new ShadowData(*other.shadow) : 0)
+{
+}
+
+bool StyleShadowSVGData::operator==(const StyleShadowSVGData& other) const
+{
+    if ((!shadow && other.shadow) || (shadow && !other.shadow))
+        return false;
+    if (shadow && other.shadow && (*shadow != *other.shadow))
+        return false;
+    return true;
+}
+
 #endif // ENABLE(SVG)
 
 // vim:ts=4:noet
index c0f5d4e..f4cf932 100644 (file)
@@ -33,6 +33,9 @@
 #include "Color.h"
 #include "Path.h"
 #include "PlatformString.h"
+#include "ShadowData.h"
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
 
     } \
     static Data* initial##Type() { return Initial; }
 
+#define SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL_OWNPTR(Data, Group, Variable, Type, Name, Initial) \
+    Data* Name() const { return Group->Variable.get(); } \
+    void set##Type(Data* obj) { \
+        Group.access()->Variable.set(obj); \
+    } \
+    static Data* initial##Type() { return Initial; }
+
 #define SVG_RS_SET_VARIABLE(Group, Variable, Value) \
     if (!(Group->Variable == Value)) \
         Group.access()->Variable = Value;
@@ -279,6 +289,24 @@ namespace WebCore {
         StyleMiscData();
         StyleMiscData(const StyleMiscData&);
     };
+    
+    class StyleShadowSVGData : public RefCounted<StyleShadowSVGData> {
+    public:
+        static PassRefPtr<StyleShadowSVGData> create() { return adoptRef(new StyleShadowSVGData); }
+        PassRefPtr<StyleShadowSVGData> copy() const { return adoptRef(new StyleShadowSVGData(*this)); }
+        
+        bool operator==(const StyleShadowSVGData& other) const;
+        bool operator!=(const StyleShadowSVGData& other) const
+        {
+            return !(*this == other);
+        }
+
+        OwnPtr<ShadowData> shadow;
+
+    private:
+        StyleShadowSVGData();
+        StyleShadowSVGData(const StyleShadowSVGData& other);
+    };
 
 } // namespace WebCore