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

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