Summary: | Acid3 expects ExeceptionCode constants to be defined on DOMException objects | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Eric Seidel (no email) <eric> | ||||||
Component: | DOM | Assignee: | Sam Weinig <sam> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | ap, cdumez, dstorey, sam | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Mac | ||||||||
OS: | OS X 10.4 | ||||||||
URL: | http://www.hixie.ch/tests/evil/acid/003/NOT_READY_PLEASE_DO_NOT_USE.html | ||||||||
Attachments: |
|
Description
Eric Seidel (no email)
2007-12-28 01:53:05 PST
AFAICT, only Firefox does. Firefox, Opera and WebKit all support DOMException.HIERARCHY_REQUEST_ERR (a constructor property). 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. Sadly, JSDOMException is not autogenerated (i'm not even sure it exists) otherwise this would be easy. 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(-)
Firefox passes this test case, we fail, opera fails too. Created attachment 18219 [details]
An exceptional patch (HAR HAR HAR)
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
Mass moving XML DOM bugs to the "DOM" Component. |