User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-DE; rv:1.7.10) Gecko/20050717 Firefox/1.0.6 Mnenhy/0.7.2.0 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-DE; rv:1.7.10) Gecko/20050717 Firefox/1.0.6 Mnenhy/0.7.2.0 Inside of a SVG document I create a text element that contains an amount of words. One of these words should be turned into a hyperlink that leads to a different web site. Inside of the text-element I didn't find a way to create a hyperlink using the a-tag (or tspan-tag and a-tag in combination). According to my knowledge of the SVG specification it should be possible to use an a-tag inside of a text-tag. For further details please have a look at the provided example (hyperlinks_in_text_tags.svg). Reproducible: Always Steps to Reproduce: Open SVG document in Firefox. Compare displayed text content with source. Try to click links. Actual Results: Text content wrapped with an a-tag is not displayed if inside of a text tag Expected Results: Hyperlinks should be displayed, be clickable and lead to target web page. Works in MSIE with Adobe SVG Viewer 3.
Useragent used for SVG testing was : Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5 Error Message for test 5 (see testcase hyperlinks_in_text_tags.svg) was: Error: uncaught exception: [Exception... "Component returned failure code: 0x804b000a [nsIIOService.newURI]" nsresult: "0x804b000a (<unknown>)" location: "JS frame :: chrome://browser/content/browser.js :: makeURLAbsolute :: line 4797" data: no]
Testcase can be found at: http://www.henningpingel.de/fileadmin/henning/bugzilla/hyperlinks_in_text_tags.svg
So there are two issues here, that need two separate bugs: 1) The links don't work. This should be filed on Core:SVG. I have no idea what's up there. 2) This exception is thrown. It's thrown because someone passed |undefined| as the base to makeURLAbsolute, and that happens because as far as JS is concerned an <svg:tspan> is not an nsIDOM3Node. The reason is a missing DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES (or possibly even DOM_CLASSINFO_SVG_GRAPHIC_ELEMENT_MAP_ENTRIES? No idea) in the following code in nsDOMClassInfo.cpp: 2691 DOM_CLASSINFO_MAP_BEGIN(SVGTSpanElement, nsIDOMSVGTSpanElement) 2692 DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGTextPositioningElement) 2693 DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGTextContentElement) 2694 DOM_CLASSINFO_MAP_END Over to core SVG, but this bug covers issue 1; we should have a separate bug on issue 2.
I'm pretty sure the links not working issue is bug 314568.
It's not. That's a trunk-only regression for cases when xlink:href is used for non-link purposes. This bug is present in 1.8 branch builds (as you can see from the summary). I filed bug 317027 for the classinfo issue.
I think the link not working in test #5 (the final case) is a duplicate of bug 287252. Tests #2, #3 and #4 exhibit a different issue however.
12 years ago
The problem with text inside an <a> not showing was fixed by Robert in bug 330059. As for text #5, for now we don't support XLink on arbitrary SVG elements, only on <a>.