This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 6729 - Attribute getters/setters should lower case argument on HTML elements in HTML docs
Summary: Attribute getters/setters should lower case argument on HTML elements in HTML...
Alias: None
Product: HTML WG
Classification: Unclassified
Component: pre-LC1 HTML5 spec (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
Keywords: NoReply
Depends on:
Reported: 2009-03-24 08:35 UTC by Henri Sivonen
Modified: 2010-10-04 13:55 UTC (History)
3 users (show)

See Also:


Description Henri Sivonen 2009-03-24 08:35:16 UTC
The spec says that Element.setAttribute() should lower case its argument. This is bad for SVG.

Instead, the spec should say that in an HTML document, setAttribute, getAttribute and getAttributeNode on HTMLElement objects must lower case the attribute name argument. 

Comment 1 Ian 'Hixie' Hickson 2009-03-31 01:29:58 UTC
The spec already seems to say this... Am I missing something?
Comment 2 Henri Sivonen 2009-03-31 11:39:54 UTC
Sorry. I was looking at the interface name and missed the sentence: "This does not apply to XML documents or to elements that are not in the HTML namespace despite being in HTML documents." Indeed, the spec says this for setAttribute.

However, it doesn't say it for getAttribute and getAttributeNode.
Comment 3 Ian 'Hixie' Hickson 2009-03-31 19:51:24 UTC
Why would getAttribute() or getAttributeNode() do anything special?
Comment 4 Henri Sivonen 2009-04-01 15:07:51 UTC
For performance and consistency with past behavior, the actual matching should be exact matching after the argument has been lower cased.
Comment 5 Ian 'Hixie' Hickson 2009-04-01 21:16:03 UTC
I agree entirely, but that would argue for mutation when setting, not getting.
Comment 6 Henri Sivonen 2009-04-02 07:18:04 UTC
Assume the internal representation is interned "foobar" and assume you call getAttribute("FooBar"). Now you have to lowercase the argument in order to do pointer compares with interned strings.

That is, I'm arguing that the spec doesn't match Gecko/WebKit reality when it says the comparison operation should be case-insensitive.
Comment 7 Ian 'Hixie' Hickson 2009-05-29 00:43:53 UTC
The spec in fact doesn't say anything about getAttribute() at all.
Comment 8 Ian 'Hixie' Hickson 2009-05-29 00:47:35 UTC
Added a section on getAttribute() and getAttributeNS() that says that the argument is lowercased first.
Comment 9 Maciej Stachowiak 2010-03-14 13:17:06 UTC
This bug predates the HTML Working Group Decision Policy.

If you are satisfied with the resolution of this bug, please change the state of this bug to CLOSED. If
you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:

This bug is now being moved to VERIFIED. Please respond within two weeks. If this bug is not closed, reopened or escalated within two weeks, it may be marked as NoReply and will no longer be considered a pending comment.