+2007-08-26 Nikolas Zimmermann <zimmermann@kde.org>
+
+ Rubberstamped by Mark.
+
+ Add missing SVG filter testcase (forgot to include in last commit).
+
+ * svg/batik/filters/filterRegions-expected.checksum: Added.
+ * svg/batik/filters/filterRegions-expected.png: Added.
+ * svg/batik/filters/filterRegions-expected.txt: Added.
+ * svg/batik/filters/filterRegions.svg: Added.
+
+2007-08-22 Rob Buis <buis@kde.org>
+
+ Reviewed by Sam.
+
+ http://bugs.webkit.org/show_bug.cgi?id=12059
+ SVG colors have two separate parsing paths (one CSS and one SVGColor::setRGBColor)
+
+ Improved test result.
+
+ * svg/dom/rgb-color-parser-expected.txt:
+
2007-08-21 Nikolas Zimmermann <zimmermann@kde.org>
Reviewed by Oliver.
--- /dev/null
+6244b77fe52506fc9cdcc643ff1f9cd2
\ No newline at end of file
--- /dev/null
+KCanvasResource {id="filterRegion_0" [type=FILTER] [bounding box=at (-10.00%,-10.00%) size 120.00%x120.00%] [effects=[[type=FLOOD] [subregion="at (0,0) size 1x1"] [color=#FF0000] [opacity=1.00]]]}
+KCanvasResource {id="filterRegion_1" [type=FILTER] [bounding box=at (20,30) size 50x40] [bounding box mode=0] [effects=[[type=FLOOD] [subregion="at (0,0) size 1x1"] [color=#FF0000] [opacity=1.00]]]}
+KCanvasResource {id="filterRegion_2" [type=FILTER] [bounding box=at (20,30) size 50x40] [bounding box mode=0] [effects=[[type=FLOOD] [subregion="at (25,35) size 50x40"] [color=#FF0000] [opacity=1.00]]]}
+KCanvasResource {id="filterRegion_3" [type=FILTER] [bounding box=at (20,30) size 50x40] [bounding box mode=0] [effects=[[type=FLOOD] [subregion="at (0,0) size 1x20"] [color=#FF0000] [opacity=1.00]]]}
+KCanvasResource {id="filterRegion_4" [type=FILTER] [bounding box=at (20,30) size 50x40] [bounding box mode=0] [effects=[[type=FLOOD] [subregion="at (0,0) size 25x1"] [color=#FF0000] [opacity=1.00]]]}
+KCanvasResource {id="filterRegion_5" [type=FILTER] [bounding box=at (20,30) size 50x40] [bounding box mode=0] [effects=[[type=FLOOD] [subregion="at (0,10) size 1x1"] [color=#FF0000] [opacity=1.00]]]}
+KCanvasResource {id="filterRegion_6" [type=FILTER] [bounding box=at (20,30) size 50x40] [bounding box mode=0] [effects=[[type=FLOOD] [subregion="at (10,0) size 1x1"] [color=#FF0000] [opacity=1.00]]]}
+KCanvasResource {id="filterRegion_2_0" [type=FILTER] [bounding box=at (-10.00%,-10.00%) size 120.00%x120.00%] [effect bounding box mode=1] [effects=[[type=FLOOD] [subregion="at (0,0) size 1x1"] [color=#FF0000] [opacity=1.00]]]}
+KCanvasResource {id="filterRegion_2_1" [type=FILTER] [bounding box=at (-45,-50) size 540x600] [bounding box mode=0] [effect bounding box mode=1] [effects=[[type=FLOOD] [subregion="at (0,0) size 1x1"] [color=#FF0000] [opacity=1.00]]]}
+KCanvasResource {id="filterRegion_2_2" [type=FILTER] [bounding box=at (-45,-50) size 540x600] [bounding box mode=0] [effect bounding box mode=1] [effects=[[type=FLOOD] [subregion="at (0,0) size 1x1"] [color=#FF0000] [opacity=1.00]]]}
+KCanvasResource {id="filterRegion_2_3" [type=FILTER] [bounding box=at (-45,-50) size 540x600] [bounding box mode=0] [effect bounding box mode=1] [effects=[[type=FLOOD] [subregion="at (0.25,0.50) size 0.50x0.25"] [color=#FF0000] [opacity=1.00]]]}
+KCanvasResource {id="filterRegion_2_4" [type=FILTER] [bounding box=at (-45,-50) size 540x600] [bounding box mode=0] [effect bounding box mode=1] [effects=[[type=FLOOD] [subregion="at (0.25,0.50) size 0.50x0.25"] [color=#FF0000] [opacity=1.00]]]}
+KCanvasResource {id="filterRegion_2_5" [type=FILTER] [bounding box=at (20,30) size 50x40] [bounding box mode=0] [effect bounding box mode=1] [effects=[[type=FLOOD] [subregion="at (0,0.50) size 1x0.25"] [color=#FF0000] [opacity=1.00]]]}
+KCanvasResource {id="filterRegion_3_0" [type=FILTER] [bounding box=at (-10.00%,-10.00%) size 120.00%x120.00%] [effects=[[type=FLOOD] [subregion="at (0,0) size 1x1"] [color=#FF0000] [opacity=1.00]]]}
+KCanvasResource {id="filterRegion_3_1" [type=FILTER] [bounding box=at (-10.00%,-10.00%) size 120.00%x120.00%] [effects=[[type=FLOOD] [subregion="at (20,30) size 20x25"] [color=#FF0000] [opacity=1.00]]]}
+KCanvasResource {id="filterRegion_3_2" [type=FILTER] [bounding box=at (-100.00%,-100.00%) size 200.00%x200.00%] [effects=[[type=FLOOD] [subregion="at (0,0) size 1x1"] [color=#FF0000] [opacity=1.00]]]}
+KCanvasResource {id="filterRegion_3_3" [type=FILTER] [bounding box=at (-50.00%,-50.00%) size 75.00%x75.00%] [effects=[[type=FLOOD] [subregion="at (0,0) size 1x1"] [color=#FF0000] [opacity=1.00]]]}
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 450x500
+ RenderSVGRoot {svg} at (9,26) size 20000320x3124
+ RenderSVGText {text} at (225,40) size 89x18 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,-14) size 89x18
+ chunk 1 text run 1 at (225.00,40.00) startOffset 0 endOffset 14 width 89.00: "Filter Regions"
+ RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+ RenderSVGContainer {g} at (9,59) size 20000320x3091 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,50.00)}]
+ RenderSVGContainer {g} at (259,119) size 121.50x81.50 [transform={m=((1.00,0.00)(0.00,1.00)) t=(240.00,95.00)}]
+ RenderPath {rect} at (270,145) size 100x50 [fill={[type=SOLID] [color=#000000]}] [filter=#filterRegion_0] [data="M0.00,0.00L100.00,0.00L100.00,50.00L0.00,50.00"]
+ RenderPath {rect} at (259.50,139.50) size 121x61 [stroke={[type=SOLID] [color=#000000] [opacity=0.50]}] [data="M-10.00,-5.00L110.00,-5.00L110.00,55.00L-10.00,55.00"]
+ RenderSVGText {text} at (-11,-10) size 112x20 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,-16) size 112x20
+ chunk 1 (middle anchor) text run 1 at (-11.00,-10.00) startOffset 0 endOffset 14 width 112.00: "filterRegion_0"
+ RenderPath {rect} at (30,3050) size 20000000x25 [fill={[type=SOLID] [color=#000000]}] [filter=#filterRegion_1] [data="M0.00,3000.00L20000000.00,3000.00L20000000.00,3025.00L0.00,3025.00"]
+ RenderPath {rect} at (49.50,79.50) size 51x41 [stroke={[type=SOLID] [color=#000000] [opacity=0.50]}] [data="M20.00,30.00L70.00,30.00L70.00,70.00L20.00,70.00"]
+ RenderSVGText {text} at (-11,25) size 112x19 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,-16) size 112x19
+ chunk 1 (middle anchor) text run 1 at (-11.00,25.00) startOffset 0 endOffset 14 width 112.00: "filterRegion_1"
+ RenderSVGContainer {g} at (119,59) size 20000012x3016 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,0.00)}]
+ RenderPath {rect} at (130,3050) size 20000000x25 [fill={[type=SOLID] [color=#000000]}] [filter=#filterRegion_2] [data="M0.00,3000.00L20000000.00,3000.00L20000000.00,3025.00L0.00,3025.00"]
+ RenderPath {rect} at (154.50,84.50) size 46x36 [stroke={[type=SOLID] [color=#000000] [opacity=0.50]}] [data="M25.00,35.00L70.00,35.00L70.00,70.00L25.00,70.00"]
+ RenderSVGText {text} at (-11,25) size 112x19 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,-16) size 112x19
+ chunk 1 (middle anchor) text run 1 at (-11.00,25.00) startOffset 0 endOffset 14 width 112.00: "filterRegion_2"
+ RenderSVGContainer {g} at (219,59) size 20000012x3016 [transform={m=((1.00,0.00)(0.00,1.00)) t=(200.00,0.00)}]
+ RenderPath {rect} at (230,3050) size 20000000x25 [fill={[type=SOLID] [color=#000000]}] [filter=#filterRegion_3] [data="M0.00,3000.00L20000000.00,3000.00L20000000.00,3025.00L0.00,3025.00"]
+ RenderPath {rect} at (249.50,79.50) size 51x21 [stroke={[type=SOLID] [color=#000000] [opacity=0.50]}] [data="M20.00,30.00L70.00,30.00L70.00,50.00L20.00,50.00"]
+ RenderSVGText {text} at (-11,25) size 112x19 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,-16) size 112x19
+ chunk 1 (middle anchor) text run 1 at (-11.00,25.00) startOffset 0 endOffset 14 width 112.00: "filterRegion_3"
+ RenderSVGContainer {g} at (319,59) size 20000012x3016 [transform={m=((1.00,0.00)(0.00,1.00)) t=(300.00,0.00)}]
+ RenderPath {rect} at (330,3050) size 20000000x25 [fill={[type=SOLID] [color=#000000]}] [filter=#filterRegion_4] [data="M0.00,3000.00L20000000.00,3000.00L20000000.00,3025.00L0.00,3025.00"]
+ RenderPath {rect} at (349.50,79.50) size 26x41 [stroke={[type=SOLID] [color=#000000] [opacity=0.50]}] [data="M20.00,30.00L45.00,30.00L45.00,70.00L20.00,70.00"]
+ RenderSVGText {text} at (-11,25) size 112x19 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,-16) size 112x19
+ chunk 1 (middle anchor) text run 1 at (-11.00,25.00) startOffset 0 endOffset 14 width 112.00: "filterRegion_4"
+ RenderSVGContainer {g} at (19,134) size 20000012x3016 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,75.00)}]
+ RenderPath {rect} at (30,3125) size 20000000x25 [fill={[type=SOLID] [color=#000000]}] [filter=#filterRegion_5] [data="M0.00,3000.00L20000000.00,3000.00L20000000.00,3025.00L0.00,3025.00"]
+ RenderPath {rect} at (49.50,154.50) size 51x21 [stroke={[type=SOLID] [color=#000000] [opacity=0.50]}] [data="M20.00,30.00L70.00,30.00L70.00,50.00L20.00,50.00"]
+ RenderSVGText {text} at (-11,25) size 112x19 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,-16) size 112x19
+ chunk 1 (middle anchor) text run 1 at (-11.00,25.00) startOffset 0 endOffset 14 width 112.00: "filterRegion_5"
+ RenderSVGContainer {g} at (130,3125) size 20000000x25 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,75.00)}] [filter=#filterRegion_6]
+ RenderPath {rect} at (130,3125) size 20000000x25 [fill={[type=SOLID] [color=#000000]}] [data="M0.00,3000.00L20000000.00,3000.00L20000000.00,3025.00L0.00,3025.00"]
+ RenderSVGContainer {g} at (119,134) size 112x61.50 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,75.00)}]
+ RenderPath {rect} at (149.50,154.50) size 41x41 [stroke={[type=SOLID] [color=#000000] [opacity=0.50]}] [data="M20.00,30.00L60.00,30.00L60.00,70.00L20.00,70.00"]
+ RenderSVGText {text} at (-11,25) size 112x19 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,-16) size 112x19
+ chunk 1 (middle anchor) text run 1 at (-11.00,25.00) startOffset 0 endOffset 14 width 112.00: "filterRegion_6"
+ RenderSVGContainer {g} at (109,294) size 132x64 [transform={m=((1.00,0.00)(0.00,1.00)) t=(120.00,280.00)}]
+ RenderPath {rect} at (150,330) size 50x25 [fill={[type=SOLID] [color=#000000]}] [filter=#filterRegion_2_0] [data="M0.00,0.00L50.00,0.00L50.00,25.00L0.00,25.00"]
+ RenderPath {rect} at (144.50,327) size 61x31 [stroke={[type=SOLID] [color=#000000] [opacity=0.50]}] [data="M-5.00,-2.50L55.00,-2.50L55.00,27.50L-5.00,27.50"]
+ RenderSVGText {text} at (-41,-20) size 132x20 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,-16) size 132x20
+ chunk 1 (middle anchor) text run 1 at (-41.00,-20.00) startOffset 0 endOffset 16 width 132.00: "filterRegion_2_0"
+ RenderSVGContainer {g} at (50,240) size 50x40 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,160.00)}] [filter=#filterRegion_2_1]
+ RenderPath {rect} at (50,240) size 50x40 [fill={[type=SOLID] [color=#000000]}] [data="M20.00,30.00L70.00,30.00L70.00,70.00L20.00,70.00"]
+ RenderSVGContainer {g} at (9,219) size 132x61.50 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,160.00)}]
+ RenderPath {rect} at (49.50,239.50) size 51x41 [stroke={[type=SOLID] [color=#000000] [opacity=0.50]}] [data="M20.00,30.00L70.00,30.00L70.00,70.00L20.00,70.00"]
+ RenderSVGText {text} at (-21,25) size 132x19 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,-16) size 132x19
+ chunk 1 (middle anchor) text run 1 at (-21.00,25.00) startOffset 0 endOffset 16 width 132.00: "filterRegion_2_1"
+ RenderSVGContainer {g} at (150,240) size 50x40 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,160.00)}]
+ RenderPath {rect} at (150,240) size 50x40 [fill={[type=SOLID] [color=#000000]}] [filter=#filterRegion_2_2] [data="M20.00,30.00L70.00,30.00L70.00,70.00L20.00,70.00"]
+ RenderSVGContainer {g} at (109,219) size 132x61.50 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,160.00)}]
+ RenderPath {rect} at (149.50,239.50) size 51x41 [stroke={[type=SOLID] [color=#000000] [opacity=0.50]}] [data="M20.00,30.00L70.00,30.00L70.00,70.00L20.00,70.00"]
+ RenderSVGText {text} at (-21,25) size 132x19 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,-16) size 132x19
+ chunk 1 (middle anchor) text run 1 at (-21.00,25.00) startOffset 0 endOffset 16 width 132.00: "filterRegion_2_2"
+ RenderSVGContainer {g} at (250,240) size 50x40 [transform={m=((1.00,0.00)(0.00,1.00)) t=(200.00,160.00)}] [filter=#filterRegion_2_3]
+ RenderPath {rect} at (250,240) size 50x40 [fill={[type=SOLID] [color=#000000]}] [data="M20.00,30.00L70.00,30.00L70.00,70.00L20.00,70.00"]
+ RenderSVGContainer {g} at (209,219) size 132x51.50 [transform={m=((1.00,0.00)(0.00,1.00)) t=(200.00,160.00)}]
+ RenderPath {rect} at (262,259.50) size 26x11 [stroke={[type=SOLID] [color=#000000] [opacity=0.50]}] [data="M32.50,50.00L57.50,50.00L57.50,60.00L32.50,60.00"]
+ RenderSVGText {text} at (-21,25) size 132x19 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,-16) size 132x19
+ chunk 1 (middle anchor) text run 1 at (-21.00,25.00) startOffset 0 endOffset 16 width 132.00: "filterRegion_2_3"
+ RenderSVGContainer {g} at (350,240) size 50x40 [transform={m=((1.00,0.00)(0.00,1.00)) t=(300.00,160.00)}] [filter=#filterRegion_2_4]
+ RenderPath {rect} at (350,240) size 50x40 [fill={[type=SOLID] [color=#000000]}] [data="M20.00,30.00L70.00,30.00L70.00,70.00L20.00,70.00"]
+ RenderSVGContainer {g} at (309,219) size 132x51.50 [transform={m=((1.00,0.00)(0.00,1.00)) t=(300.00,160.00)}]
+ RenderPath {rect} at (362,259.50) size 26x11 [stroke={[type=SOLID] [color=#000000] [opacity=0.50]}] [data="M32.50,50.00L57.50,50.00L57.50,60.00L32.50,60.00"]
+ RenderSVGText {text} at (-21,25) size 132x19 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,-16) size 132x19
+ chunk 1 (middle anchor) text run 1 at (-21.00,25.00) startOffset 0 endOffset 16 width 132.00: "filterRegion_2_4"
+ RenderSVGContainer {g} at (50,325) size 50x40 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,245.00)}] [filter=#filterRegion_2_5]
+ RenderPath {rect} at (50,325) size 50x40 [fill={[type=SOLID] [color=#000000]}] [data="M20.00,30.00L70.00,30.00L70.00,70.00L20.00,70.00"]
+ RenderSVGContainer {g} at (9,304) size 132x51.50 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,245.00)}]
+ RenderPath {rect} at (49.50,344.50) size 51x11 [stroke={[type=SOLID] [color=#000000] [opacity=0.50]}] [data="M20.00,50.00L70.00,50.00L70.00,60.00L20.00,60.00"]
+ RenderSVGText {text} at (-21,25) size 132x19 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,-16) size 132x19
+ chunk 1 (middle anchor) text run 1 at (-21.00,25.00) startOffset 0 endOffset 16 width 132.00: "filterRegion_2_5"
+ RenderSVGContainer {g} at (30,380) size 450x450 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,330.00)}] [filter=#filterRegion_3_1]
+ RenderPath {rect} at (30,380) size 450x450 [fill={[type=SOLID] [color=#000000]}] [data="M0.00,0.00L450.00,0.00L450.00,450.00L0.00,450.00"]
+ RenderSVGContainer {g} at (9,389) size 132x46.50 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,330.00)}]
+ RenderPath {rect} at (49.50,409.50) size 21x26 [stroke={[type=SOLID] [color=#000000] [opacity=0.50]}] [data="M20.00,30.00L40.00,30.00L40.00,55.00L20.00,55.00"]
+ RenderSVGText {text} at (-21,25) size 132x19 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,-16) size 132x19
+ chunk 1 (middle anchor) text run 1 at (-21.00,25.00) startOffset 0 endOffset 16 width 132.00: "filterRegion_3_1"
+ RenderSVGContainer {g} at (350,380) size 40x50 [transform={m=((1.00,0.00)(0.00,1.00)) t=(320.00,330.00)}] [filter=#filterRegion_3_0]
+ RenderPath {rect} at (350,380) size 40x50 [fill={[type=SOLID] [color=#000000]}] [data="M0.00,0.00L40.00,0.00L40.00,50.00L0.00,50.00"]
+ RenderSVGContainer {g} at (329,374.50) size 132x61 [transform={m=((1.00,0.00)(0.00,1.00)) t=(320.00,330.00)}]
+ RenderPath {rect} at (345.50,374.50) size 49x61 [stroke={[type=SOLID] [color=#000000] [opacity=0.50]}] [data="M-4.00,-5.00L44.00,-5.00L44.00,55.00L-4.00,55.00"]
+ RenderSVGText {text} at (-21,25) size 132x19 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,-16) size 132x19
+ chunk 1 (middle anchor) text run 1 at (-21.00,25.00) startOffset 0 endOffset 16 width 132.00: "filterRegion_3_0"
+ RenderSVGContainer {g} at (180,420) size 50x40 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,330.00)}] [filter=#filterRegion_3_2]
+ RenderPath {rect} at (180,420) size 50x40 [fill={[type=SOLID] [color=#000000]}] [data="M50.00,40.00L100.00,40.00L100.00,80.00L50.00,80.00"]
+ RenderSVGContainer {g} at (109,379.50) size 132x81 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,330.00)}]
+ RenderPath {rect} at (129.50,379.50) size 101x81 [stroke={[type=SOLID] [color=#000000] [opacity=0.50]}] [data="M0.00,0.00L100.00,0.00L100.00,80.00L0.00,80.00"]
+ RenderSVGText {text} at (-21,25) size 132x19 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,-16) size 132x19
+ chunk 1 (middle anchor) text run 1 at (-21.00,25.00) startOffset 0 endOffset 16 width 132.00: "filterRegion_3_2"
+ RenderSVGContainer {g} at (280,420) size 50x40 [transform={m=((1.00,0.00)(0.00,1.00)) t=(200.00,330.00)}] [filter=#filterRegion_3_3]
+ RenderPath {rect} at (280,420) size 50x40 [fill={[type=SOLID] [color=#000000]}] [data="M50.00,40.00L100.00,40.00L100.00,80.00L50.00,80.00"]
+ RenderSVGContainer {g} at (209,389) size 132x41.50 [transform={m=((1.00,0.00)(0.00,1.00)) t=(200.00,330.00)}]
+ RenderPath {rect} at (254.50,399.50) size 38.50x31 [stroke={[type=SOLID] [color=#000000] [opacity=0.50]}] [data="M25.00,20.00L62.50,20.00L62.50,50.00L25.00,50.00"]
+ RenderSVGText {text} at (-21,25) size 132x19 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,-16) size 132x19
+ chunk 1 (middle anchor) text run 1 at (-21.00,25.00) startOffset 0 endOffset 16 width 132.00: "filterRegion_3_3"
+ RenderSVGContainer {use} at (0,0) size 0x0
--- /dev/null
+<?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">
+
+<!--
+
+ Copyright 2001 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<!-- ========================================================================= -->
+<!-- This tests validates the filter region processing for the top level -->
+<!-- filter nodes and filter primitives. For each test, a filter is invoked -->
+<!-- to render in a region specified by the filter region. In addition, a -->
+<!-- control rectangle, bounding the expected filter region is rendered on top -->
+<!-- of the filter. -->
+<!-- -->
+<!-- @author vincent.hardy@eng.sun.com -->
+<!-- @version $Id: filterRegions.svg,v 1.5 2004/08/18 07:11:50 vhardy Exp $ -->
+<!-- ========================================================================= -->
+
+<?xml-stylesheet type="text/css" href="../../resources/style/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">
+<title>FilterRegions test</title>
+
+ <text x="225" y="40" class="title">
+ Filter Regions
+ </text>
+
+ <style type="text/css">
+ <![CDATA[
+ .filterRegionControl {
+ fill: none;
+ stroke: black;
+ stroke-opacity: .5;
+ stroke-width: 1;
+
+ }
+
+ .filterRegionControlLabel {
+ fill: black;
+ font-family: Verdana;
+ font-size: 10;
+ text-anchor: middle;
+ }
+ ]]>
+ </style>
+
+ <defs>
+ <!-- ======================================================== -->
+ <!-- ======================================================== -->
+ <!-- userSpaceOnUser for filter chain and for filterPrimitive -->
+ <!-- ======================================================== -->
+ <!-- ======================================================== -->
+
+ <!-- ======================================================== -->
+ <!-- filterRegion_0 -->
+ <!-- chain region: [objectBoundingBox], undefined -->
+ <!-- flood region: [userSpaceOnUse], undefined -->
+ <!-- -->
+ <!-- Expected fill region: (0, 0, 450, 450) in user space -->
+ <!-- ======================================================== -->
+ <filter id="filterRegion_0" >
+ <feFlood style="flood-color:red;" />
+ </filter>
+
+ <!-- ======================================================== -->
+ <!-- filterRegion_1 -->
+ <!-- chain region: userSpaceOnUse, (20, 30, 50, 40) -->
+ <!-- flood region: userSpaceOnUse, undefined -->
+ <!-- -->
+ <!-- Expected fill region: (20, 30, 50, 40) in user space -->
+ <!-- ======================================================== -->
+ <filter id="filterRegion_1" filterUnits="userSpaceOnUse"
+ primitiveUnits="userSpaceOnUse"
+ x="20" y="30" width="50" height="40">
+ <feFlood style="flood-color:red" />
+ </filter>
+
+ <!-- ======================================================== -->
+ <!-- filterRegion_2 -->
+ <!-- chain region: userSpaceOnUse, (20, 30, 50, 40) -->
+ <!-- flood region: userSpaceOnUse, (25, 35, 50, 40) -->
+ <!-- -->
+ <!-- Expected fill region: (25, 35, 45, 35) in user space -->
+ <!-- ======================================================== -->
+ <filter id="filterRegion_2" filterUnits="userSpaceOnUse"
+ primitiveUnits="userSpaceOnUse"
+ x="20" y="30" width="50" height="40">
+ <feFlood style="flood-color:red" x="25" y="35" width="50" height="40"/>
+ </filter>
+
+ <!-- ======================================================== -->
+ <!-- filterRegion_3 -->
+ <!-- chain region: userSpaceOnUse, (20, 30, 50, 40) -->
+ <!-- flood region: userSpaceOnUse, (XX, XX, XX, 20) -->
+ <!-- -->
+ <!-- Expected fill region: (20, 30, 50, 20) in user space -->
+ <!-- ======================================================== -->
+ <filter id="filterRegion_3" filterUnits="userSpaceOnUse"
+ primitiveUnits="userSpaceOnUse"
+ x="20" y="30" width="50" height="40">
+ <feFlood style="flood-color:red" height="20"/>
+ </filter>
+
+ <!-- ======================================================== -->
+ <!-- filterRegion_4 -->
+ <!-- chain region: userSpaceOnUse, (20, 30, 50, 40) -->
+ <!-- flood region: userSpaceOnUse, (XX, XX, 25, XX) -->
+ <!-- -->
+ <!-- Expected fill region: (20, 30, 25, 40) in user space -->
+ <!-- ======================================================== -->
+ <filter id="filterRegion_4" filterUnits="userSpaceOnUse"
+ primitiveUnits="userSpaceOnUse"
+ x="20" y="30" width="50" height="40">
+ <feFlood style="flood-color:red" width="25"/>
+ </filter>
+
+ <!-- ======================================================== -->
+ <!-- filterRegion_5 -->
+ <!-- chain region: userSpaceOnUse, (20, 30, 50, 40) -->
+ <!-- flood region: userSpaceOnUse, (XX, 10, XX, XX) -->
+ <!-- -->
+ <!-- Expected fill region: (20, 30, 50, 20) in user space -->
+ <!-- ======================================================== -->
+ <filter id="filterRegion_5" filterUnits="userSpaceOnUse"
+ primitiveUnits="userSpaceOnUse"
+ x="20" y="30" width="50" height="40">
+ <feFlood style="flood-color:red" y="10"/>
+ </filter>
+
+ <!-- ======================================================== -->
+ <!-- filterRegion_6 -->
+ <!-- chain region: userSpaceOnUse, (20, 30, 50, 40) -->
+ <!-- flood region: userSpaceOnUse, (10, XX, XX, XX) -->
+ <!-- -->
+ <!-- Expected fill region: (20, 30, 40, 40) in user space -->
+ <!-- ======================================================== -->
+ <filter id="filterRegion_6" filterUnits="userSpaceOnUse"
+ primitiveUnits="userSpaceOnUse"
+ x="20" y="30" width="50" height="40">
+ <feFlood style="flood-color:red" x="10"/>
+ </filter>
+
+
+ <!-- ======================================================== -->
+ <!-- ======================================================== -->
+ <!-- userSpaceOnUse for filter chain and object bounding box -->
+ <!-- for filter primitive -->
+ <!-- ======================================================== -->
+ <!-- ======================================================== -->
+
+ <!-- ======================================================== -->
+ <!-- filterRegion_2_0 -->
+ <!-- chain region: [objectBoundingBox], undefined -->
+ <!-- flood region: undefined -->
+ <!-- -->
+ <!-- Expected fill region: (-10%, -10%, 120%, 120%) in user -->
+ <!-- space -->
+ <!-- ======================================================== -->
+ <filter id="filterRegion_2_0" primitiveUnits="objectBoundingBox">
+ <feFlood style="flood-color:red;" />
+ </filter>
+
+ <!-- ======================================================== -->
+ <!-- filterRegion_2_1 -->
+ <!-- chain region: userSpaceOnUse, undefined -->
+ <!-- flood region: objectBoundingBox, (0, 0, 1, 1) -->
+ <!-- -->
+ <!-- Expected fill region: (0, 0, 1, 1) in object bbox space -->
+ <!-- ======================================================== -->
+ <filter id="filterRegion_2_1" filterUnits="userSpaceOnUse"
+ primitiveUnits="objectBoundingBox">
+ <feFlood style="flood-color:red;" x="0" y="0" width="1" height="1"/>
+ </filter>
+
+ <!-- ======================================================== -->
+ <!-- filterRegion_2_2 -->
+ <!-- chain region: userSpaceOnUse, undefined -->
+ <!-- flood region: objectBoundingBox, (0%, 0%, 100%, 100%) -->
+ <!-- -->
+ <!-- Expected fill region: (0, 0, 1, 1) in object bbox space -->
+ <!-- ======================================================== -->
+ <filter id="filterRegion_2_2" filterUnits="userSpaceOnUse"
+ primitiveUnits="objectBoundingBox">
+ <feFlood style="flood-color:red" x="0%" y="0%" width="100%" height="100%"/>
+ </filter>
+
+ <!-- ======================================================== -->
+ <!-- filterRegion_2_3 -->
+ <!-- chain region: userSpaceOnUse, undefined -->
+ <!-- flood region: objectBoundingBox, (.25, 50%, .5, 25%) -->
+ <!-- -->
+ <!-- Expected fill region: (.25, .5, .5, .25) in object bbox -->
+ <!-- space -->
+ <!-- ======================================================== -->
+
+ <filter id="filterRegion_2_3" filterUnits="userSpaceOnUse"
+ primitiveUnits="objectBoundingBox">
+ <feFlood style="flood-color:red" x=".25" y="50%" width=".5" height="25%"/>
+ </filter>
+
+ <!-- ======================================================== -->
+ <!-- filterRegion_2_4 -->
+ <!-- chain region: userSpaceOnUse, undefined -->
+ <!-- flood region: objectBoundingBox, (25%, .5, 50%, .25) -->
+ <!-- -->
+ <!-- Expected fill region: (.25, .5, .5, .25) in object bbox -->
+ <!-- space -->
+ <!-- ======================================================== -->
+ <filter id="filterRegion_2_4" filterUnits="userSpaceOnUse"
+ primitiveUnits="objectBoundingBox">
+ <feFlood style="flood-color:red" x="25%" y=".5" width="50%" height=".25"/>
+ </filter>
+
+ <!-- ======================================================== -->
+ <!-- filterRegion_2_5 -->
+ <!-- chain region: userSpaceOnUse, (20, 30, 50, 40) -->
+ <!-- flood region: objectBoundingBox, (XX, .5, XX, .25) -->
+ <!-- -->
+ <!-- Expected fill region: (XX, .5, XX, .25) in object bbox -->
+ <!-- (20, XX, 50, XX) in user space -->
+ <!-- ======================================================== -->
+ <filter id="filterRegion_2_5" filterUnits="userSpaceOnUse"
+ primitiveUnits="objectBoundingBox"
+ x="20" y="30" width="50" height="40">
+ <feFlood style="flood-color:red" y=".5" height=".25"/>
+ </filter>
+
+ <!-- ======================================================== -->
+ <!-- ======================================================== -->
+ <!-- userSpaceOnUse for primitive, objectBoundingBox for -->
+ <!-- filter chain. -->
+ <!-- ======================================================== -->
+ <!-- ======================================================== -->
+
+ <!-- ======================================================== -->
+ <!-- filterRegion_3_0 -->
+ <!-- chain region: objectBoundingBox, region undefined -->
+ <!-- flood region: unspecified, region undefined -->
+ <!-- -->
+ <!-- Expected fill region: (0, 0, 1, 1) in object bbox space -->
+ <!-- ======================================================== -->
+ <filter id="filterRegion_3_0" filterUnits="objectBoundingBox" >
+ <feFlood style="flood-color:red;" />
+ </filter>
+
+ <!-- ======================================================== -->
+ <!-- filterRegion_3_1 -->
+ <!-- chain region: objectBoundingBox, region undefined -->
+ <!-- flood region: userSpaceOnUse (20, 30, 20, 25) -->
+ <!-- -->
+ <!-- Expected fill region: intersection of (0, 0, 1, 1) in -->
+ <!-- bbox space and (20, 30, 20, 25) in -->
+ <!-- user space. -->
+ <!-- ======================================================== -->
+ <filter id="filterRegion_3_1" filterUnits="objectBoundingBox"
+ primitiveUnits="userSpaceOnUse">
+ <feFlood style="flood-color:red" x="20" y="30" width="20" height="25"/>
+ </filter>
+
+ <!-- ======================================================== -->
+ <!-- filterRegion_3_2 -->
+ <!-- chain region: objectBoundingBox (-1, -1, 2, 2) -->
+ <!-- flood region: userSpaceOnUse undefined -->
+ <!-- -->
+ <!-- Expected fill region:(-1, -1, 2, 2) in -->
+ <!-- bbox space -->
+ <!-- ======================================================== -->
+ <filter id="filterRegion_3_2" filterUnits="objectBoundingBox"
+ primitiveUnits="userSpaceOnUse"
+ x="-1" y="-1" width="2" height="2">
+ <feFlood style="flood-color:red" />
+ </filter>
+
+ <!-- ======================================================== -->
+ <!-- filterRegion_3_3 -->
+ <!-- chain region: objectBoundingBox (-50%, -50%, 75%, 75% -->
+ <!-- flood region: userSpaceOnUse undefined -->
+ <!-- -->
+ <!-- Expected fill region:(-.5, -.5, .75, .75) in -->
+ <!-- bbox space -->
+ <!-- ======================================================== -->
+ <filter id="filterRegion_3_3" filterUnits="objectBoundingBox"
+ primitiveUnits="userSpaceOnUse"
+ x="-50%" y="-50%" width="75%" height="75%">
+ <feFlood style="flood-color:red" />
+ </filter>
+
+ </defs>
+
+ <g transform="translate(30, 50)">
+
+ <!-- ============================ -->
+ <!-- filterRegion_0 -->
+ <!-- ============================ -->
+ <g transform="translate(240, 95)">
+ <rect x="0" y="0" width="100" height="50" style="filter:url(#filterRegion_0);" />
+ <rect class="filterRegionControl" x="-10" y="-5" width="120" height="60" />
+ <text x="45" y="-10" class="filterRegionControlLabel">filterRegion_0</text>
+ </g>
+
+ <!-- ============================ -->
+ <!-- filterRegion_1 -->
+ <!-- ============================ -->
+ <rect x="0" y="3000" width="20000000" height="25" style="filter:url(#filterRegion_1);" />
+ <rect class="filterRegionControl" x="20" y="30" width="50" height="40" />
+ <text x="45" y="25" class="filterRegionControlLabel">filterRegion_1</text>
+ <!-- ============================ -->
+ <!-- filterRegion_2 -->
+ <!-- ============================ -->
+ <g transform="translate(100, 0)">
+ <rect x="0" y="3000" width="20000000" height="25" style="filter:url(#filterRegion_2);" />
+ <rect class="filterRegionControl" x="25" y="35" width="45" height="35" />
+ <text x="45" y="25" class="filterRegionControlLabel">filterRegion_2</text>
+ </g>
+
+ <!-- ============================ -->
+ <!-- filterRegion_3 -->
+ <!-- ============================ -->
+ <g transform="translate(200, 0)">
+ <rect x="0" y="3000" width="20000000" height="25" style="filter:url(#filterRegion_3);" />
+ <rect class="filterRegionControl" x="20" y="30" width="50" height="20" />
+ <text x="45" y="25" class="filterRegionControlLabel">filterRegion_3</text>
+ </g>
+
+ <!-- ============================ -->
+ <!-- filterRegion_4 -->
+ <!-- ============================ -->
+ <g transform="translate(300, 0)">
+ <rect x="0" y="3000" width="20000000" height="25" style="filter:url(#filterRegion_4);" />
+ <rect class="filterRegionControl" x="20" y="30" width="25" height="40" />
+ <text x="45" y="25" class="filterRegionControlLabel">filterRegion_4</text>
+ </g>
+
+ <!-- ============================ -->
+ <!-- filterRegion_5 -->
+ <!-- ============================ -->
+ <g transform="translate(0, 75)">
+ <rect x="0" y="3000" width="20000000" height="25" style="filter:url(#filterRegion_5);" />
+ <rect class="filterRegionControl" x="20" y="30" width="50" height="20" />
+ <text x="45" y="25" class="filterRegionControlLabel">filterRegion_5</text>
+ </g>
+
+ <!-- ============================ -->
+ <!-- filterRegion_6 -->
+ <!-- ============================ -->
+ <g transform="translate(100, 75)" style="filter:url(#filterRegion_6);">
+ <rect x="0" y="3000" width="20000000" height="25"/>
+ </g>
+ <g transform="translate(100, 75)" >
+ <rect class="filterRegionControl" x="20" y="30" width="40" height="40" />
+ <text x="45" y="25" class="filterRegionControlLabel">filterRegion_6</text>
+ </g>
+
+ <!-- ============================ -->
+ <!-- filterRegion_2_0 -->
+ <!-- ============================ -->
+ <g transform="translate(120, 280)">
+ <rect x="0" y="0" width="50" height="25" style="filter:url(#filterRegion_2_0);" />
+ <rect class="filterRegionControl" x="-5" y="-2.5" width="60" height="30" />
+ <text x="25" y="-20" class="filterRegionControlLabel">filterRegion_2_0</text>
+ </g>
+
+ <!-- ============================ -->
+ <!-- filterRegion_2_1 -->
+ <!-- ============================ -->
+ <g transform="translate(0, 160)" style="filter:url(#filterRegion_2_1);">
+ <rect x="20" y="30" width="50" height="40" />
+ </g>
+ <g transform="translate(0, 160)">
+ <rect class="filterRegionControl" x="20" y="30" width="50" height="40" />
+ <text x="45" y="25" class="filterRegionControlLabel">filterRegion_2_1</text>
+ </g>
+
+ <!-- ============================ -->
+ <!-- filterRegion_2_2 -->
+ <!-- ============================ -->
+ <g transform="translate(100, 160)" >
+ <rect x="20" y="30" width="50" height="40" style="filter:url(#filterRegion_2_2);"/>
+ </g>
+ <g transform="translate(100, 160)">
+ <rect class="filterRegionControl" x="20" y="30" width="50" height="40" />
+ <text x="45" y="25" class="filterRegionControlLabel">filterRegion_2_2</text>
+ </g>
+
+ <!-- ============================ -->
+ <!-- filterRegion_2_3 -->
+ <!-- ============================ -->
+ <g transform="translate(200, 160)" style="filter:url(#filterRegion_2_3);">
+ <rect x="20" y="30" width="50" height="40" />
+ </g>
+ <g transform="translate(200, 160)">
+ <rect class="filterRegionControl" x="32.5" y="50" width="25" height="10" />
+ <text x="45" y="25" class="filterRegionControlLabel">filterRegion_2_3</text>
+ </g>
+
+ <!-- ============================ -->
+ <!-- filterRegion_2_4 -->
+ <!-- ============================ -->
+ <g transform="translate(300, 160)" style="filter:url(#filterRegion_2_4);">
+ <rect x="20" y="30" width="50" height="40" />
+ </g>
+ <g transform="translate(300, 160)">
+ <rect class="filterRegionControl" x="32.5" y="50" width="25" height="10" />
+ <text x="45" y="25" class="filterRegionControlLabel">filterRegion_2_4</text>
+ </g>
+
+ <!-- ============================ -->
+ <!-- filterRegion_2_5 -->
+ <!-- ============================ -->
+ <g transform="translate(0, 245)" style="filter:url(#filterRegion_2_5);">
+ <rect x="20" y="30" width="50" height="40" />
+ </g>
+ <g transform="translate(0, 245)">
+ <rect class="filterRegionControl" x="20" y="50" width="50" height="10" />
+ <text x="45" y="25" class="filterRegionControlLabel">filterRegion_2_5</text>
+ </g>
+
+ <!-- ============================ -->
+ <!-- filterRegion_3_1 -->
+ <!-- ============================ -->
+ <g transform="translate(0, 330)" style="filter:url(#filterRegion_3_1);">
+ <rect x="0" y="0" width="450" height="450" />
+ </g>
+ <g transform="translate(0, 330)">
+ <rect class="filterRegionControl" x="20" y="30" width="20" height="25" />
+ <text x="45" y="25" class="filterRegionControlLabel">filterRegion_3_1</text>
+ </g>
+
+ <!-- ============================ -->
+ <!-- filterRegion_3_0 -->
+ <!-- ============================ -->
+ <g transform="translate(320, 330)" style="filter:url(#filterRegion_3_0);">
+ <rect x="0" y="0" width="40" height="50" />
+ </g>
+ <g transform="translate(320, 330)">
+ <rect class="filterRegionControl" x="-4" y="-5" width="48" height="60" />
+ <text x="45" y="25" class="filterRegionControlLabel">filterRegion_3_0</text>
+ </g>
+
+ <!-- ============================ -->
+ <!-- filterRegion_3_2 -->
+ <!-- ============================ -->
+ <g transform="translate(100, 330)" style="filter:url(#filterRegion_3_2);">
+ <rect x="50" y="40" width="50" height="40" />
+ </g>
+ <g transform="translate(100, 330)">
+ <rect class="filterRegionControl" x="0" y="0" width="100" height="80" />
+ <text x="45" y="25" class="filterRegionControlLabel">filterRegion_3_2</text>
+ </g>
+
+ <!-- ============================ -->
+ <!-- filterRegion_3_3 -->
+ <!-- ============================ -->
+ <g transform="translate(200, 330)" style="filter:url(#filterRegion_3_3);">
+ <rect x="50" y="40" width="50" height="40" />
+ </g>
+ <g transform="translate(200, 330)">
+ <rect class="filterRegionControl" x="25" y="20" width="37.5" height="30" />
+ <text x="45" y="25" class="filterRegionControlLabel">filterRegion_3_3</text>
+ </g>
+ </g>
+
+ <!-- ============================================================= -->
+ <!-- Batik sample mark -->
+ <!-- ============================================================= -->
+ <use xlink:href="../../../batikLogo.svg#Batik_Tag_Box" />
+
+</svg>
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb( 55,.
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(263,% 1-74)e
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb( 64110, (1
-Parsed as rgb(150,3,255): rgb( 59%3 725)
+Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb( 59%3 725)
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(6e)-2- 180
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(, .579e((
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb()(
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb( )ee.%)
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(-%0%-
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(231293 16%
-Parsed as rgb(0,0,37): rgb(+-2+37)888580+9 (
+Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(+-2+37)888580+9 (
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(18 805
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(0
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(63-.693+
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb( .3.6 ,-57%7 e+6
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(1)7 +%+8 )- -.63e
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(6786).(8912%
-Parsed as rgb(0,8,0): rgb(- %8-,)886+- 9e))e
+Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(- %8-,)886+- 9e))e
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb( , 5732
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(18)(
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(3,+13%(711%9% %0 -
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(0.795e0,). %%,
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(+7).
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb((%+ 8 -74).9 +(.
-Parsed as rgb(0,255,0): rgb( 0 635+)9,- 8
+Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb( 0 635+)9,- 8
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(%4%9%%.
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(49),,4-30378 052
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(%7863
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb( 55,.
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(263,% 1-74)e
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb( 64110, (1
-Parsed as rgb(150,3,255): rgb( 59%3 725)
+Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb( 59%3 725)
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(6e)-2- 180
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(, .579e((
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb()(
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb( )ee.%)
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(-%0%-
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(231293 16%
-Parsed as rgb(0,0,37): rgb(+-2+37)888580+9 (
+Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(+-2+37)888580+9 (
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(18 805
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(0
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(63-.693+
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb( .3.6 ,-57%7 e+6
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(1)7 +%+8 )- -.63e
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(6786).(8912%
-Parsed as rgb(0,8,0): rgb(- %8-,)886+- 9e))e
+Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(- %8-,)886+- 9e))e
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb( , 5732
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(18)(
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(3,+13%(711%9% %0 -
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(0.795e0,). %%,
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(+7).
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb((%+ 8 -74).9 +(.
-Parsed as rgb(0,255,0): rgb( 0 635+)9,- 8
+Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb( 0 635+)9,- 8
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(%4%9%%.
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(49),,4-30378 052
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(%7863
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb( 55,.
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(263,% 1-74)e
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb( 64110, (1
-Parsed as rgb(150,3,255): rgb( 59%3 725)
+Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb( 59%3 725)
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(6e)-2- 180
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(, .579e((
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb()(
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb( )ee.%)
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(-%0%-
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(231293 16%
-Parsed as rgb(0,0,37): rgb(+-2+37)888580+9 (
+Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(+-2+37)888580+9 (
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(18 805
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(0
Threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: rgb(63-.693+
+2007-08-22 Rob Buis <buis@kde.org>
+
+ Reviewed by Sam.
+
+ http://bugs.webkit.org/show_bug.cgi?id=12059
+ SVG colors have two separate parsing paths (one CSS and one SVGColor::setRGBColor)
+
+ Reuse the css parser as much as possible in setRGBColor.
+
+ * css/cssparser.cpp:
+ (WebCore::CSSParser::parseColor):
+ * css/cssparser.h:
+ * editing/ApplyStyleCommand.cpp:
+ (WebCore::StyleChange::checkForLegacyHTMLStyleChange):
+ * html/CanvasGradient.cpp:
+ (WebCore::CanvasGradient::addColorStop):
+ * html/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::setShadow):
+ (WebCore::CanvasRenderingContext2D::applyShadow):
+ * html/CanvasStyle.cpp:
+ (WebCore::CanvasStyle::applyStrokeColor):
+ (WebCore::CanvasStyle::applyFillColor):
+ * ksvg2/svg/SVGColor.cpp:
+ (WebCore::SVGColor::colorFromRGBColorString):
+
2007-08-21 Nikolas Zimmermann <zimmermann@kde.org>
Reviewed by Oliver.
return ok;
}
-RGBA32 CSSParser::parseColor(const String &string, bool strict)
+// color will only be changed when string contains a valid css color, making it
+// possible to set up a default color.
+bool CSSParser::parseColor(RGBA32& color, const String &string, bool strict)
{
- RGBA32 color = 0;
- RefPtr<CSSMutableStyleDeclaration>dummyStyleDeclaration = new CSSMutableStyleDeclaration;
-
+ color = 0;
CSSParser parser(true);
// First try creating a color specified by name or the "#" syntax.
if (!parser.parseColor(string, color, strict)) {
-
+ RefPtr<CSSMutableStyleDeclaration>dummyStyleDeclaration = new CSSMutableStyleDeclaration;
+
// Now try to create a color from the rgb() or rgba() syntax.
if (parser.parseColor(dummyStyleDeclaration.get(), string)) {
CSSValue* value = parser.parsedProperties[0]->value();
CSSPrimitiveValue *primitiveValue = static_cast<CSSPrimitiveValue *>(value);
color = primitiveValue->getRGBColorValue();
}
- }
+ } else
+ return false;
}
-
- return color;
+
+ return true;
}
bool CSSParser::parseColor(CSSMutableStyleDeclaration *declaration, const String &string)
void parseSheet(CSSStyleSheet*, const String&);
PassRefPtr<CSSRule> parseRule(CSSStyleSheet*, const String&);
bool parseValue(CSSMutableStyleDeclaration*, int propId, const String&, bool important);
- static RGBA32 parseColor(const String&, bool strict = false);
+ static bool parseColor(RGBA32& color, const String&, bool strict = false);
bool parseColor(CSSMutableStyleDeclaration*, const String&);
bool parseDeclaration(CSSMutableStyleDeclaration*, const String&);
bool parseMediaQuery(MediaList*, const String&);
}
break;
case CSS_PROP_COLOR: {
- Color color(CSSParser::parseColor(valueText));
+ RGBA32 rgba = 0;
+ CSSParser::parseColor(rgba, valueText);
+ Color color(rgba);
m_applyFontColor = color.name();
return true;
}
void CanvasGradient::addColorStop(float value, const String& color)
{
- RGBA32 rgba = CSSParser::parseColor(color);
+ RGBA32 rgba = 0; // default is transparant black
+ CSSParser::parseColor(rgba, color);
m_stops.append(ColorStop(value,
((rgba >> 16) & 0xFF) / 255.0f,
((rgba >> 8) & 0xFF) / 255.0f,
return;
// FIXME: Do this through platform-independent GraphicsContext API.
#if PLATFORM(CG)
- RGBA32 rgba = CSSParser::parseColor(color);
+ RGBA32 rgba = 0; // default is transparant black
+ CSSParser::parseColor(rgba, color);
const CGFloat components[4] = {
((rgba >> 16) & 0xFF) / 255.0f,
((rgba >> 8) & 0xFF) / 255.0f,
return;
// FIXME: Do this through platform-independent GraphicsContext API.
#if PLATFORM(CG)
- RGBA32 rgba = state().m_shadowColor.isEmpty() ? 0 : CSSParser::parseColor(state().m_shadowColor);
+ RGBA32 rgba = 0; // default is transparant black
+ if (!state().m_shadowColor.isEmpty())
+ CSSParser::parseColor(rgba, state().m_shadowColor);
const CGFloat components[4] = {
((rgba >> 16) & 0xFF) / 255.0f,
((rgba >> 8) & 0xFF) / 255.0f,
#endif
switch (m_type) {
case ColorString: {
- RGBA32 color = CSSParser::parseColor(m_color);
+ RGBA32 color = 0; // default is transparant black
+ CSSParser::parseColor(color, m_color);
// FIXME: Do this through platform-independent GraphicsContext API.
#if PLATFORM(CG)
CGContextSetRGBStrokeColor(context->platformContext(),
break;
}
case ColorStringWithAlpha: {
- RGBA32 color = CSSParser::parseColor(m_color);
+ RGBA32 color = 0; // default is transparant black
+ CSSParser::parseColor(color, m_color);
// FIXME: Do this through platform-independent GraphicsContext API.
#if PLATFORM(CG)
CGContextSetRGBStrokeColor(context->platformContext(),
#endif
switch (m_type) {
case ColorString: {
- RGBA32 color = CSSParser::parseColor(m_color);
+ RGBA32 color = 0; // default is transparant black
+ CSSParser::parseColor(color, m_color);
// FIXME: Do this through platform-independent GraphicsContext API.
#if PLATFORM(CG)
CGContextSetRGBFillColor(context->platformContext(),
break;
}
case ColorStringWithAlpha: {
- RGBA32 color = CSSParser::parseColor(m_color);
+ RGBA32 color = 0; // default is transparant black
+ CSSParser::parseColor(color, m_color);
// FIXME: Do this through platform-independent GraphicsContext API.
#if PLATFORM(CG)
CGContextSetRGBFillColor(context->platformContext(),
#if ENABLE(SVG)
#include "SVGColor.h"
+#include "CSSParser.h"
#include "SVGException.h"
-#include "SVGParserUtilities.h"
namespace WebCore {
ec = SVG_INVALID_VALUE_ERR;
}
-static inline bool parseNumberOrPercent(const UChar*& ptr, const UChar* end, double& value)
-{
- if (!parseNumber(ptr, end, value))
- return false;
- if (ptr < end && *ptr == '%') {
- value = int((255.0 * value) / 100.0);
- ptr++;
- }
- return true;
-}
-
Color SVGColor::colorFromRGBColorString(const String& colorString)
{
- if (colorString.isNull())
+ RGBA32 color;
+ String s = colorString.stripWhiteSpace();
+ // hsl, hsla and rgba are not in the SVG spec.
+ // FIXME: rework css parser so it is more svg aware
+ if (s.startsWith("hsl") || s.startsWith("rgba") ||
+ !CSSParser::parseColor(color, s))
return Color();
- String parse = colorString.stripWhiteSpace();
- if (parse.startsWith("rgb(")) {
- double r = -1, g = -1, b = -1;
- const UChar* ptr = parse.characters() + 4;
- const UChar* end = parse.characters() + parse.length();
- skipOptionalSpaces(ptr, end);
- if (!parseNumberOrPercent(ptr, end, r)
- || !parseNumberOrPercent(ptr, end, g)
- || !parseNumberOrPercent(ptr, end, b))
- return Color();
-
- if (ptr >= end || *ptr != ')')
- return Color();
-
- return Color(int(r), int(g), int(b));
- }
- return Color(parse.lower());
+ return color;
}
void SVGColor::setRGBColorICCColor(const String& /* rgbColor */, const String& /* iccColor */, ExceptionCode& ec)