Bug 48073 - Batik should display anchor "xlink:title" attribute contents as a tooltip
Summary: Batik should display anchor "xlink:title" attribute contents as a tooltip
Status: NEW
Alias: None
Product: Batik - Now in Jira
Classification: Unclassified
Component: Bridge (show other bugs)
Version: 1.8
Hardware: All All
: P2 minor
Target Milestone: ---
Assignee: Batik Developer's Mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-28 06:57 UTC by Helder Magalhães
Modified: 2010-01-01 04:01 UTC (History)
0 users



Attachments
Testcase (840 bytes, image/svg+xml)
2009-10-28 09:11 UTC, Helder Magalhães
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Helder Magalhães 2009-10-28 06:57:36 UTC
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
Comment 1 Helder Magalhães 2009-10-28 08:23:10 UTC
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
Comment 2 Helder Magalhães 2009-10-28 09:11:28 UTC
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".
Comment 3 Helder Magalhães 2010-01-01 04:01:32 UTC
(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