This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Document.createElement name validation rules (https://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-document-createelement) uses different validation from the HTML parser (http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#tag-name-state). This means that elements can be created via the parser which cannot be created via createElement. The parser rules are much more permissive. For what it's worth, I do not believe that any two browsers support the same exact set of unicode characters for document.createElement.
I too have found this troubling, but I was told there may be some compat risks with relaxing this restriction when I last asked about it.
(In reply to Pete Blois from comment #0) > I do not believe that any two browsers support the same exact > set of unicode characters for document.createElement. Can you give examples of inputs that are handled differently?
Examples: document.createElement('\u0083'); (FF 26- no, Chrome 31- no, IE 11- yes) document.createElement('\u00b5'); (FF 26- yes, Chrome 31- no, IE 11- yes) document.createElement('\u01f6'); (FF 26- no, Chrome 32- yes, IE 11- yes) document.createElement('\u01f7'); (FF 26- no, Chrome 32- yes, IE 11- no) The XML spec changed the validation from XML 1.0 Fourth Edition to XML 1.0 Fifth Edition- fourth edition was based on unicode character sets (http://www.w3.org/TR/2006/REC-xml-20060816/#NT-Letter)
I'm not going to make 4th vs 5th edition my problem. However, only the last two of your examples are testing the difference between those as far as I can tell. The first two should throw for either edition. So only Chrome makes some sense (though following the 5th edition is questionable).
I'm opposed to making any XML 1.0 5th edition-motivated code changes in Gecko. I think we should stick to 4th ed. until XML5/XML-ER arrives some day. If it doesn't break the Web, I'd be OK with permitting whatever the HTML parser can create.
As far as I can tell Chrome is compliant per 5th. Firefox wants to follow 4th but actually does not do that (it allows U+00B5 in XML). Not sure about IE11. However, none of that makes it clear whether we can allow the kind of names HTML allows, such as "x,". I recommend that if people want to take this further they get browsers to experiment with what is possible. I'd be happy to throw less exceptions here. I'm also happy to break the tie with XML if it's demonstrated that is possible. If you file bugs on browsers to do those experiments please cross-link with this bug.