RESOLVED FIXED 12064
Need function for manual style-resolution for things like gradient stops
https://bugs.webkit.org/show_bug.cgi?id=12064
Summary Need function for manual style-resolution for things like gradient stops
Eric Seidel (no email)
Reported 2007-01-01 18:52:35 PST
Need function for manual style-resolution for things like gradient stops Vector<SVGGradientStop> SVGGradientElement::buildStops() const // FIXME: Manual style resolution is a hack RenderStyle* gradientStyle = const_cast<SVGGradientElement*>(this)->styleForRenderer(parent()->renderer()); Gradient stops must inherit style via CSS. The WebCore render tree is optimized not to bother computing styles for any node which does not have a renderer. Furthermore, if anynode does not have a renderer, none of its ancestors do either. Thus nodes like <defs> cause style resolution trouble. In these cases, there should be a special function styleForResolution() (or better named), which can be used by SVG element which need to resolve style across "holes" in the render tree (as are to be expected by things such as <defs> <*Gradient> and possibly eventually <pattern>. Right now the current solution for gradients breaks when gradients are inside <defs> (I think).
Attachments
Dave Hyatt
Comment 1 2007-01-01 18:56:14 PST
We should chat about this at some point. I don't think you need a new function necessarily.
Eric Seidel (no email)
Comment 2 2007-01-01 18:58:29 PST
I'm not sure I'm able to come up with a test case to demonstrate this. This one seems to work fine in TOT: <svg xmlns="http://www.w3.org/2000/svg" style='color: green'> <defs> <linearGradient id='gradient' x2='5'> <stop offset='0' stop-color='currentColor' /> <stop offset='1' stop-color='red' /> </linearGradient> </defs> <rect fill="url(#gradient)" width='100px' height='100px' /> </svg> I still think a function do use to do this more cleanly would be nice.
Eric Seidel (no email)
Comment 3 2007-01-15 01:49:33 PST
An alternative way to fix all this is to actually make gradient stops have real renderers with real styles, such as suggested in: http://bugs.webkit.org/show_bug.cgi?id=12193 This would also require <defs> to have a renderer, as mentioned in: http://bugs.webkit.org/show_bug.cgi?id=12207
Eric Seidel (no email)
Comment 4 2007-06-12 10:29:25 PDT
*** Bug 12545 has been marked as a duplicate of this bug. ***
Nikolas Zimmermann
Comment 5 2007-08-21 14:34:28 PDT
Landed in r25175.
Note You need to log in before you can comment on or make changes to this bug.