Bug 25111
| Summary: | document.implementation.createDocument is too lenient | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Eric Seidel (no email) <eric> |
| Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | ahmad.saleem792, ap, bfulgham, cdumez, jchaffraix, rniwa, rwlbuis |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | Mac | ||
| OS: | OS X 10.5 | ||
| Bug Depends on: | 25096 | ||
| Bug Blocks: | |||
Eric Seidel (no email)
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)
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Eric Seidel (no email)
The relevant portion of the DOM3 spec:
http://www.w3.org/TR/DOM-Level-3-Core/core.html#Level-2-Core-DOM-createDocument
Rob Buis
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?
Lucas Forschler
Mass moving XML DOM bugs to the "DOM" Component.
Ahmad Saleem
Safari 15.6 has full coverage of these in WPT:
https://wpt.fyi/results/dom/nodes?label=master&label=experimental&aligned&q=createdocument
Is there anything needed more here? Thanks!
Ryosuke Niwa
Neat. We're the only engine to pass all the tests even.