Re: @caption vs <caption type="figure">

On Sun, 22 Nov 2009 12:25:10 -0600, Tab Atkins Jr. wrote:
> On Sun, Nov 22, 2009 at 11:40 AM, Leif Halvard Silli wrote:
>> So, contrary to what you said about namespaces not being a good
>> solution for introducing new experimental features, it would actually
>> be simpler to introduce <caption> for other elements than <table> via a
>> real/prefixed namespace. For example a transitional namespace for new
>> HTML5 features. The following already works.:
>> 
>> <figure><t:caption></t:caption></figure>
>> 
>> As time goes, and old user agents fades out, one could drop the prefix.
> 
> It's contrary to nothing, and furthermore probably incorrect.
> 
> 1) What you are talking about is not an experimental feature, it's a
> standardized feature.  There should be only one way to do it that
> everyone follows; the problem is finding an acceptable way.

To not claim too much: For centralized extensibility, then namespaces 
seems to me to work well.

> 2) The only reason namespaces might work for this particular case is
> as a gross hack that simply temporarily obfuscates the name of the
> element.  That has nothing to do with namespaces - calling it
> <tcaption> or <x-caption> or <legend> accomplishes the same end.

Under 1) you said there should be only one way. Indeed. Namespaces, 
including namespace prefixes, is that "one way". <tcaption> and 
<x-caption> is a new and other way.

Of course the "t" in <t:caption> is not in a real namespace until 
text/HTML user agents starts to support namespaces. I don't know, if we 
did this:

<html xmlns="http://www.w3.org/1999/xhtml"  
xmlns:t="http://www.w3.org/1999/xhtml">

Then, as soon as text/HTML user agents started to support namespaces, 
would they then treat <t:caption> as a table caption, with all its 
quirks? ;-) Currently, there is no such problem. 

Re <legend>: A more compatible, temporary solution would be <span> with 
a suitable @role value.

> 3) I'd have to test, but depending on how older user-agents handle
> element names with colons in them, it still might not work.

I tested IE6-IE8, Firefox 1,2 and 3.5, Opera 10 and Safari 4. This CSS 
selector works in all of them:

t\:caption{}

> 4) I'd highly question any notion of 'simpler' that rates "use
> namespaces" higher than "use a new element name" when the sole problem
> is "the name we want is unusable".

The /name/ is not at all unusable. On the contrary, it is the name we 
want. There is not reason to have another name than <caption> - except 
for the technical difficulties connected with how that name is 
currently supported in text/HTML.
-- 
leif halvard silli

Received on Sunday, 22 November 2009 20:35:06 UTC