Closed Bug 233753 Opened 21 years ago Closed 21 years ago

GetDefaultNamespaceID creates does not return XHTML in HTML documents

Categories

(Core :: DOM: Core & HTML, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bc, Assigned: jst)

Details

Attachments

(1 file, 1 obsolete file)

Chatzilla and the DOM TS were broken due to the creation of XML Elements when calling document.createElement('tagname') from HTML Documents. This was introduced in bug 16603. jst has a patch.
err. correct summary.
Summary: GetDefaultNamespaceID creates does return XHTML in HTML documents → GetDefaultNamespaceID creates does not return XHTML in HTML documents
This makes document.createElement('foo') create an HTML element again if document is an HTML document.
Hmm... What will the namespace in the nodeinfo of the new node be then?
Wrong. And dbaron pointed that out to me too. New patch coming up. I'm basically reverting to the old CreateElement() code in nsHTMLDocument... Got too excited there when I figured out what was breaking everything :-)
Status: NEW → ASSIGNED
This should get it right, in all cases AFAICT.
Attachment #141109 - Attachment is obsolete: true
Attachment #141112 - Flags: superreview?(dbaron)
Attachment #141112 - Flags: review?(bzbarsky)
Comment on attachment 141112 [details] [diff] [review] Revert nsHTMLDocument::CreateElement() to what it used to be, more or less. r=bzbarsky
Attachment #141112 - Flags: review?(bzbarsky) → review+
Comment on attachment 141112 [details] [diff] [review] Revert nsHTMLDocument::CreateElement() to what it used to be, more or less. sr=dbaron, although it's worth noting (for the future) that you might want to be doing the case conversion before converting to UTF-8.
Attachment #141112 - Flags: superreview?(dbaron)
Attachment #141112 - Flags: superreview+
Attachment #141112 - Flags: review?(bzbarsky)
Attachment #141112 - Flags: review+
Attachment #141112 - Flags: review?(bzbarsky) → review+
Fix checked in, and I went ahead and changed the |tmp| string to an nsAutoString and called ToLowerCase() on it, and let the atom code to the UTF8 conversion. Slightly slower, but correct, and this is not on a performance critical path. Thanks for the reviews, marking FIXED.
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
So.. this patch actually makes us violate both DOM2 Core and DOM3 Core... See bug 280692.
Flags: in-testsuite?
Component: DOM: Core → DOM: Core & HTML
QA Contact: ian → general
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: