This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 8550 - Add document.createElement("<div>") (Gecko quirks, IE)? [ms]
Summary: Add document.createElement("<div>") (Gecko quirks, IE)? [ms]
Status: CLOSED WORKSFORME
Alias: None
Product: HTML WG
Classification: Unclassified
Component: pre-LC1 HTML5 spec (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: LC
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-25 19:20 UTC by contributor
Modified: 2010-10-04 13:59 UTC (History)
9 users (show)

See Also:


Attachments

Description contributor 2009-12-25 19:20:23 UTC
Section: http://www.whatwg.org/specs/web-apps/current-work/#apis-in-html-documents

Comment:
Add document.createElement("<div>") (Gecko quirks, IE)? [ms]

Posted from: 91.180.133.13
Comment 1 Simon Pieters 2009-12-28 10:11:35 UTC
Have you found a need to implement this in WebKit?
Comment 2 Anne 2010-01-05 07:15:02 UTC
I'm not convinced we need to do this. I rather have it fixed in Gecko/WebKit.
Comment 3 Ian 'Hixie' Hickson 2010-01-06 12:12:58 UTC
Can we file bugs on Gecko/WebKit for this?
Comment 4 Maciej Stachowiak 2010-01-06 19:34:17 UTC
WebKit does not support this functionality. I'm not sure why it's mentioned here.
Comment 5 Anne 2010-01-06 21:37:42 UTC
Because you filed the bug. My bad.
Comment 6 Maciej Stachowiak 2010-01-06 22:04:06 UTC
I don't think it was me - I never file bugs through the comment form.
Comment 7 Anne 2010-01-06 22:08:54 UTC
Oh, is ms Mike Smith?
Comment 8 Ian 'Hixie' Hickson 2010-01-06 22:45:30 UTC
Ok, I'll file a bug on the UAs that do this and then reject this, unless anyone objects.
Comment 9 Ian 'Hixie' Hickson 2010-01-07 05:55:23 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Rejected
Change Description: no spec change
Rationale: Only IE seems to do this.
Comment 10 Henri Sivonen 2010-01-07 08:51:21 UTC
(In reply to comment #9)
> Rationale: Only IE seems to do this.

FWIW, Gecko supports document.createElement("<div>") in the quirks mode. It doesn't support specifying attributes on the pseudo-tag and doesn't support this variant in the Almost Standards and Standards modes.
http://software.hixie.ch/utilities/js/live-dom-viewer/saved/345
http://hg.mozilla.org/mozilla-central/file/abb82f981e02/content/html/document/src/nsHTMLDocument.cpp#l1225

The rationale for adding support was compat with IBM enterprise apps.
https://bugzilla.mozilla.org/show_bug.cgi?id=245274
Comment 11 Ian 'Hixie' Hickson 2010-01-07 09:06:04 UTC
Would Gecko be willing to remove support?
Would Webkit/Opera be willing to add support?

If we add support, can we do it in all modes? I really don't like mode differences, because, as demonstrated above, they are confusing.
Comment 12 Maciej Stachowiak 2010-01-07 09:32:23 UTC
(In reply to comment #11)
> Would Gecko be willing to remove support?
> Would Webkit/Opera be willing to add support?
> 
> If we add support, can we do it in all modes? I really don't like mode
> differences, because, as demonstrated above, they are confusing.
> 

If the quirk is truly necessary for Web compatibility, then I would not be opposed. A few notes though:

1) The Safari team gets a lot of input on enterprise Web apps, including those produced by IBM. These are usually high visibility compared to the average Web compat bug. So perhaps this usage was never that common and/or has faded.

2) Should createelement("<div>") make an element with tagName "div" or tagName "<div>"? In Mozilla it is the former, in IE the latter, supposedly either was good enough for the enterprise Web apps that depended on this in 2004.

3) In general I prefer not to have quirks mode switches in the DOM. On the other hand, making an element with < or > in its name is pretty bogus, and results in an unserializable document, so perhaps in this case quirks-only is justifiable.
Comment 13 Anne 2010-01-07 10:06:40 UTC
I filed https://bugzilla.mozilla.org/show_bug.cgi?id=489532 a while ago.
Comment 14 Jonas Sicking (Not reading bugmail) 2010-01-07 19:07:20 UTC
(In reply to comment #12)
> 2) Should createelement("<div>") make an element with tagName "div" or tagName
> "<div>"? In Mozilla it is the former, in IE the latter, supposedly either was
> good enough for the enterprise Web apps that depended on this in 2004.

This does not match my testing. Both gecko and IE create an element with tagName "div" for document.createElement("<div");

IE even supports
document.createElement("<div class=foo>");

which creates an element with a className of "foo". (any other attribute works equally well). Gecko does not support this attribute syntax though.

I guess I don't feel strongly here. I'd be fine with attempting to remove this quirk from gecko. Dunno how much success we'll have with convincing Microsoft of the same though.
Comment 15 Ms2ger 2010-07-17 09:45:22 UTC
The quirk was removed in Gecko: <http://hg.mozilla.org/mozilla-central/rev/ecdf587c02d0>.