Bug 25893 - createElement should support passing markup instead of just element name, e.g. document.createElement("<select readonly>")
Summary: createElement should support passing markup instead of just element name, e.g...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
: 44841 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-05-20 10:46 PDT by Lúcio Flávio Corrêa
Modified: 2011-01-05 02:02 PST (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lúcio Flávio Corrêa 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
Comment 1 Lúcio Flávio Corrêa 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.
Comment 2 Alexey Proskuryakov 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.
Comment 3 Eric Seidel (no email) 2009-05-21 05:53:04 PDT
Seems we should file a bug with mozilla.
Comment 4 Alexey Proskuryakov 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.
Comment 5 Alexey Proskuryakov 2010-08-30 10:25:46 PDT
*** Bug 44841 has been marked as a duplicate of this bug. ***
Comment 6 Alexey Proskuryakov 2010-08-30 10:27:37 PDT
Another example of a broken site in duplicate bug.
Comment 7 Evan Martin 2011-01-04 15:29:31 PST
Alexey's guess in comment 4 is correct:

Mozilla bug discussing the problem:
https://bugzilla.mozilla.org/show_bug.cgi?id=489532

Diff showing they added angle brackets:
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/content/html/document/src/nsHTMLDocument.cpp&rev=3.791&mark=1459,1467-1473#1458

But it looks like they removed it in 2004:
http://hg.mozilla.org/mozilla-central/rev/ecdf587c02d0
Comment 8 Alexey Proskuryakov 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.
Comment 9 Ms2ger (he/him; ⌚ UTC+1/+2) 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.)