These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:06 pm Advanced search

HTML-formatted titles and abbreviations

Do you think the HTML spec should do something differently? You can discuss spec feedback here, but you should send it to the WHATWG mailing list or file a bug in the W3C bugzilla for it to be considered.

HTML-formatted titles and abbreviations

Postby Mx64 » Tue Jan 20, 2009 1:14 pm

1. What is the problem you are trying to solve?
Currently, there you can use only text in @title. Not even line breaks are possible (at least I don't know any reliably way). That is sometimes not enough. Also with 'abbr' elements you either insert @title only for the 1st element (results in only 1st one with a tooltip) or need to specify @title every time you use 'abbr'. That is somewhat redundant.

2. What is the feature you are suggesting to help solve it?
Look at this:
Code: Select all
<head/>
<body>
    <p><span title="url(#ref-cow)">Cows</span> are cute animals.</p>
    <p>The more prominent members of the <abbr title="url(#ref-whatwg)">WHATWG</abbr> have all joined the HTML working group. We have invited the HTML working group chairmen to the <abbr title="url(#ref-whatwg)">WHATWG</abbr> as well, in the spirit of cooperation.</p>
</body>
<foot>
    <ref id="ref-cow">
        <p>Cattle, colloquially referred to as cows, are domesticated ungulates, a member of the subfamily Bovinae of the family Bovidae.</p>
        <div><img src="cow.jpg" alt="A cow"/></div>
    </ref>
    <ref id="ref-whatwg">
        <p>The <b>Web Hypertext Application Technology Working Group</b>, or <b>WHATWG</b>, is a community of people interested in evolving HTML and related technologies. </p>
    </ref>
<foot>

i.e. <foot> element will have blocks of HTML markup that are referenced by their @id using @title atribute (or there was 'xref' or something like that in HTML5 before).

3. What is the processing model for that feature, including error handling? This should be very clear, including things such as event timing if the feature involves events, how to create graphs representing the data in the case of semantic proposals, etc.
I'm not sure about this yet, since I'm just interested would this be nice to have in HTML 5 or some HTML 6+ in the future.
Some elements are meaningless in this 'tooltip', like 'a' or @title, since you can't hover them anyway.
'foot' and its children must not be visible of course. Also CSS styling apllied to 'ref' element must be applied to this advanced tooltip (background, borders, etc.).

4. Why do you think browsers would implement this feature?
I'm not good at this...

Why do you think authors would use this feature?
Ease of authoring and it's not as limiting as @title.

What evidence is there that this feature is desparately needed?
Currently there are often exist JS/CSS implementation for this. JS version is less accessible and CSS has the same problem as abbr@title - you need to specify it multiple times if you want more than 1 tooltip on the same abreviation.

So, I'm asking whether it is needed and possible to implement?

p.s. English isn't my 1st language so text above may (or may not) be far from gramatically correct.
Mx64
<h6>
 
Posts: 5
Joined: Tue Jan 20, 2009 12:35 pm

Postby zcorpan » Wed Jan 21, 2009 6:16 pm

Linebreaks in tooltips is already supported in the spec.

http://www.whatwg.org/specs/web-apps/cu ... -attribute

As for rich content in tooltips, I think it has been discussed on the list but I don't have a pointer currently. I don't think your specific proposal would work though (what if you want the tooltip to be the string "url(#foo)" for instance?), but maybe a new attribute would work (e.g. titlehtml="foo <img> ...", albeit ugly and would probably have to be different in XHTML).

The spec contains suggestions for how to do footnotes, which could be presented as tooltips with JS+CSS if desired.

http://www.whatwg.org/specs/web-apps/cu ... #footnotes
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden

Postby Mx64 » Wed Jan 21, 2009 9:19 pm

Linebreaks in tooltips is already supported in the spec.

It doesn't seem to work with Opera & Fx yet but I'll keep this in mind. Thanks.

I don't think your specific proposal would work though (what if you want the tooltip to be the string "url(#foo)" for instance?)

Of course @title was used just as an example. @titlehtml with html content will need to be escaped that would be quite ugly and that still requires some JS magic if I want same tooltip for more that 1 element (or I'll need to repeat @titlehtml). That would be better that nothing though.

I'd prefer non-JS solution myself. Whether it is good enough feature to specifically care about in the HTML itself I'm not sure.
Mx64
<h6>
 
Posts: 5
Joined: Tue Jan 20, 2009 12:35 pm

Postby lyosha » Fri Jan 23, 2009 1:30 am

Perhaps a better solution would be a hybrid of both ideas. Something along the lines of titlehref="#foo" ... <foot><div id="foo"><img ...

Only problem is the <foot> will not be backwards compatible and would show up in the body in older browsers (display:none can fix the appearance, but it will still be in the body in the DOM).
lyosha
<h3>
 
Posts: 60
Joined: Fri Aug 22, 2008 9:26 pm

Postby Mx64 » Fri Jan 23, 2009 2:40 am

Showing in the body is not necessary bad. They can't view 'titlehref' so they gain alternative version i.e. text in the end (if appropriate). Or the said display: none will help.

As for being inside body, for styling at least it is possible to use 'id's since they are required anyway there. Or apply some selectors magic (if foot will collapse) based on id name if they are similar like ref-* (I'm not sure about IE here and I don't have IE7/8 at the moment).
Mx64
<h6>
 
Posts: 5
Joined: Tue Jan 20, 2009 12:35 pm


Return to Feedback on the Specs

Who is online

Users browsing this forum: No registered users and 1 guest