- From: <bugzilla@jessica.w3.org>
- Date: Mon, 12 Mar 2012 20:51:45 +0000
- To: www-dom@w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=16333 Summary: Exceptions Product: WebAppsWG Version: unspecified Platform: PC URL: http://lists.w3.org/Archives/Public/www-dom/2011JanMar /0065.html OS/Version: Windows NT Status: NEW Keywords: LC Severity: normal Priority: P2 Component: DOM3 Events AssignedTo: travil@microsoft.com ReportedBy: travil@microsoft.com QAContact: public-webapps-bugzilla@w3.org CC: mike@w3.org, annevk@opera.com, www-dom@w3.org PORTING from TRACKER, ISSUE-186 [see http://lists.w3.org/Archives/Public/www-dom/2011JanMar/0065.html] I removed EventException from DOM Core and I think that change makes sense. We use DOMException for most of our APIs. Only dispatchEvent() throws exceptions of this type and it seems like unneeded complexity to me. DOM Level 3 Events says dispatchEvent() can throw these exceptions: EventException.UNSPECIFIED_EVENT_TYPE_ERR, EventException.DISPATCH_REQUEST_ERR, DOMException.NOT_SUPPORTED_ERR, and DOMException.INVALID_CHARACTER_ERR. I have not been able to get implementations to throw any of the latter two exceptions. Examples would be most welcome. In fact the text for INVALID_CHARACTER_ERR seems to overlap with UNSPECIFIED_EVENT_TYPE_ERR as they are both talking about restrictions on Event.type. However, what the restrictions on Event.type are is not at all clear. Event.type only says that no events should be created that contain whitespace. It does not say anything about the empty string, or whether initializing events with whitespace in their type will throw an error or not (either then or later). I do not think we need UNSPECIFIED_EVENT_TYPE_ERR at all really. Why should we require invoking initEvent()? And DISPATCH_REQUEST_ERR could easily be replaced by INVALID_STATE_ERR. We use it that way in tons of APIs. ------------------ From: Ojan Vafai <ojan@chromium.org> Date: Wed, 9 Mar 2011 19:21:52 +1100 This change sounds good to me. I generally support simplifying and consolidating the exceptions thrown. I'm strongly suspect we could change the exceptions thrown in most cases without a hit to web compatibility. On Sat, Mar 5, 2011 at 1:52 AM, Anne van Kesteren <annevk@opera.com> wrote: > I removed EventException from DOM Core and I think that change makes sense. > We use DOMException for most of our APIs. Only dispatchEvent() throws > exceptions of this type and it seems like unneeded complexity to me. > > DOM Level 3 Events says dispatchEvent() can throw these exceptions: > EventException.UNSPECIFIED_EVENT_TYPE_ERR, > EventException.DISPATCH_REQUEST_ERR, DOMException.NOT_SUPPORTED_ERR, and > DOMException.INVALID_CHARACTER_ERR. > > I have not been able to get implementations to throw any of the latter two > exceptions. Examples would be most welcome. WebKit does throw NOT_SUPPORTED_ERR in a number of cases (see http://codesearch.google.com/codesearch?as_q=NOT_SUPPORTED_ERR&vert=chromium&as_lang=c%2B%2B&as_filename=WebKit). I haven't looked at most of these to see if they are actually valid uses of this exception or if the code can even be hit. It took some hunting but I finally got it to fire in one case to fire in a real page, http://plexode.com/eval3/#jt=document.createTreeWalker(). > In fact the text for INVALID_CHARACTER_ERR seems to overlap with > UNSPECIFIED_EVENT_TYPE_ERR as they are both talking about restrictions on > Event.type. However, what the restrictions on Event.type are is not at all > clear. Event.type only says that no events should be created that contain > whitespace. It does not say anything about the empty string, or whether > initializing events with whitespace in their type will throw an error or not > (either then or later). > > I do not think we need UNSPECIFIED_EVENT_TYPE_ERR at all really. Why should > we require invoking initEvent()? > Indeed. -- Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
Received on Monday, 12 March 2012 20:51:52 UTC