A tooltip is not displayed whenever a anchor ("a" element) has the "xlink:title" attribute [1] set. Batik already displays the contents of "title" and "desc" elements as tooltips, as suggested by the SVG specification [2], so I'd say we should also display the link title. I'm not sure how precedence should be handled (when a given link has "xlink:title" attribute and child "title"/"desc" elements), but it is suggested [3] that "xlink:title", when set, should take precedence over the other. A current workaround consists of adding a "title" child element to the anchor with the same content as the "xlink:title" attribute, which is then rendered by Batik. A test case with this idea was implemented [4] during experiments in order to force a pointer cursor in ASV3: one would expect a tooltip when hovering on the blue (leftmost) circle. [1] http://www.w3.org/TR/SVG/struct.html#XLinkTitleAttribute [2] http://www.w3.org/TR/SVG/struct.html#DescriptionAndTitleElements [3] http://www.w3.org/Graphics/SVG/IG/wiki/Accessibility_Activity#Title_As_Tooltip [4] http://heldermagalhaes.com/stuff/svg/hacks/ASV3-EmulatePointerCursor.svg
I forgot to mention I found nothing tightly related in the mailing list, although there were a couple of lightly related threads [1] [2]. In one of them, Thomas hints towards Batik only using the "title"/"desc" attributes: «So we use the SVG native 'title' and 'desc' elements rather than the xlink attributes.» [1]. I'd still say taking "xlink:title" into consideration was useful, specially for the fallback case (where child "title"/"desc" elements are not provided). I'm not sure if this should be considered an enhancement or a low priority bug... [1] http://www.nabble.com/tooltips-for-<use>-elements-in-JSVGCanvas--tc21837678.html [2] http://www.nabble.com/How-do-people-show-tooltips-over-reused-symbols-on-a-JSVGCanvas--Is-this-related-to-xlink:title--td17785257.html
Created attachment 24434 [details] Testcase Expected results: * In the leftmost (red) circle, a tooltip containing "xlink:title attribute tooltip"; * The center (green) circle is OK: it displays the "title" element contents; * In the rightmost (blue) circle, a tooltip containing "xlink:title attribute tooltip".
(In reply to comment #1) > I'm not sure if this should be considered an enhancement or a low priority > bug... According to a note [1] in the status page, it hints towards an enhancement. Nevertheless, I didn't find anything supporting that "xlink:title" wasn't required by SVG (I even found something hinting on the contrary [2]). Perhaps I'm missing something...? [1] http://xmlgraphics.apache.org/batik/status.html#noteXLink [2] http://www.w3.org/TR/SVG/linking.html#xlink-att-mod