Bug 25111

Summary: document.implementation.createDocument is too lenient
Product: WebKit Reporter: Eric Seidel (no email) <eric>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ap, cdumez, jchaffraix, rwlbuis
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Macintosh   
OS: OS X 10.5   
Bug Depends on: 25096    
Bug Blocks:    

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.