|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
HTML BASE tag impacting SVGI have defined some gradients inside a DEFS tag and use them in styles as fill:url(#gradientname1) This works great until someone adds a BASE HREF to the enclosing page that does not match the page as loaded from the server. How can I prevent this issue? It should be noted that my SVG code is part of a javascript package that can be loaded into any folder within the web application's hierarchy (ie no hard code path info is possible).
TIA, Larry |
|
|
Re: HTML BASE tag impacting SVGHi Larry,
> I have defined some gradients inside a DEFS tag and use them in > styles as fill:url(#gradientname1) This works great until someone > adds a BASE HREF to the enclosing page that does not match the page > as loaded from the server. Humm... I haven't double check the whole SVG specification for sure regarding this, but I assume you are creating inline SVG into HTML and therefore the potential undefined behavior. Whenever one experiences unexpected behavior, stating in which implementation/environment is usually helpful: it could be an implementation-specific bug. Also providing a test case and/or link where this can be seen is also helpful [1]. ;-) > How can I prevent this issue? Without testing, I'd say you can use "xml:base" [2] in you top-level SVG document to override HTML's "base". If that doesn't work, I'd say it's a bug! :-) Nevertheless, even if it works in a quick test, I'd advise you to test in more than one implementation, as I have a slight feeling this may not work cross-implementation. Just a tip... > It should be noted that my SVG code is part of a javascript package > that can be loaded into any folder within the web application's > hierarchy (ie no hard code path info is possible). Yes, that's a reasonable use-case. > TIA, > Larry Hope this helps, Helder [1] http://www.chiark.greenend.org.uk/~sgtatham/bugs.html [2] http://www.w3.org/TR/SVG/struct.html#Core.attrib |
|
|
Re: HTML BASE tag impacting SVGThanks for the reply. Guess I'm batting 500 which in baseball would be great; in software, not so hot. Safari and Chrome work fine with the BASE tag being present while Firefox 3.0.15 and Firefox 3.5.5 are impacted. Adding the xml:base did not change the rendering. Instead of nice gradients in my regions, I only see black. While it turns out the developer didn't need to set the BASE tag (and it had the wrong value anyway which really caused the trouble) and has since removed it, I guess this should be consider in bug in Firefox?
My approach is to create a SVG element in the page via javascript and add appropriate elements depending on the widget I need to create. Thanks again, Larry > > Humm... I haven't double check the whole SVG specification for sure regarding this, but I assume you are creating inline SVG into HTML and therefore the potential undefined behavior. > > Whenever one experiences unexpected behavior, stating in which implementation/environment is usually helpful: it could be an implementation-specific bug. Also providing a test case and/or link where this can be seen is also helpful [1]. ;-) > > Without testing, I'd say you can use "xml:base" [2] in you top-level SVG document to override HTML's "base". If that doesn't work, I'd say it's a bug! :-) > > Nevertheless, even if it works in a quick test, I'd advise you to test in more than one implementation, as I have a slight feeling this may not work cross-implementation. Just a tip... |
| Free embeddable forum powered by Nabble | Forum Help |