[whatwg] The IMG element, proposing a CAPTION attribute

Matthew Raymond mattraymond at earthlink.net
Mon Nov 20 20:30:17 PST 2006


Andrew Fedoniouk wrote:
> "...Many platforms/OSes don't have tooltips that support anything
> other than text...."
> 
> How task of tooltip creation in HTML is related to what OS is using for
> tooltips?

   There are W3C guidelines that say that UI in user agents should
follow the UI conventions of the underlying operating system. This is
what caused the demise of general focus passing for <label> elements
(which was specified in HTML 4.01). As of WF2, <label> elements only
pass focus if labels would normally have focus passing for that kind of
control in the user's OS. (I called it "an irrational consistency", but
I was overruled.)

[Snipped plug for your UA.]
> For formatted tooltips HTMLayout (http://www.terrainformatica.com/htmlayout)
> uses 'titleid' attribute that contains id of the element to show as a 
> tooltip.
> 
> So if you have <span titleid="mytooltip">Bold</span>
> and <div id="mytooltip">Rich content</div>
> then that div will be shown as a tooltip for the span.
> 
> Pretty natural I would say.

   This bares similarities to XUL, actually.

   I don't necessarily have a problem with supporting rich tooltips, but
my main concern is that there isn't much of a use case for it, it won't
match UI conventions for most platforms, and fallback is a nightmare.

   With regard to fallback, think of how your above example would render
if the CSS file failed to load or wasn't supported. It would probably be
something like this:

| Bold
|
| Rich content

   Worse, the tooltip could appear in some distant part of the document
next to a bunch of other tooltips because they were all put in a group
in the document structure.

> For various popup purposes I have added <popup> element that is
> display:none normally and has better semantic meaning so
> we use <popup>s for such tooltips in almost all cases.

   Well, we may have to look into markup that doesn't have fallback, but
I'm not sure if I'm quite there yet.



More information about the whatwg mailing list