Bug 3622 - setAttribute is too restrictive on valid attribute names ("_" for instance)
Summary: setAttribute is too restrictive on valid attribute names ("_" for instance)
Status: RESOLVED DUPLICATE of bug 5317
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 412
Hardware: Mac OS X 10.4
: P3 Normal
Assignee: Nobody
URL: http://webfx.eae.net/dhtml/sortableta...
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-20 13:05 PDT by tommyboy78
Modified: 2019-02-06 09:03 PST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tommyboy78 2005-06-20 13:05:56 PDT
The page has buttons that should sort the table columns and also clicking on a column header should sort 
the column in question. Neither one does anything in Safari. Works correctly in Firefox, Opera and Win IE.
Comment 1 Joost de Valk (AlthA) 2005-06-21 23:10:08 PDT
It doesn't work in Safari and it does in firefox, confirming, switching to normal tho since i can't see how 
this is major or p2, so making it p3.
Comment 2 Anders Carlsson 2005-06-24 02:28:17 PDT
The problem here is that there's a call to 

c.setAttribute( "_sortType", oSortTypes[i] );

and "_sortType" is an invalid xml name because it can't begin with _ so an exception is thrown.

I've examined both WinIE and Gecko and they seem to be very liberal about what characters to allow in 
attribute and element names. I could even create an element with the name "*"! (This is true for both 
HTML and XHTML)

I'm not sure what the correct fix here is, we could be more liberal for HTML documents while still being 
restrictive for XML documents. 
Comment 3 Ian 'Hixie' Hickson 2005-06-25 18:14:20 PDT
"_sortType" seems like a valid XML name to me:
   http://www.w3.org/TR/xml11/#NT-NameStartChar
Comment 4 Eric Seidel (no email) 2005-12-28 00:07:23 PST
This has been reduced, we just need someone to write up a nice testcase for it now.  This should be a 
trivial fix.  ElementImpl::setAttributeNS is the method in question.  dom_elementimpl.cpp is the file.  I 
believe it uses validation routines for QualifiedName, but you'd have to check.
Comment 5 Daniele Metilli 2006-03-10 07:14:38 PST
It works for me with nightly 13244. I think this should be closed.
Comment 6 Alexey Proskuryakov 2006-03-10 10:55:10 PST

*** This bug has been marked as a duplicate of 5317 ***
Comment 7 Lucas Forschler 2019-02-06 09:03:44 PST
Mass moving XML DOM bugs to the "DOM" Component.