Closed
Bug 520969
Opened 15 years ago
Closed 4 years ago
HTMLness of the createDocument() return value should be false regardless of doctype
Categories
(Core :: DOM: Core & HTML, defect, P3)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla74
Tracking | Status | |
---|---|---|
firefox74 | --- | fixed |
People
(Reporter: hsivonen, Assigned: ehsan.akhgari)
References
(Depends on 1 open bug, )
Details
(Keywords: html5, Whiteboard: btpp-backlog [wpt-triaged])
Attachments
(1 file)
The code at http://hg.mozilla.org/mozilla-central/file/4d5760a4f96f/content/xml/document/src/nsXMLDocument.cpp#l123 is wrong per HTML5 http://www.whatwg.org/specs/web-apps/current-work/#html-documents HTML5 requires documents created with createDocument not to have the HTMLness bit set. Neither WebKit nor Opera sets the HTMLness bit from doctype. (Also: HTML5 requires all document objects to implement HTMLDocument and SVGDocument.)
Comment 1•15 years ago
|
||
Webkit creates XHTMLDocument only if namespace uri of the root element is XHTML. That is pretty wrong. Not sure what Opera does.
Comment 2•15 years ago
|
||
And Gecko uses doctype for document creation, because that is what should be used based on DOM 3 Core. I don't know why HTML5 doesn't allow creating HTML documents, only XHTML documents.
Comment 3•9 years ago
|
||
Per actual DOM this method should always create XMLDocument object, without additional treatment for the doctype. Other browsers works like that (I test Chrome, IE11, Opera-Presto), and only Firefox is still inconsistent here (and for example, can output HTMLDocument or SVGDocument). https://dom.spec.whatwg.org/#dom-domimplementation-createdocument I catch only one case, when Opera-Presto return HTMLness, but other browser still don't do this: <script> alert(document.implementation.createDocument("http://www.w3.org/1999/xhtml", "html", null)); </script>
Updated•8 years ago
|
Assignee: nobody → ayg
Status: NEW → ASSIGNED
Whiteboard: btpp-active
Comment 4•8 years ago
|
||
I'm not sure if we want to do this without fixing bug 897815. Making the document not HTML doesn't change much in spec-land, but for us it means you lose all the HTMLDocument-specific properties like .body.
Assignee: ayg → nobody
Status: ASSIGNED → NEW
Depends on: 897815
Whiteboard: btpp-active → btpp-backlog
Comment 5•8 years ago
|
||
Or, alternatively, if DOM issue 217 <https://github.com/whatwg/dom/issues/217> is resolved and we implement it, it should also be okay to fix this, because passing an HTML DTD but not the HTML namespace is silly and it probably doesn't matter what we do in that case. An example of a wpt test that newly fails if we implement this as-is is dom/nodes/Node-isEqualNode.html, which tests that .createHTMLDocument() returns the same as a suitably adjusted .createDocument().
Comment 6•8 years ago
|
||
(Try run for reference: https://treeherder.mozilla.org/#/jobs?repo=try&revision=f8ba1feb3c25)
Updated•6 years ago
|
Priority: -- → P3
Updated•5 years ago
|
Whiteboard: btpp-backlog → btpp-backlog [wpt-triaged]
Assignee | ||
Comment 7•4 years ago
|
||
Updated•4 years ago
|
Assignee: nobody → ehsan
Status: NEW → ASSIGNED
Pushed by eakhgari@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/347043d2f799 Make createDocument() always create XMLDocuments; r=smaug
Assignee | ||
Updated•4 years ago
|
Blocks: wpt.fyi-firefox-fails
Comment 9•4 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
status-firefox74:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla74
You need to log in
before you can comment on or make changes to this bug.
Description
•