RESOLVED FIXED 40960
REGRESSION: text-shadow CSS applied to SVG no longer works
https://bugs.webkit.org/show_bug.cgi?id=40960
Summary REGRESSION: text-shadow CSS applied to SVG no longer works
Simon Fraser (smfr)
Reported 2010-06-21 17:19:24 PDT
text-shadow applied to SVG used to work before http://trac.webkit.org/changeset/61393, and no longer does.
Attachments
Testcase (1.42 KB, text/html)
2010-06-22 08:54 PDT, Simon Fraser (smfr)
no flags
Initial patch (254.29 KB, patch)
2010-06-25 08:27 PDT, Nikolas Zimmermann
krit: review+
Nikolas Zimmermann
Comment 1 2010-06-21 22:46:41 PDT
Right, this was intentional. I'm not sure whether we want to support it at all? AFAIK we don't have any testcases for this in trunk, at least no testcase that I could have broken? Please correct me if I'm wrong!
Simon Fraser (smfr)
Comment 2 2010-06-22 08:32:30 PDT
text-shadow support in SVG was added recently, and was for an internal Apple customer. We absolutely need it to work. I agree that there is a lack of testcases.
Nikolas Zimmermann
Comment 3 2010-06-22 08:47:28 PDT
I can easily add it back, if we do need it. No problem at all. Can you supply me with a testcase?
Simon Fraser (smfr)
Comment 4 2010-06-22 08:54:13 PDT
Created attachment 59375 [details] Testcase
Beth Dakin
Comment 5 2010-06-22 09:51:35 PDT
I was confused when Simon mentioned this to me yesterday, and it took me a little while to remember why. Supporting text-shadow on SVG is NOT a new feature. text-shadow has worked on SVG pretty much since text-shadow has worked in regular CSS and HTML. The new feature is -webkit-svg-shadow, and that allows shadows on arbitrary SVG element. -webkit-svg-shadow did have the same effect as text-shadow when I implemented it 6 months back or so, and I probably should have added test cases demonstrating it. But fundamentally, text shadow was an existing feature. The new feature was -webkit-svg-shadow.
Beth Dakin
Comment 6 2010-06-22 09:54:45 PDT
And just to be clear, text-shadow and -webkit-svg-shadow should still both continue to work on text. text-shadow is a feature that has been shipping in Safari since at least Safari 4.0.4. (I know it was shipping earlier than that, but I don't have an earlier version handy to test.) And -webkit-svg-shadow shipped with Safari 5. I am sure other WebKit-based browsers have shipped these features too, and we try to avoid removing features that have shipped in any browser at all costs.
Dirk Schulze
Comment 7 2010-06-22 11:54:34 PDT
(In reply to comment #6) > And just to be clear, text-shadow and -webkit-svg-shadow should still both continue to work on text. text-shadow is a feature that has been shipping in Safari since at least Safari 4.0.4. (I know it was shipping earlier than that, but I don't have an earlier version handy to test.) And -webkit-svg-shadow shipped with Safari 5. I am sure other WebKit-based browsers have shipped these features too, and we try to avoid removing features that have shipped in any browser at all costs. If both, text-shadow and -webkit-svg-shadow, should be useable for SVG text elements, what should happen if we apply both to a text? I tried it on WebKitGtk and the prefered shadow was the text-shadow and it doesn't change something on the first few, but the background turned to the color defined by webkit-svg-shadow on selecting the text. I believe that this is not expected. It isn't realy topic related and we can open a new bug report for it if needed.
Nikolas Zimmermann
Comment 8 2010-06-25 08:27:41 PDT
Created attachment 59769 [details] Initial patch Readd text-shadow support, this time supporting multiple shadows. Doesn't work exactly like HTML, because of the way stroke/fill is painted in SVG: seperated. When applying a shadow to a stroked SVG text, the shadow will be stroked as well. That's the same like we did before (before I removed text-shadow support), but I just wanted to mention it, in case someone wonders when looking at the expected.png. Adding a testcase which shows SVG/HTML text-shadow in comparision.
Dirk Schulze
Comment 9 2010-06-29 02:10:55 PDT
Comment on attachment 59769 [details] Initial patch WebCore/rendering/SVGInlineTextBox.cpp:577 + extraOffset = roundedIntSize(applyShadowToGraphicsContext(context, shadow, shadowRect, false /* stroked */, true /* opaque */)); roundedIntSize should go away, like discussed in IRC. r=me with this little change.
Nikolas Zimmermann
Comment 10 2010-06-29 02:13:19 PDT
*** Bug 37468 has been marked as a duplicate of this bug. ***
Nikolas Zimmermann
Comment 11 2010-06-29 02:19:04 PDT
Landed in r62099.
Nikolas Zimmermann
Comment 12 2010-06-29 02:23:22 PDT
Landed in r62100.
Note You need to log in before you can comment on or make changes to this bug.