User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9b3pre) Gecko/2008011304 Minefield/3.0b3pre
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9b3pre) Gecko/2008011304 Minefield/3.0b3pre
When you give document.createComment a string which can't appear in a comment according to XML rules, the method throws an exception.
This is non-standard behavior. See DOM level 3 core:
No lexical check is done on the content of a comment and it is therefore possible to have the character sequence "--" (double-hyphen) in the content, which is illegal in a comment per section 2.5 of [XML 1.0]. The presence of this character sequence must generate a fatal error during serialization.
Steps to Reproduce:
1.Type document.createComment("--") in the JS console
An exception is thrown:
A Comment node containing the string "--" should be created
Still present in Firefox 4.0 RC, and still a bug per the current DOM Core spec:
All other browsers tested (IE 9 RC, Chrome 11 dev, Opera 11) create the comment successfully.
Yeah, we should probably undo the createComment change from bug 352728.
Same for CDATASection, I think.
*** Bug 750337 has been marked as a duplicate of this bug. ***
Created attachment 633110 [details] [diff] [review]
This might well still cause test failures, but they should be simple to fix. Try: https://tbpl.mozilla.org/?tree=Try&rev=3ea71ee9f5c5
Comment on attachment 633110 [details] [diff] [review]
should https://hg.mozilla.org/integration/mozilla-inbound/rev/bc241a81c6a5#l2.65 read "should" rather than "shouldn't"?
(In reply to Mike "Pomax" Kamermans from comment #8)
> read "should" rather than "shouldn't"?
Oops -- thanks!