Tootip on object tag not rendered when external SVG image is loaded




9 years ago
9 years ago


(Reporter: bugzilla, Unassigned)


Firefox Tracking Flags

(Not tracked)




9 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv: Gecko/20100401 Firefox/3.6.3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv: Gecko/20100401 Firefox/3.6.3

Given a sample page and SVG image:
<object width="32" height="32" title="test" data="test.svg">svg image</object>

You will see that the title attribute doesn't appear as a tooltip. Specifying another image format shows the tooltip.

Reproducible: Always

Steps to Reproduce:
1. Load up the sample page
2. Mouse over the image
3. Observe the object tag's tooltip doesn't show
Actual Results:  
No tooltip is shown.

Expected Results:  
Tooltip specified on object tag would be shown.
Fixed on trunk some time ago.
Last Resolved: 9 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 329212
Ooops this is unrelated to bug 329212

Actually it's invalid I think as SVG objects are replaced elements so you should see the svg's tooltips and not the object tooltip.
More to the point, SVG in <object> is treated as a document (like HTML in <object>), not as an image.  So the comparisons to image formats aren't really relevant.

Comment 4

9 years ago
Well, in the application I'm working on we display icons with tooltips giving descriptions of why they're being shown, (thus the tooltips are on the object tag, not the SVG image where the same image might be used for multiple purposes with different tooltips). This works for PNGs, but when I try to utilise Firefox's SVG support to display scalable icons (so they can be used as high-quality images in multiple sizes with just one copy downloaded/in the cache), I lose my tooltips.

In my opinion, the object's tooltip should be displayed over the element's canvas by default unless the internal document specifies one (I believe SVG can define tooltips over shapes etc., and most HTML elements can as well). The whole point of the object tag is that it's supposed to represent external documents (html, images, or something else) in a format-agnostic manner. The object tag has a title attribute, ergo it should be treated as per any other element.

As is I can't use SVG icons in Firefox without baking them into PNGs, because we need those tooltips and hacking together a JavaScript method of adding the required attributes into the SVG isn't justifiable.
You could always stick some absolutely positioned div on top of the SVG and have a tooltip on that. Of course you wouldn't be able to interact with the SVG but if you're just using them as scalable bitmaps maybe that's OK for you.

Comment 6

9 years ago
Yes I could, but that's even more as hack-ish as using the JavaScript method. The point is, some of these icons are PNGs, some would hopefully be SVGs (with a view to moving them all to SVG over time). I'm looking briefly at using a jQuery tooltip extension to see if their use offers anything useful other than working around this issue. If not, I'm simply going to have to bake the SVGs into PNGs, which is very disappointing.

The whole "SVG is a document *not* an image" notion is a very developer-orientated view IMHO, and completely counter-intuitive to the overwhelming majority of people making web pages who might want to put scalable images on them. To be honest, I'm a coder not a web designer and it's even taken me by surprise, strongly suggesting in my experience that this is a implementation-led decision, not a design led one.
You need to log in before you can comment on or make changes to this bug.