RESOLVED CONFIGURATION CHANGED 25893
createElement should support passing markup instead of just element name, e.g. document.createElement("<select readonly>")
https://bugs.webkit.org/show_bug.cgi?id=25893
Summary createElement should support passing markup instead of just element name, e.g...
Lúcio Flávio Corrêa
Reported 2009-05-20 10:46:51 PDT
Hey Guys. I'm trying to access a website (www.minhacasaminhavida.pe.gov.br) but webkit based browsers doesn't work with that. This is the message returned by WebInpector: INVALID_CHARACTER_ERR: DOM Exception 5 HTMLComponents.js:1962Error: INVALID_CHARACTER_ERR: DOM Exception 5 The file location is http://www.minhacasaminhavida.pe.gov.br/pmc/components/HTMLComponents.js Thanks in Advance
Attachments
Lúcio Flávio Corrêa
Comment 1 2009-05-20 15:27:12 PDT
(In reply to comment #0) > Hey Guys. I'm trying to access a website (www.minhacasaminhavida.pe.gov.br) but > webkit based browsers doesn't work with that. This is the message returned by > WebInpector: > > INVALID_CHARACTER_ERR: DOM Exception 5 > HTMLComponents.js:1962Error: INVALID_CHARACTER_ERR: DOM Exception 5 > > The file location is > http://www.minhacasaminhavida.pe.gov.br/pmc/components/HTMLComponents.js > > Thanks in Advance > Ah, forgot to add that it works in Firefox and IE too.
Alexey Proskuryakov
Comment 2 2009-05-21 05:50:54 PDT
Believe it or not, but Firefox successfully creates a SELECT element with document.createElement("<select>"). IE has a separate code path.
Eric Seidel (no email)
Comment 3 2009-05-21 05:53:04 PDT
Seems we should file a bug with mozilla.
Alexey Proskuryakov
Comment 4 2009-05-21 06:00:01 PDT
IE even supports document.createElement("<select readonly>"), but Firefox does not. My guess is that Firefox had to partially implement this IE quirk for web compatibility.
Alexey Proskuryakov
Comment 5 2010-08-30 10:25:46 PDT
*** Bug 44841 has been marked as a duplicate of this bug. ***
Alexey Proskuryakov
Comment 6 2010-08-30 10:27:37 PDT
Another example of a broken site in duplicate bug.
Evan Martin
Comment 7 2011-01-04 15:29:31 PST
Alexey Proskuryakov
Comment 8 2011-01-04 16:03:24 PST
> But it looks like they removed it in 2004: > http://hg.mozilla.org/mozilla-central/rev/ecdf587c02d0 In fact, that's July 2010, just weird date formatting. If Mozilla won't reconsider removing this quirk before shipping Firefox 4, we almost certainly don't want to add it.
Ms2ger (he/him; ⌚ UTC+1/+2)
Comment 9 2011-01-05 02:02:07 PST
I don't think Mozilla will add this quirk back. (At least, I'll do what I can to avoid it.) Lúcio, any chance you could contact the website? The changes they need to make come down to changing document.createElement("<img>") to document.createElement("img"). (The ones that are guarded by isIE checks are probably not problematic.)
Ahmad Saleem
Comment 10 2022-08-05 10:06:07 PDT
The test case from Mozilla Bug mentioned in Comment 07 behaves same across all browsers: Link - http://software.hixie.ch/utilities/js/live-dom-viewer/?%3Cscript%3Ew%28document.createElement%28%22%3Cx%3E%22%29%29%3C%2Fscript%3E ** Safari 15.6 on macOS 12.5 ** error: InvalidCharacterError: The string contains invalid characters. on line 1 rendering mode: BackCompat document has no title ** Firefox Nightly 105 ** error: InvalidCharacterError: String contains an invalid character on line 1 rendering mode: BackCompat document has no title ** Chrome Canary 106 ** error: Uncaught InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('<x>') is not a valid name. on line 1 rendering mode: BackCompat document has no title ____ Since all browsers are now matching with each other, I am going to mark this as "RESOLVED CONFIGURATION CHANGED". Please reopen, if I have mark it as wrong. Thanks!
Note You need to log in before you can comment on or make changes to this bug.