W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2007

[whatwg] ALT associations [was: Re: My case for Ruby-elements]

From: Benjamin Hawkes-Lewis <bhawkeslewis@googlemail.com>
Date: Tue, 14 Aug 2007 00:31:51 +0100
Message-ID: <46C0E9E7.8090008@googlemail.com>
Michel Fortin wrote:
> Le 2007-08-12 ? 14:20, Benjamin Hawkes-Lewis a ?crit :

[snip]

>> <div class="passage">
>> <p id="p4858" lang="en">Hello</p>
>> <alt for="p4858 lang="fr"><p>Salut</p></alt>
>> </div>
> 
> That markup looks awfully complicated for the simple use case it's 
> trying to solve.
> 
> Wouldn't this be better:
> 
>     <alt on="lang">
>       <p lang="en">Hello</p>
>       <p lang="fr">Salut</p>
>     </alt>

Perhaps. I was trying to use the semantic of ALT suggested on 
public-html ("alternative for" not "alternate by"). The advantage of 
associating with for/id rather than by nesting is that it allows 
alternatives to be located anywhere on the page (or even in another 
document, potentially). Possibly having both methods of association is 
good, as with LABEL.

> I've included the "on" attribute assuming <alt> would be able to define 
> alternatives based on something other than the "lang" attribute, 
> although it's not really necessary considering only the current use case.

I'm not sure how well the ON attribute would scale to more complex sets 
of alternatives. e.g. What if some of the alternatives were video? What 
if some of the video alternatives had sign language interpretation? How 
can an author know which dimension of variation is more important to the 
end-user?

But then if all immediate child elements of ALT are alternatives, then 
ON is (perhaps) superfluous:

<alt>
<p lang="en">Hello</p>
<p lang="fr">Salut</p>
<video lang="en" src="hello.ogg"></video>
</alt>

--
Benjamin Hawkes-Lewis
Received on Monday, 13 August 2007 16:31:51 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:36 UTC