[whatwg] Attribute for holding private data for scripting

Maciej Stachowiak mjs at apple.com
Wed Apr 11 01:48:05 PDT 2007


On Apr 10, 2007, at 11:42 PM, Jonas Sicking wrote:

>>> Here's a page I constructed, and tested on Firefox:
>>>
>>> http://intertwingly.net/stories/2007/04/10/test.html
>>>
>>> This page is meant to be served as application/xhtml+xml.
>>>
>>> Can you test it and see what results you get?  Then lets discuss  
>>> further.
>> In Safari 2.0.4: Processed as HTML, it says "data" and then "".  
>> Processed as XHTML, it says "null" and then "data".
>> In Opera 9.00: Processed as HTML, it says "data" and then "null".  
>> Processed as XHTML, it says "null" and then "data".
>> In Firefox 2.0.0.3: Processed as HTML, it says "data" and then "".  
>> Processed as XHTML, it says "data" and then "data".
>> In IE/Mac 5.2: Processed as HTML, it says "data" and the second  
>> alert does not appear. Processed as XHTML, neither alert appears.
>> It looks like Firefox's XHTML implementation already has the  
>> getAttribute extension I suggested of handling QNames.
>
> Firefox is AFAICT the one following spec here. The spec says that  
> getAttribute in a namespaced document should return the node with  
> the given qname.

I don't think the spec is clear on this.

http://www.w3.org/TR/DOM-Level-3-Core/core.html

The spec for getAttribute itself just says "getAttribute - retrieves  
an attribute value by name". It doesn't even specify that the name  
parameter should be the Attr.nodeName, like getAttributeNode does.  
Other parts of the spec do seem to imply this should be the qname,  
not the local name, so probably better to do it that way. Thanks for  
pointing this out.

Regards,
Maciej





More information about the whatwg mailing list