RESOLVED FIXED 6548
<mask>, <marker>, <pattern> and <use> inside <defs> do not work
https://bugs.webkit.org/show_bug.cgi?id=6548
Summary <mask>, <marker>, <pattern> and <use> inside <defs> do not work
Eric Seidel (no email)
Reported 2006-01-14 20:28:45 PST
simple <mask> crashes Safari+SVG Crashing test case attached.
Attachments
simple test case (should see only green!) (483 bytes, image/svg+xml)
2006-01-14 20:29 PST, Eric Seidel (no email)
no flags
simple test case (should see a 100x100 green block) (439 bytes, image/svg+xml)
2006-08-12 01:44 PDT, Eric Seidel (no email)
no flags
the fix (79.34 KB, patch)
2006-08-14 22:37 PDT, Eric Seidel (no email)
mjs: review+
Eric Seidel (no email)
Comment 1 2006-01-14 20:29:15 PST
Created attachment 5686 [details] simple test case (should see only green!)
Eric Seidel (no email)
Comment 2 2006-01-15 03:31:58 PST
The problem here is that since <defs> does not create a renderer, all of its children will not create renderers, including the <mask>. <mask> (wrongfully) assumes that it will create a renderer. This is probably easiest to fix by making <pattern> and <mask> and <marker> all of their own separate render trees which are independent from the main tree. I'm not sure how style resolution wil work in those cases. Another option is to "fix" the render tree (for at least defs) to allow it to skip over certain dom objects which do not need to create renderers.
Eric Seidel (no email)
Comment 3 2006-01-15 03:45:55 PST
Ok, we've landed a simple fix (r12109). So this no longer crashes, but <mask> does not work in this situation. This bug can now track that fix.
Eric Seidel (no email)
Comment 4 2006-01-15 03:47:54 PST
I'm pretty certain that <pattern> and <marker> also fail inside <defs> as well.
Eric Seidel (no email)
Comment 5 2006-01-26 16:10:36 PST
This is a fundemental issue in our <mask>, <marker>, <pattern> and <use> support. The SVG spec officially recommends that content authors place these elements inside a <defs> element, however such content will fail in WebKit+SVG. Bumping to p2 and adding SVGHitList keyword. In order to implement this correctly, we would need to make these elements smart enough to manually create renderers and resolve style accross the <defs> boundery. Another way to fix would be to make <defs> create a dummy renderer, but I think supporting disjoint style trees for these elements is a better fix than hacking <defs>.
Eric Seidel (no email)
Comment 6 2006-08-12 01:39:51 PDT
Hyatt: how would you feel about us inserting a special dummy node into the render tree for <defs> which did not paint, but did hold style? I think I might making a patch which does just that. The other option (as I see it) is to make a separate render tree off to the side.
Eric Seidel (no email)
Comment 7 2006-08-12 01:44:14 PDT
Created attachment 10000 [details] simple test case (should see a 100x100 green block) the use of <mask> was incorrect in the previous test case.
Eric Seidel (no email)
Comment 8 2006-08-14 22:37:39 PDT
Created attachment 10036 [details] the fix Another fix from my long plane rides this weekend.
Maciej Stachowiak
Comment 9 2006-08-14 23:24:04 PDT
Comment on attachment 10036 [details] the fix r=me
Note You need to log in before you can comment on or make changes to this bug.