Bug 25111 - document.implementation.createDocument is too lenient
Summary: document.implementation.createDocument is too lenient
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 25096
Blocks:
  Show dependency treegraph
 
Reported: 2009-04-09 03:19 PDT by Eric Seidel (no email)
Modified: 2019-02-06 09:04 PST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2009-04-09 03:19:02 PDT
document.implementation.createDocument is too lenient

This was discovered while writing a test for bug 25096 (fast/dom/DOMImplementation/createDocument-namespace-err.html)
I copied fast/dom/Document/resources/createElementNS-namespace-err.js which was written as part of bug 16833.

Our failures:
FAIL createDocument(, null, null)
FAIL createDocument(null, null, null)
FAIL createDocument(null, "", null)
FAIL createDocument("", null, null)
FAIL createDocument("", "", null)

(No message means that we didn't throw an exception when one was expected... the test could be improved to display that.)

FF behavior:
FAIL createDocument(, null, null); expected INVALID_CHARACTER_ERR, threw NAMESPACE_ERR
FAIL createDocument(null, null, null)
FAIL createDocument(null, "", null)
FAIL createDocument("", null, null); expected INVALID_CHARACTER_ERR, threw NAMESPACE_ERR
FAIL createDocument("", "", null)
Comment 1 Eric Seidel (no email) 2009-04-09 03:28:55 PDT
The relevant portion of the DOM3 spec:
http://www.w3.org/TR/DOM-Level-3-Core/core.html#Level-2-Core-DOM-createDocument
Comment 2 Rob Buis 2013-07-04 09:14:13 PDT
When I read DOM4 it seems lenient too:

http://dom.spec.whatwg.org/#dom-domimplementation-createdocument

Whereas DOM2/3 was strict indeed:

http://www.w3.org/TR/DOM-Level-3-Core/core.html#Level-2-Core-DOM-createDocument
NAMESPACE_ERR: if the qualifiedName is null and the namespaceURI is different from null.

FF latest version seem to be lenient like us, for the given 5 subtests it matches WebKit:

FAIL createDocument(, null, null)
FAIL createDocument(null, null, null)
FAIL createDocument(null, "", null)
FAIL createDocument("", null, null)
FAIL createDocument("", "", null)

Should we close the bug?
Comment 3 Lucas Forschler 2019-02-06 09:04:06 PST
Mass moving XML DOM bugs to the "DOM" Component.