[whatwg] Feeedback on <dfn>, <abbr>, and other elements

Pentasis pentasis at lavabit.com
Fri Nov 28 04:26:05 PST 2008


----- Original Message ----- 
From: "Calogero Alex Baldacchino" <alex.baldacchino at email.it>
To: "Pentasis" <pentasis at lavabit.com>
Cc: "WHAT Working Group" <whatwg at lists.whatwg.org>
Sent: Friday, November 28, 2008 2:54 AM
Subject: Re: [whatwg] Feeedback on <dfn>, <abbr>, and other elements


>>>>
>>>> Perhaps a silly idea: what if abbreviations could work as an img-map
>>>> couple? That is, i.e., an <abbr> without a title could avail of a, 
>>>> let's
>>>> say, 'ref' attribute indicating the id of a previous <abbr> element 
>>>> with
>>>> a title, and the former could be 'self-closing' (i.e. <abbr ref="#foo"
>>>> />), so by default the UA would substitute it with the referenced
>>>> element content (the unexpanded abbreviation), and, at the user will
>>>> (when he/she clics on the abbreviation, or just stops the pointer, or
>>>> navigates to the abbreviation, or according to any setting in the
>>>> browser options) the abbreviation is expanded. (I guess the above won't
>>>> be agreed because of backward compatibility, though)
>>>
>>> What problem would this solve? It's not like including the abbreviation
>>> each time is a great burden.
>>>
>>
>> Actually, it would solve a problem like this:
>>
>> What if I style abbr so that the title attribute is shown after the 
>> abbreviation:
>>
>> abbr[title]:after {
>>   content: " ("attr(title)")";
>> }
>>
>> Now obviously I don't need and don't want to do this for every instance 
>> of the abbreviation on the page visually (just the first one on each page 
>> would be enough) , but I do want the title attribute to be expanded for 
>> screenreaders on each instance.
>>
>> Using this solution would enable the screenreaders to get the title 
>> information from a previous instance, but at the same time would not 
>> render it visually.
>>
>>
>>
> I'm not sure I've understood your aim. In my "half-proposal" the '<abbr 
> ref=#foo />' element should/could be thought as inheriting the title 
> attribute (and the abbreviation content) from the referenced '<abbr 
> id="foo" title"Foo Bar" >FB</abbr>', thus your example would expand the 
> title for any #foo reference, and should be part of a 
> screenreader-targeted style sheet. Was this your purpose?
>

Ah, then I misunderstood. I thought you meant that only the first instance 
of an abbr would get a title and that any following instance would reference 
that like so:

..<abbr id="foo" title="for example">e.g.</abbr>.......<abbr 
href="#foo">e.g.</abbr>....

That way -I thought- one can retrieve the title attribute for other 
instances (via scripting?)

But as Ian pointed out, this can also be done through CSS. Even though I 
wonder if it is as flexible; authors -as opposed to designers- would 
probably find this HTML construct better to work with than a CSS file. This 
issue borders the question if CSS should be used for content manipulation 
(other than styling I mean). But I am not sure, so I won't argue on the 
subject.
But expanding on this idea, would it be beneficial to have some sort of 
property in CSS that enables us to arbitrarily inherit? In other words, to 
be able to have not only properties but also html-attributes inherit values 
from elements that are not directly in the lineage of inheritance?

Bert 





More information about the whatwg mailing list