Case of attribute names in HTML documents

Hi,

Section 1.3 of the DOM Level 2 HTML spec states:

"element and attribute names are exposed as all uppercase (for 
consistency) when used on an HTML document, regardless of the character 
case used in the markup"

However, some of the test cases rely on the attribute name being returned 
as lowercase, even though the document is html. For example, in 
hc_attrname.html in the jsunit tests:

streetAttr = attributes.getNamedItem("class");
strong = streetAttr.nodeName;
assertEquals("nodeName","class",strong);

Other tests, such as hc_nodecloneattributescopied.html expect uppercase:

for(var _index = 0; _index < attributes.length; _index++) {
  attributeNode = attributes.item(_index);
  attributeName = attributeNode.nodeName;
  result[result.length] = attributeName;
}
   
assertEqualsCollection("nodeNames",this.builder.toAutoCaseArray(expectedResult),result);

Mozilla & IE both return the nodeName as lowercase, but KHTML returns it 
as uppercase. Am I correct in assuming this is the correct behaviour?

-- 
Peter Kelly
pmk@kde.org

Received on Saturday, 8 February 2003 02:06:33 UTC