W3C home > Mailing lists > Public > public-xhtml2@w3.org > January 2008

Re: Last call comments on XHTML Role Attribute Module (PR#8024)

From: Simon Pieters <simonp@opera.com>
Date: Mon, 28 Jan 2008 19:27:03 +0100
To: "Shane McCarron" <xhtml2-issues@mn.aptest.com>
Cc: public-xhtml2@w3.org
Message-ID: <op.t5nj7dgpidj3kv@hp-a0a83fcd39d2.belkin>

On Mon, 28 Jan 2008 18:03:06 +0100, Shane McCarron  
<xhtml2-issues@mn.aptest.com> wrote:

> Thanks very much for your comments, and apologies on the delay in  
> replying.

Thanks for replying.


> The dependency of this spec on CURIEs and the evolution of the CURIE  
> draft
> necessarily delayed our dealing with comments on the role specification.
>
> Replies are embedded below:
>
>>
>> I have some comments on:
>>
>>     http://www.w3.org/TR/2007/WD-xhtml-role-20071004/
>>
>>
>> Document conformance says:
>>
>>     The document MUST conform to the constraints expressed in Appendix  
>> A -
>>     DTD Implementation, combined with the constraints expressed in its  
>> host
>>     language implementation.
>>
>> It is unclear to me what this means. *No* document can conform to the
>> constraints expressed in that DTD, because e.g. it doesn't declare any
>> elements, and a document has to have at least one element to be
>> well-formed. So it has to be when that DTD is *combined* with the host
>> language's DTD, but this is not what the draft says.
>>
>> In any case, I don't see why there is a DTD in the spec in the first
>> place. Why can't all conformance requirements be expressed in English
>> prose instead? What if the host language doesn't have a DTD?
>
> XHTML Modules are required to include implementation(s) and a prose
> specification.  We have corrected the boilerplate text that you correctly
> note is inappropriate in this specification.

So I take it that for languages that don't have a DTD, you can't conform  
to this spec.


>> Then it continues:
>>
>>     If the host language is not in the XHTML namespace, the document  
>> MUST
>>     contain an xmlns declaration for the XHTML Role Attribute Module
>>     namespace [XMLNAMES].
>>
>> Shouldn't that be s/xmlns/xmlns:*/, since attributes cannot be in a
>> namespace and not have a prefix (declaratively, anyway).
>>
>> Furthermore, why require the namespace *declaration*? If I want to add a
>> namespaced role attribute with script, I shouldn't have to also add a
>> namespace declaration with script. The namespace declaration is  
>> completely
>> useless in that case.
>
> There are two issues here.  First, how do we phase the requirement for
> declaring a namespace prefix.  We agree that "xmlns declaration" is a
> little colloquial.  However, we do not think that xmlns:* is appropriate
> either.  We have changed the language to indicate that you need to have a
> namespace declaration for the XHTML Namespace as required in the  
> namespace
> spec.

Just say that "the attribute must be in the XHTML namespace", and leave  
the means of doing so to other layers. Requiring namespace declarations  
means that authors who don't use the serialized form have to jump through  
useless hoops just to conform (or more likely they will ignore  
conformance).


> As to requiring a namespace declaration at all... First, XHTML doesn't
> really envision the idea of adding attributes to a document after it is
> loaded (after DOMready or the LOAD event fires).

Wow. I'm not sure what to say. I think there is a fundamental problem here  
if the WG has this position.

Adding an attribute dynamically is like the most trivial of things that  
authors are doing today. Moreover, ARIA would be almost completely useless  
if you *didn't* add and/or alter attributes dynamically.


> Second, referring to an element or attribute using a namespace prefix  
> that
> is NOT defined is invalid - so we cannot condone that.

You're thinking about the serialized form. It's completely ok to do that  
in the DOM. In fact, adding namespace declarations to the DOM is a rather  
pointless exercise (ditto about the namespace prefix).


>  You need a namespace
> declaration if you are going to reference the role attribute in its  
> namespace.

This is false.

Proof:

    var elm = document.createElementNS('urn:foo:bar', 'foo');
    elm.setAttributeNS('http://www.w3.org/1999/xhtml', 'role', 'bar');
    document.documentElement.appendChild(elm);

No namespace declarations involved here.

To conform to the current spec you'd have to do this:

    var elm = document.createElementNS('urn:foo:bar', 'foo');
    elm.setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:h',  
'http://www.w3.org/1999/xhtml');
    elm.setAttributeNS('http://www.w3.org/1999/xhtml', 'h:role', 'bar');
    document.documentElement.appendChild(elm);

...which is just silly.


> Note however that if the host language includes the role attribute in its
> own namespace, no such declaration NOR prefixing is required.

Indeed.


>> It should say that the attribute must be in the XHTML namespace, and not
>> say anything about namespace declarations.

(Hmm, apparently I'm repeating myself.)


>> Host Language Conformance says:
>>
>>     Finally, the attribute MUST be referenced using its  
>> namespace-qualified
>>     form (e.g., <myml:myelement xhtml:role='definition'>a
>>     term</myml:myelement>).
>>
>> This seems to be different from the previous version of the draft  where
>> it seems to imply that it is OK for host languages to use the attribute  
>> in
>> no namespace:
>>
>>     If the host language does not incorporate the XHTML Role Attribute
>>     Module attribute into its own namespace, [...]
>>       -- http://www.w3.org/TR/2006/WD-xhtml-role-20061113/
>>
>> Why was this changed? Why can't other host languages use role="" in no
>> namespace?
>
> We have changed this back.

Thank you.


>> User Agent Conformance says:
>>
>>     A conforming user agent MUST support all of the features required in
>>     this specification.
>>
>> As far as I can tell, there are no features required in this
>> specification, and therefore UAs can do nothing or anything and still be
>> conforming. Or to put it in another way, it seems to be impossible to
>> write test cases against this specification, and therefore it's  
>> impossible
>> to prove non-conformance.
>
> There are no required features, you are correct.  We have removed the  
> section.

Ok.


>> Compact URIs says:
>>
>>     A CURIE is comprised of two components, a prefix and a reference.  
>> The
>>     prefix is separated from the reference by a colon (:). It is  
>> possible to
>>     omit the prefix, and make use of the default prefix. It is also  
>> possible
>>     to omit both the prefix and the colon, leaving just a reference.
>>
>> This doesn't seem to match the production:
>>
>>     curie       :=   [ prefix [ ':' ] ] reference
>>
>> Shouldn't the production be:
>>
>>     curie       :=   [ [ prefix ] ':' ] reference
>>
>> ...to match the prose?
>
> Yes, and thanks for noticing.  However, we have removed the entire  
> section from
> the document in favor of referencing the CURIE spec.  We have taken the  
> liberty
> of adding the remainder of your comments on CURIEs to the collection of  
> comments
> on that document, and will respond to them in that context.

Thanks. I'll have a look at the new CURIE spec in due course.


>> The The XHTML Role Attribute section says:
>>
>>     The role attribute takes as its value one or more whitespace  
>> separated
>>     CURIEs.
>>
>> What does "role attribute" mean? An attribute with the local name "role"
>> in no namespace? That is part of an element in the
>> http://www.w3.org/1999/xhtml namespace? An attribute with the local name
>> "role" in the http://www.w3.org/1999/xhtml namespace? What are UAs to do
>> with namespaced role that is specified on XHTML elements? What are they  
>> to
>> do with no-namespace role that is specified on non-XHTML elements?
>
> The XHTML Modularization spec requires that you NOT use a prefixed  
> version
> of an attribute in the XHTML namespace on an element that is in the XHTML
> namespace.

Yes, but this doesn't say what UAs should do when authors do it anyway.

If a UA does something special with "role" attributes, then there are two  
possible things that the UA can do in this case. Either it ignores the  
attribute (as if it wasn't there), or it does the special thing that it  
does with "role" attributes. Please define which is correct behavior. I'd  
suggest to ignore the attribute. Likewise with no-namespace role on  
elements that don't support role "natively".


> The core of your question seems to be "what does 'role attribute' mean"?
> In the context of this specification, the term "role attribute" is meant  
> to
> be interpreted as any use of role that claims to conform to this
> specification, in whatever namespace it is being used.
>
>>
>> What is "whitespace"? How are UAs to extract the CURIEs from the  
>> attribute
>> value (e.g. when other specs require UAs to do something with a specific
>> CURIE)?
>
> Whitespace is a common term used in these specifications
> (see for example  
> http://www.w3.org/TR/html401/struct/global.html#adef-class).

Yes, and different specifications define it to mean different things. When  
you don't define what it means, UAs might end up using different  
interpretations about what whitespace is, and then we have an interop  
problem.

I'd suggest to define whitespace to be equivalent to HTML5 'space  
characters', namely U+0020, U+0009, U+000A, U+000B, U+000C, and U+000D.


>> Then it continues:
>>
>>     Any non-qualified value MUST be interpreted in the XHTML namespace,  
>> and
>>     MUST be taken from the list defined in this section.
>>
>> What is the XHTML namespace? (AFAICT, it could be one of
>> http://www.w3.org/1999/xhtml or http://www.w3.org/1999/xhtml/vocab# .)
>
> That is correct.  The use of the term "namespace" there was unfortunate.
>
> We have cleared up the text.

Ok.


>> Are these UA requirements? If so, what does it mean to interpret a value
>> in the XHTML namespace? What are UAs to do with non-qualified values not
>> found in the list? What about CURIEs that have a prefix that is bound to
>> the "XHTML namespace"?
>
> The CURIE spec clarifies this.  Basically, CURIEs with no prefix are
> permitted to be interpreted with a default prefix mapping.  What an
> application does with that interpretation is application specific.
>
>>
>> What are UAs to do when an element has more than one value found in the
>> list?
>
> As you have correctly pointed out, there are no UA behavior requirements
> in this spec.  So there is no guidance as to how single NOR multiple  
> values
> are to be interpted.  This is the same as, for example, the class  
> attribute
> in HTML 4 and XHTML.


Cheers,
-- 
Simon Pieters
Opera Software
Received on Monday, 28 January 2008 18:27:28 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 23 February 2010 18:12:47 GMT