RESOLVED FIXED Bug 16637
Acid3 expects ExeceptionCode constants to be defined on DOMException objects
https://bugs.webkit.org/show_bug.cgi?id=16637
Summary Acid3 expects ExeceptionCode constants to be defined on DOMException objects
Eric Seidel (no email)
Reported 2007-12-28 01:53:05 PST
Acid3 expect ExeceptionCode constants to be defined on DOMException objects http://www.hixie.ch/tests/evil/acid/003/NOT_READY_PLEASE_DO_NOT_USE.html function () { // test 34: value of constants var e = null; try { document.body.appendChild(document.documentElement); // raises a HIERARCHY_REQUEST_ERR } catch (err) { e = err; } if ((document.DOCUMENT_FRAGMENT_NODE == 11) && (document.body.COMMENT_NODE == 8) && (document.createTextNode('').ELEMENT_NODE == 1) && (e.HIERARCHY_REQUEST_ERR == 3) && (e.code == 3)) return 3; }, We pass every part of that test, except for "e.HIERARCHY_REQUEST_ERR == 3" e. HIERARCHY_REQUEST_ERR is not defined. http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187 Does not seem to agree with the test, but perhaps IE defines these constants on DOMException.
Attachments
Add test case (2.63 KB, patch)
2007-12-29 00:06 PST, Eric Seidel (no email)
no flags
An exceptional patch (HAR HAR HAR) (39.28 KB, patch)
2007-12-31 15:55 PST, Sam Weinig
darin: review+
Alexey Proskuryakov
Comment 1 2007-12-28 07:22:07 PST
AFAICT, only Firefox does. Firefox, Opera and WebKit all support DOMException.HIERARCHY_REQUEST_ERR (a constructor property).
Eric Seidel (no email)
Comment 2 2007-12-28 23:44:40 PST
Hixie has used the power of Appendix E to convince me. Prototype Object DOMException The DOMException class has the following constants: DOMException.INDEX_SIZE_ERR This constant is of type Number and its value is 1. Since Node defines a similar "Prototype Object Node", we are to assume that those constants are to be defined on the prototype for DOMException, and thus available on all DOMException instances.
Eric Seidel (no email)
Comment 3 2007-12-28 23:45:09 PST
Sadly, JSDOMException is not autogenerated (i'm not even sure it exists) otherwise this would be easy.
Eric Seidel (no email)
Comment 4 2007-12-29 00:06:43 PST
Created attachment 18167 [details] Add test case .../fast/dom/DOMException/prototype-object.html | 13 +++++++++++++ .../fast/dom/DOMException/resources/TEMPLATE.html | 13 +++++++++++++ .../dom/DOMException/resources/prototype-object.js | 15 +++++++++++++++ WebCore/WebCore.xcodeproj/project.pbxproj | 1 + 4 files changed, 42 insertions(+), 0 deletions(-)
Eric Seidel (no email)
Comment 5 2007-12-29 00:08:35 PST
Firefox passes this test case, we fail, opera fails too.
Sam Weinig
Comment 6 2007-12-31 15:55:46 PST
Created attachment 18219 [details] An exceptional patch (HAR HAR HAR)
Darin Adler
Comment 7 2007-12-31 16:06:08 PST
Comment on attachment 18219 [details] An exceptional patch (HAR HAR HAR) + // FIXME: this is copied from ExceptionCode.h, it needs to be kept in sync. And both need to be kept in sync with the standard! Why can't DOMCoreException use the values from ExceptionCode.h -- it includes that file, so it should be able to. Can we change things later so these are defined only in the .idl file? What about non-core errors? Can we make sure the name "DOMCoreException" doesn't show through in JavaScript? +shouldBeEqualToString("e.constructor.toString()", "[object DOMCoreExceptionConstructor]"); That should be "[object DOMExceptionConstructor]" -- we don't want to expose the naming conflict issues in WebKit to the web content. r=me
Sam Weinig
Comment 8 2007-12-31 19:04:44 PST
Landed in r29058.
Lucas Forschler
Comment 9 2019-02-06 09:02:38 PST
Mass moving XML DOM bugs to the "DOM" Component.
Note You need to log in before you can comment on or make changes to this bug.