Changeset 87721 in webkit
- Timestamp:
- May 31, 2011 3:46:25 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 10 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r87719 r87721 1 2011-05-31 Oliver Varga <Varga.Oliver@stud.u-szeged.hu> 2 3 Reviewed by Nikolas Zimmermann. 4 5 Invalid color handling is broken for SVG 6 https://bugs.webkit.org/show_bug.cgi?id=58531 7 8 Fix invalid color fallback handling. If the fill/stroke attributes computed 9 value leads to a an invalid color, inherit the desired color from the parent 10 style instead. Matches Opera/FF and SVG 1.1 Second Edition (http://www.w3.org/TR/SVG/). 11 12 * platform/chromium-linux/svg/custom/invalid-fill-expected.txt: 13 * platform/chromium-linux/svg/custom/invalid-fill-hex-expected.txt: 14 * platform/chromium-linux/svg/custom/invalid-stroke-hex-expected.txt: Added. 15 * platform/chromium-linux/svg/custom/invalid-uri-stroke-expected.txt: Added. 16 * platform/mac/svg/custom/invalid-fill-expected.png: 17 * platform/mac/svg/custom/invalid-fill-expected.txt: 18 * platform/mac/svg/custom/invalid-fill-hex-expected.png: 19 * platform/mac/svg/custom/invalid-fill-hex-expected.txt: 20 * platform/mac/svg/custom/invalid-stroke-hex-expected.png: Added. 21 * platform/mac/svg/custom/invalid-stroke-hex-expected.txt: Added. 22 * platform/mac/svg/custom/invalid-uri-stroke-expected.png: Added. 23 * platform/mac/svg/custom/invalid-uri-stroke-expected.txt: Added. 24 * platform/qt/svg/custom/invalid-fill-expected.txt: 25 * platform/qt/svg/custom/invalid-fill-hex-expected.txt: 26 * platform/qt/svg/custom/invalid-stroke-hex-expected.txt: Added. 27 * platform/qt/svg/custom/invalid-uri-stroke-expected.txt: Added. 28 * svg/custom/invalid-fill-hex.svg: 29 * svg/custom/invalid-fill.svg: 30 * svg/custom/invalid-stroke-hex.svg: Added. 31 * svg/custom/invalid-uri-stroke.svg: Added. 32 1 33 2011-05-31 Yuta Kitamura <yutak@chromium.org> 2 34 -
trunk/LayoutTests/platform/chromium-linux/svg/custom/invalid-fill-expected.txt
r69417 r87721 5 5 RenderSVGContainer {g} at (0,0) size 635x214 6 6 RenderSVGPath {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#FF0000]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00] 7 RenderSVGPath {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=# 000000]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]7 RenderSVGPath {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#FFA500]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00] 8 8 RenderSVGContainer {g} at (10,115) size 625x99 9 9 RenderSVGText {text} at (10,115) size 214x19 contains 1 chunk(s) -
trunk/LayoutTests/platform/chromium-linux/svg/custom/invalid-fill-hex-expected.txt
r69417 r87721 2 2 RenderView at (0,0) size 800x600 3 3 layer at (0,0) size 800x600 4 RenderSVGRoot {svg} at (0,0) size 6 16x2145 RenderSVGContainer {g} at (0,0) size 6 16x2144 RenderSVGRoot {svg} at (0,0) size 639x214 5 RenderSVGContainer {g} at (0,0) size 639x214 6 6 RenderSVGPath {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#FF0000]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00] 7 RenderSVGPath {rect} at (0,0) size 100x100 [ x=0.00] [y=0.00] [width=100.00] [height=100.00]8 RenderSVGContainer {g} at (10,115) size 6 06x999 RenderSVGText {text} at (10,115) size 191x19 contains 1 chunk(s)10 RenderSVGInlineText {#text} at (0,0) size 191x1911 chunk 1 text run 1 at (10.00,130.00) startOffset 0 endOffset 29 width 191.00: "The above rect should be RED."7 RenderSVGPath {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#FFA500]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00] 8 RenderSVGContainer {g} at (10,115) size 629x99 9 RenderSVGText {text} at (10,115) size 226x19 contains 1 chunk(s) 10 RenderSVGInlineText {#text} at (0,0) size 226x19 11 chunk 1 text run 1 at (10.00,130.00) startOffset 0 endOffset 32 width 226.00: "The above rect should be ORANGE." 12 12 RenderSVGText {text} at (10,135) size 606x19 contains 1 chunk(s) 13 13 RenderSVGInlineText {#text} at (0,0) size 606x19 … … 16 16 RenderSVGInlineText {#text} at (0,0) size 448x19 17 17 chunk 1 text run 1 at (10.00,170.00) startOffset 0 endOffset 77 width 448.00: "Browsers don't display such an error, instead use some sort of fill-fallback." 18 RenderSVGText {text} at (10,175) size 528x19 contains 1 chunk(s)19 RenderSVGInlineText {#text} at (0,0) size 528x1920 chunk 1 text run 1 at (10.00,190.00) startOffset 0 endOffset 99 width 528.00: "If there's an invalid fill color, but no fallback specified, it is as if fill=\"none\" was specified."21 RenderSVGText {text} at (10,195) size 529x19 contains 1 chunk(s)22 RenderSVGInlineText {#text} at (0,0) size 529x1923 chunk 1 text run 1 at (10.00,210.00) startOffset 0 endOffset 84 width 529.00: "This has recently been changed in SVG 1.1 2nd edition. Our result matches Operanow."18 RenderSVGText {text} at (10,175) size 629x19 contains 1 chunk(s) 19 RenderSVGInlineText {#text} at (0,0) size 629x19 20 chunk 1 text run 1 at (10.00,190.00) startOffset 0 endOffset 116 width 629.00: "If there's an invalid fill color, but no fallback specified, the fill of the object is inherited from parent object." 21 RenderSVGText {text} at (10,195) size 263x19 contains 1 chunk(s) 22 RenderSVGInlineText {#text} at (0,0) size 263x19 23 chunk 1 text run 1 at (10.00,210.00) startOffset 0 endOffset 41 width 263.00: "Our result matches Opera and Firefox now." -
trunk/LayoutTests/platform/mac/svg/custom/invalid-fill-expected.txt
r69413 r87721 2 2 RenderView at (0,0) size 800x600 3 3 layer at (0,0) size 800x600 4 RenderSVGRoot {svg} at (0,0) size 67 7x2145 RenderSVGContainer {g} at (0,0) size 67 7x2144 RenderSVGRoot {svg} at (0,0) size 673x214 5 RenderSVGContainer {g} at (0,0) size 673x214 6 6 RenderSVGPath {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#FF0000]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00] 7 RenderSVGPath {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=# 000000]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]8 RenderSVGContainer {g} at (10,116) size 66 7x989 RenderSVGText {text} at (10,116) size 2 23x18 contains 1 chunk(s)10 RenderSVGInlineText {#text} at (0,0) size 2 23x1811 chunk 1 text run 1 at (10.00,130.00) startOffset 0 endOffset 3 1 width 223.00: "The above rect should be BLACK."12 RenderSVGText {text} at (10,136) size 6 67x18 contains 1 chunk(s)13 RenderSVGInlineText {#text} at (0,0) size 6 67x1814 chunk 1 text run 1 at (10.00,150.00) startOffset 0 endOffset 10 4 width 667.00: "SVG 1.1 FULL says there should be a \"highly perceivable error\" message when an invalid fill url is used."7 RenderSVGPath {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#FFA500]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00] 8 RenderSVGContainer {g} at (10,116) size 663x98 9 RenderSVGText {text} at (10,116) size 236x18 contains 1 chunk(s) 10 RenderSVGInlineText {#text} at (0,0) size 236x18 11 chunk 1 text run 1 at (10.00,130.00) startOffset 0 endOffset 32 width 236.00: "The above rect should be ORANGE." 12 RenderSVGText {text} at (10,136) size 646x18 contains 1 chunk(s) 13 RenderSVGInlineText {#text} at (0,0) size 646x18 14 chunk 1 text run 1 at (10.00,150.00) startOffset 0 endOffset 100 width 646.00: "SVG 1.1 FULL says there should be a \"highly perceivable error\" message when an invalid fill is used." 15 15 RenderSVGText {text} at (10,156) size 468x18 contains 1 chunk(s) 16 16 RenderSVGInlineText {#text} at (0,0) size 468x18 17 17 chunk 1 text run 1 at (10.00,170.00) startOffset 0 endOffset 77 width 468.00: "Browsers don't display such an error, instead use some sort of fill-fallback." 18 RenderSVGText {text} at (10,176) size 566x18 contains 1 chunk(s)19 RenderSVGInlineText {#text} at (0,0) size 566x1820 chunk 1 text run 1 at (10.00,190.00) startOffset 0 endOffset 98 width 566.00: "If there's an invalid fill URI, but no fallback specified, it is as if fill=\"black\" was specified."18 RenderSVGText {text} at (10,176) size 663x18 contains 1 chunk(s) 19 RenderSVGInlineText {#text} at (0,0) size 663x18 20 chunk 1 text run 1 at (10.00,190.00) startOffset 0 endOffset 114 width 663.00: "If there's an non-existent uri, but no fallback specified, the fill of the object is inherited from parent object." 21 21 RenderSVGText {text} at (10,196) size 555x18 contains 1 chunk(s) 22 22 RenderSVGInlineText {#text} at (0,0) size 555x18 -
trunk/LayoutTests/platform/mac/svg/custom/invalid-fill-hex-expected.txt
r69413 r87721 2 2 RenderView at (0,0) size 800x600 3 3 layer at (0,0) size 800x600 4 RenderSVGRoot {svg} at (0,0) size 6 56x2145 RenderSVGContainer {g} at (0,0) size 6 56x2144 RenderSVGRoot {svg} at (0,0) size 675x214 5 RenderSVGContainer {g} at (0,0) size 675x214 6 6 RenderSVGPath {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#FF0000]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00] 7 RenderSVGPath {rect} at (0,0) size 100x100 [ x=0.00] [y=0.00] [width=100.00] [height=100.00]8 RenderSVGContainer {g} at (10,116) size 6 46x989 RenderSVGText {text} at (10,116) size 2 00x18 contains 1 chunk(s)10 RenderSVGInlineText {#text} at (0,0) size 2 00x1811 chunk 1 text run 1 at (10.00,130.00) startOffset 0 endOffset 29 width 200.00: "The above rect should be RED."7 RenderSVGPath {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#FFA500]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00] 8 RenderSVGContainer {g} at (10,116) size 665x98 9 RenderSVGText {text} at (10,116) size 236x18 contains 1 chunk(s) 10 RenderSVGInlineText {#text} at (0,0) size 236x18 11 chunk 1 text run 1 at (10.00,130.00) startOffset 0 endOffset 32 width 236.00: "The above rect should be ORANGE." 12 12 RenderSVGText {text} at (10,136) size 646x18 contains 1 chunk(s) 13 13 RenderSVGInlineText {#text} at (0,0) size 646x18 … … 16 16 RenderSVGInlineText {#text} at (0,0) size 468x18 17 17 chunk 1 text run 1 at (10.00,170.00) startOffset 0 endOffset 77 width 468.00: "Browsers don't display such an error, instead use some sort of fill-fallback." 18 RenderSVGText {text} at (10,176) size 567x18 contains 1 chunk(s)19 RenderSVGInlineText {#text} at (0,0) size 567x1820 chunk 1 text run 1 at (10.00,190.00) startOffset 0 endOffset 99 width 567.00: "If there's an invalid fill color, but no fallback specified, it is as if fill=\"none\" was specified."21 RenderSVGText {text} at (10,196) size 555x18 contains 1 chunk(s)22 RenderSVGInlineText {#text} at (0,0) size 555x1823 chunk 1 text run 1 at (10.00,210.00) startOffset 0 endOffset 84 width 555.00: "This has recently been changed in SVG 1.1 2nd edition. Our result matches Operanow."18 RenderSVGText {text} at (10,176) size 665x18 contains 1 chunk(s) 19 RenderSVGInlineText {#text} at (0,0) size 665x18 20 chunk 1 text run 1 at (10.00,190.00) startOffset 0 endOffset 116 width 665.00: "If there's an invalid fill color, but no fallback specified, the fill of the object is inherited from parent object." 21 RenderSVGText {text} at (10,196) size 274x18 contains 1 chunk(s) 22 RenderSVGInlineText {#text} at (0,0) size 274x18 23 chunk 1 text run 1 at (10.00,210.00) startOffset 0 endOffset 41 width 274.00: "Our result matches Opera and Firefox now." -
trunk/LayoutTests/platform/qt/svg/custom/invalid-fill-expected.txt
r83871 r87721 2 2 RenderView at (0,0) size 800x600 3 3 layer at (0,0) size 800x600 4 RenderSVGRoot {svg} at (0,0) size 72 1x2165 RenderSVGContainer {g} at (0,0) size 72 1x2164 RenderSVGRoot {svg} at (0,0) size 724x216 5 RenderSVGContainer {g} at (0,0) size 724x216 6 6 RenderSVGPath {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#FF0000]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00] 7 RenderSVGPath {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=# 000000]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]8 RenderSVGContainer {g} at (10,114) size 71 1x1029 RenderSVGText {text} at (10,114) size 2 36x22 contains 1 chunk(s)10 RenderSVGInlineText {#text} at (0,0) size 2 36x2211 chunk 1 text run 1 at (10.00,130.00) startOffset 0 endOffset 3 1 width 236.00: "The above rect should be BLACK."12 RenderSVGText {text} at (10,134) size 711x22 contains 1 chunk(s)13 RenderSVGInlineText {#text} at (0,0) size 711x2214 chunk 1 text run 1 at (10.00,150.00) startOffset 0 endOffset 10 4 width 711.00: "SVG 1.1 FULL says there should be a \"highly perceivable error\" message when an invalid fill url is used."7 RenderSVGPath {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#FFA500]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00] 8 RenderSVGContainer {g} at (10,114) size 714x102 9 RenderSVGText {text} at (10,114) size 249x22 contains 1 chunk(s) 10 RenderSVGInlineText {#text} at (0,0) size 249x22 11 chunk 1 text run 1 at (10.00,130.00) startOffset 0 endOffset 32 width 249.00: "The above rect should be ORANGE." 12 RenderSVGText {text} at (10,134) size 687x22 contains 1 chunk(s) 13 RenderSVGInlineText {#text} at (0,0) size 687x22 14 chunk 1 text run 1 at (10.00,150.00) startOffset 0 endOffset 100 width 687.00: "SVG 1.1 FULL says there should be a \"highly perceivable error\" message when an invalid fill is used." 15 15 RenderSVGText {text} at (10,154) size 502x22 contains 1 chunk(s) 16 16 RenderSVGInlineText {#text} at (0,0) size 502x22 17 17 chunk 1 text run 1 at (10.00,170.00) startOffset 0 endOffset 77 width 502.00: "Browsers don't display such an error, instead use some sort of fill-fallback." 18 RenderSVGText {text} at (10,174) size 601x22 contains 1 chunk(s)19 RenderSVGInlineText {#text} at (0,0) size 601x2220 chunk 1 text run 1 at (10.00,190.00) startOffset 0 endOffset 98 width 601.00: "If there's an invalid fill URI, but no fallback specified, it is as if fill=\"black\" was specified."18 RenderSVGText {text} at (10,174) size 714x22 contains 1 chunk(s) 19 RenderSVGInlineText {#text} at (0,0) size 714x22 20 chunk 1 text run 1 at (10.00,190.00) startOffset 0 endOffset 114 width 714.00: "If there's an non-existent uri, but no fallback specified, the fill of the object is inherited from parent object." 21 21 RenderSVGText {text} at (10,194) size 591x22 contains 1 chunk(s) 22 22 RenderSVGInlineText {#text} at (0,0) size 591x22 -
trunk/LayoutTests/platform/qt/svg/custom/invalid-fill-hex-expected.txt
r83871 r87721 2 2 RenderView at (0,0) size 800x600 3 3 layer at (0,0) size 800x600 4 RenderSVGRoot {svg} at (0,0) size 697x2165 RenderSVGContainer {g} at (0,0) size 697x2164 RenderSVGRoot {svg} at (0,0) size 723x216 5 RenderSVGContainer {g} at (0,0) size 723x216 6 6 RenderSVGPath {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#FF0000]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00] 7 RenderSVGPath {rect} at (0,0) size 100x100 [ x=0.00] [y=0.00] [width=100.00] [height=100.00]8 RenderSVGContainer {g} at (10,114) size 687x1029 RenderSVGText {text} at (10,114) size 2 13x22 contains 1 chunk(s)10 RenderSVGInlineText {#text} at (0,0) size 2 13x2211 chunk 1 text run 1 at (10.00,130.00) startOffset 0 endOffset 29 width 213.00: "The above rect should be RED."7 RenderSVGPath {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#FFA500]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00] 8 RenderSVGContainer {g} at (10,114) size 713x102 9 RenderSVGText {text} at (10,114) size 249x22 contains 1 chunk(s) 10 RenderSVGInlineText {#text} at (0,0) size 249x22 11 chunk 1 text run 1 at (10.00,130.00) startOffset 0 endOffset 32 width 249.00: "The above rect should be ORANGE." 12 12 RenderSVGText {text} at (10,134) size 687x22 contains 1 chunk(s) 13 13 RenderSVGInlineText {#text} at (0,0) size 687x22 … … 16 16 RenderSVGInlineText {#text} at (0,0) size 502x22 17 17 chunk 1 text run 1 at (10.00,170.00) startOffset 0 endOffset 77 width 502.00: "Browsers don't display such an error, instead use some sort of fill-fallback." 18 RenderSVGText {text} at (10,174) size 601x22 contains 1 chunk(s)19 RenderSVGInlineText {#text} at (0,0) size 601x2220 chunk 1 text run 1 at (10.00,190.00) startOffset 0 endOffset 99 width 601.00: "If there's an invalid fill color, but no fallback specified, it is as if fill=\"none\" was specified."21 RenderSVGText {text} at (10,194) size 591x22 contains 1 chunk(s)22 RenderSVGInlineText {#text} at (0,0) size 591x2223 chunk 1 text run 1 at (10.00,210.00) startOffset 0 endOffset 84 width 591.00: "This has recently been changed in SVG 1.1 2nd edition. Our result matches Operanow."18 RenderSVGText {text} at (10,174) size 713x22 contains 1 chunk(s) 19 RenderSVGInlineText {#text} at (0,0) size 713x22 20 chunk 1 text run 1 at (10.00,190.00) startOffset 0 endOffset 116 width 713.00: "If there's an invalid fill color, but no fallback specified, the fill of the object is inherited from parent object." 21 RenderSVGText {text} at (10,194) size 296x22 contains 1 chunk(s) 22 RenderSVGInlineText {#text} at (0,0) size 296x22 23 chunk 1 text run 1 at (10.00,210.00) startOffset 0 endOffset 41 width 296.00: "Our result matches Opera and Firefox now." -
trunk/LayoutTests/svg/custom/invalid-fill-hex.svg
r69413 r87721 5 5 <rect width="100" height="100" fill="#ff"/> 6 6 <g fill="black"> 7 <text x="10" y="130">The above rect should be RED.</text>7 <text x="10" y="130">The above rect should be ORANGE.</text> 8 8 <text x="10" y="150">SVG 1.1 FULL says there should be a "highly perceivable error" message when an invalid fill is used.</text> 9 9 <text x="10" y="170">Browsers don't display such an error, instead use some sort of fill-fallback.</text> 10 <text x="10" y="190">If there's an invalid fill color, but no fallback specified, it is as if fill="none" was specified.</text>11 <text x="10" y="210"> This has recently been changed in SVG 1.1 2nd edition. Our result matches Operanow.</text>10 <text x="10" y="190">If there's an invalid fill color, but no fallback specified, the fill of the object is inherited from parent object.</text> 11 <text x="10" y="210">Our result matches Opera and Firefox now.</text> 12 12 </g> 13 13 </g> -
trunk/LayoutTests/svg/custom/invalid-fill.svg
r69413 r87721 5 5 <rect width="100" height="100" fill="url(#notthere)"/> 6 6 <g fill="black"> 7 <text x="10" y="130">The above rect should be BLACK.</text>8 <text x="10" y="150">SVG 1.1 FULL says there should be a "highly perceivable error" message when an invalid fill urlis used.</text>7 <text x="10" y="130">The above rect should be ORANGE.</text> 8 <text x="10" y="150">SVG 1.1 FULL says there should be a "highly perceivable error" message when an invalid fill is used.</text> 9 9 <text x="10" y="170">Browsers don't display such an error, instead use some sort of fill-fallback.</text> 10 <text x="10" y="190">If there's an invalid fill URI, but no fallback specified, it is as if fill="black" was specified.</text>10 <text x="10" y="190">If there's an non-existent uri, but no fallback specified, the fill of the object is inherited from parent object.</text> 11 11 <text x="10" y="210">This has recently been changed in SVG 1.1 2nd edition. Our result matches Opera now.</text> 12 12 </g> -
trunk/Source/WebCore/ChangeLog
r87718 r87721 1 2011-05-31 Oliver Varga <Varga.Oliver@stud.u-szeged.hu> 2 3 Reviewed by Nikolas Zimmermann. 4 5 Invalid color handling is broken for SVG 6 https://bugs.webkit.org/show_bug.cgi?id=58531 7 8 Fix invalid color fallback handling. If the fill/stroke attributes computed 9 value leads to a an invalid color, inherit the desired color from the parent 10 style instead. Matches Opera/FF and SVG 1.1 Second Edition (http://www.w3.org/TR/SVG/). 11 12 Tests: svg/custom/invalid-stroke-hex.svg 13 svg/custom/invalid-uri-stroke.svg 14 15 * rendering/svg/RenderSVGResource.cpp: 16 (WebCore::inheritColorFromParentStyleIfNeeded): 17 (WebCore::requestPaintingResource): 18 1 19 2011-05-31 Vangelis Kokkevis <vangelis@chromium.org> 2 20 -
trunk/Source/WebCore/rendering/svg/RenderSVGResource.cpp
r79985 r87721 32 32 33 33 namespace WebCore { 34 35 static inline bool inheritColorFromParentStyleIfNeeded(RenderObject* object, bool applyToFill, Color& color) 36 { 37 if (color.isValid()) 38 return true; 39 if (!object->parent() || !object->parent()->style()) 40 return false; 41 const SVGRenderStyle* parentSVGStyle = object->parent()->style()->svgStyle(); 42 color = applyToFill ? parentSVGStyle->fillPaintColor() : parentSVGStyle->strokePaintColor(); 43 return true; 44 } 34 45 35 46 static inline RenderSVGResource* requestPaintingResource(RenderSVGResourceMode mode, RenderObject* object, const RenderStyle* style, Color& fallbackColor) … … 88 99 RenderSVGResourceSolidColor* colorResource = RenderSVGResource::sharedSolidPaintingResource(); 89 100 if (paintType < SVGPaint::SVG_PAINTTYPE_URI_NONE) { 90 // If an invalid fill color is specified, fallback to fill/stroke="none". 91 if (!color.isValid()) 101 if (!inheritColorFromParentStyleIfNeeded(object, applyToFill, color)) 92 102 return 0; 93 103 … … 99 109 SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(object); 100 110 if (!resources) { 101 // If a paint server is specified, and no or an invalid fallback color is given, default to fill/stroke="black". 102 if (!color.isValid()) 103 color = Color::black; 111 if (!inheritColorFromParentStyleIfNeeded(object, applyToFill, color)) 112 return 0; 104 113 105 114 colorResource->setColor(color); … … 110 119 RenderSVGResource* uriResource = mode == ApplyToFillMode ? resources->fill() : resources->stroke(); 111 120 if (!uriResource) { 112 // If a paint server is specified, and no or an invalid fallback color is given, default to fill/stroke="black". 113 if (!color.isValid()) 114 color = Color::black; 121 if (!inheritColorFromParentStyleIfNeeded(object, applyToFill, color)) 122 return 0; 115 123 116 124 colorResource->setColor(color); … … 163 171 164 172 #endif 173
Note: See TracChangeset
for help on using the changeset viewer.