Closed Bug 417491 Opened 16 years ago Closed 16 years ago

Element.setAttribute(':', ...) throws DOMException INVALID_CHARACTER_ERR

Categories

(Core :: DOM: Core & HTML, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9beta4

People

(Reporter: philip, Assigned: Waldo)

References

()

Details

Attachments

(1 file)

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9b4pre) Gecko/2008021304 Minefield/3.0b4pre

Element.setAttribute throws an INVALID_CHARACTER_ERR if the attribute name starts with a colon.

DOM 3 Core requires the attribute name to be an "XML name", which probably means <http://www.w3.org/TR/REC-xml/#NT-Name>, which allows a Name to start with a colon.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → DUPLICATE
Sound a bit like a bug in the DOM spec, as that attribute name would not be allowed in XML1.0+XMLNS (see http://www.w3.org/TR/REC-xml-names/#NT-NCNameStartChar).
This isn't an exact duplicate of bug 390816, ':' is a valid name start character but I don't think ';' is. We could allow this for createElement/setAttribute I guess :-(.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Attached patch PatchSplinter Review
Not sure how I missed this when reading specs in bug 411103.  Question is whether we want to do this or not, I guess...we threw a namespace error in Firefox 2, so no backwards compat concerns here.  It does simplify the code a touch.
Assignee: nobody → jwalden+bmo
Status: REOPENED → ASSIGNED
Attachment #303317 - Flags: superreview?(peterv)
Attachment #303317 - Flags: review?(peterv)
Attachment #303317 - Flags: superreview?(peterv)
Attachment #303317 - Flags: superreview+
Attachment #303317 - Flags: review?(peterv)
Attachment #303317 - Flags: review+
Comment on attachment 303317 [details] [diff] [review]
Patch

Corrects a minor incompatibility with the DOM core specs...
Attachment #303317 - Flags: approval1.9?
Comment on attachment 303317 [details] [diff] [review]
Patch

a=beltzner for 1.9
Attachment #303317 - Flags: approval1.9? → approval1.9+
Fixed.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago16 years ago
Flags: in-testsuite+
OS: Linux → All
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9beta4
Component: DOM: Core → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: