Bug 829072 part 1. Move the event handlers that are shared by HTMLElement, Document, and Window onto a GlobalEventHandlers interface that can be on the RHS of 'implements'. r=peterv
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 29 Jan 2013 08:44:00 -0500
changeset 120210 36bf86ca4abdc4bf4af8d3f1e36dec519a7e86e8
parent 120209 95b168efcfe8fc4bc7facc9c0d511d00abd49fe2
child 120211 a3a09614f5327f84df72be65aab5a0c82507d4fb
push id24243
push userryanvm@gmail.com
push dateWed, 30 Jan 2013 00:49:21 +0000
treeherdermozilla-central@5c248ef0fe62 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs829072
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 829072 part 1. Move the event handlers that are shared by HTMLElement, Document, and Window onto a GlobalEventHandlers interface that can be on the RHS of 'implements'. r=peterv
dom/webidl/Document.webidl
dom/webidl/EventHandler.webidl
dom/webidl/HTMLElement.webidl
dom/webidl/SVGElement.webidl
--- a/dom/webidl/Document.webidl
+++ b/dom/webidl/Document.webidl
@@ -139,132 +139,32 @@ partial interface Document {
   //(HTML only)boolean queryCommandIndeterm(DOMString commandId);
   //(HTML only)boolean queryCommandState(DOMString commandId);
   //(HTML only)boolean queryCommandSupported(DOMString commandId);
   //(HTML only)DOMString queryCommandValue(DOMString commandId);
   //(Not implemented)readonly attribute HTMLCollection commands;
 
   // event handler IDL attributes
            [SetterThrows]
-           attribute EventHandler onabort;
-           [SetterThrows]
            attribute EventHandler onblur;
-  //(Not implemented)         attribute EventHandler oncancel;
-           [SetterThrows]
-           attribute EventHandler oncanplay;
-           [SetterThrows]
-           attribute EventHandler oncanplaythrough;
-           [SetterThrows]
-           attribute EventHandler onchange;
-           [SetterThrows]
-           attribute EventHandler onclick;
-  //(Not implemented)         attribute EventHandler onclose;
-           [SetterThrows]
-           attribute EventHandler oncontextmenu;
-  //(Not implemented)         attribute EventHandler oncuechange;
-           [SetterThrows]
-           attribute EventHandler ondblclick;
-           [SetterThrows]
-           attribute EventHandler ondrag;
-           [SetterThrows]
-           attribute EventHandler ondragend;
-           [SetterThrows]
-           attribute EventHandler ondragenter;
-           [SetterThrows]
-           attribute EventHandler ondragleave;
-           [SetterThrows]
-           attribute EventHandler ondragover;
-           [SetterThrows]
-           attribute EventHandler ondragstart;
-           [SetterThrows]
-           attribute EventHandler ondrop;
-           [SetterThrows]
-           attribute EventHandler ondurationchange;
-           [SetterThrows]
-           attribute EventHandler onemptied;
-           [SetterThrows]
-           attribute EventHandler onended;
            [SetterThrows]
            attribute EventHandler onerror;
            [SetterThrows]
            attribute EventHandler onfocus;
            [SetterThrows]
-           attribute EventHandler oninput;
-           [SetterThrows]
-           attribute EventHandler oninvalid;
-           [SetterThrows]
-           attribute EventHandler onkeydown;
-           [SetterThrows]
-           attribute EventHandler onkeypress;
-           [SetterThrows]
-           attribute EventHandler onkeyup;
-           [SetterThrows]
            attribute EventHandler onload;
            [SetterThrows]
-           attribute EventHandler onloadeddata;
-           [SetterThrows]
-           attribute EventHandler onloadedmetadata;
-           [SetterThrows]
-           attribute EventHandler onloadstart;
-           [SetterThrows]
-           attribute EventHandler onmousedown;
-           [SetterThrows]
-           attribute EventHandler onmousemove;
-           [SetterThrows]
-           attribute EventHandler onmouseout;
-           [SetterThrows]
-           attribute EventHandler onmouseover;
-           [SetterThrows]
-           attribute EventHandler onmouseup;
-  //(Not implemented)         attribute EventHandler onmousewheel;
-           [SetterThrows]
-           attribute EventHandler onpause;
-           [SetterThrows]
-           attribute EventHandler onplay;
-           [SetterThrows]
-           attribute EventHandler onplaying;
-           [SetterThrows]
-           attribute EventHandler onprogress;
-           [SetterThrows]
-           attribute EventHandler onratechange;
-           [SetterThrows]
-           attribute EventHandler onreset;
-           [SetterThrows]
            attribute EventHandler onscroll;
-           [SetterThrows]
-           attribute EventHandler onseeked;
-           [SetterThrows]
-           attribute EventHandler onseeking;
-           [SetterThrows]
-           attribute EventHandler onselect;
-           [SetterThrows]
-           attribute EventHandler onshow;
-           [SetterThrows]
-           attribute EventHandler onstalled;
-           [SetterThrows]
-           attribute EventHandler onsubmit;
-           [SetterThrows]
-           attribute EventHandler onsuspend;
-           [SetterThrows]
-           attribute EventHandler ontimeupdate;
-           [SetterThrows]
-           attribute EventHandler onvolumechange;
-           [SetterThrows]
-           attribute EventHandler onwaiting;
 
   // special event handler IDL attributes that only apply to Document objects
   [LenientThis, SetterThrows] attribute EventHandler onreadystatechange;
 
   // Gecko extensions?
   [LenientThis, SetterThrows] attribute EventHandler onmouseenter;
   [LenientThis, SetterThrows] attribute EventHandler onmouseleave;
-  [SetterThrows] attribute EventHandler onmozfullscreenchange;
-  [SetterThrows] attribute EventHandler onmozfullscreenerror;
-  [SetterThrows] attribute EventHandler onmozpointerlockchange;
-  [SetterThrows] attribute EventHandler onmozpointerlockerror;
   [SetterThrows] attribute EventHandler onwheel;
   [SetterThrows] attribute EventHandler oncopy;
   [SetterThrows] attribute EventHandler oncut;
   [SetterThrows] attribute EventHandler onpaste;
   [SetterThrows] attribute EventHandler onbeforescriptexecute;
   [SetterThrows] attribute EventHandler onafterscriptexecute;
   /**
    * True if this document is synthetic : stand alone image, video, audio file,
@@ -441,8 +341,9 @@ partial interface Document {
   [Creator, Pref="dom.w3c_touch_events.expose"]
   TouchList createTouchList();
   [Creator, Pref="dom.w3c_touch_events.expose"]
   TouchList createTouchList(sequence<Touch> touches);
   */
 };
 
 Document implements XPathEvaluator;
+Document implements GlobalEventHandlers;
--- a/dom/webidl/EventHandler.webidl
+++ b/dom/webidl/EventHandler.webidl
@@ -16,8 +16,124 @@ typedef EventHandlerNonNull? EventHandle
 
 [TreatNonCallableAsNull]
 callback BeforeUnloadEventHandlerNonNull = DOMString? (Event event);
 typedef BeforeUnloadEventHandlerNonNull? BeforeUnloadEventHandler;
 
 [TreatNonCallableAsNull]
 callback OnErrorEventHandlerNonNull = boolean ((Event or DOMString) event, optional DOMString source, optional unsigned long lineno, optional unsigned long column);
 typedef OnErrorEventHandlerNonNull? OnErrorEventHandler;
+
+[NoInterfaceObject]
+interface GlobalEventHandlers {
+           [SetterThrows]
+           attribute EventHandler onabort;
+           //(Not implemented)[SetterThrows]
+           //(Not implemented)attribute EventHandler oncancel;
+           [SetterThrows]
+           attribute EventHandler oncanplay;
+           [SetterThrows]
+           attribute EventHandler oncanplaythrough;
+           [SetterThrows]
+           attribute EventHandler onchange;
+           [SetterThrows]
+           attribute EventHandler onclick;
+           //(Not implemented)[SetterThrows]
+           //(Not implemented)attribute EventHandler onclose;
+           [SetterThrows]
+           attribute EventHandler oncontextmenu;
+           //(Not implemented)[SetterThrows]
+           //(Not implemented)attribute EventHandler oncuechange;
+           [SetterThrows]
+           attribute EventHandler ondblclick;
+           [SetterThrows]
+           attribute EventHandler ondrag;
+           [SetterThrows]
+           attribute EventHandler ondragend;
+           [SetterThrows]
+           attribute EventHandler ondragenter;
+           [SetterThrows]
+           attribute EventHandler ondragleave;
+           [SetterThrows]
+           attribute EventHandler ondragover;
+           [SetterThrows]
+           attribute EventHandler ondragstart;
+           [SetterThrows]
+           attribute EventHandler ondrop;
+           [SetterThrows]
+           attribute EventHandler ondurationchange;
+           [SetterThrows]
+           attribute EventHandler onemptied;
+           [SetterThrows]
+           attribute EventHandler onended;
+           [SetterThrows]
+           attribute EventHandler oninput;
+           [SetterThrows]
+           attribute EventHandler oninvalid;
+           [SetterThrows]
+           attribute EventHandler onkeydown;
+           [SetterThrows]
+           attribute EventHandler onkeypress;
+           [SetterThrows]
+           attribute EventHandler onkeyup;
+           [SetterThrows]
+           attribute EventHandler onloadeddata;
+           [SetterThrows]
+           attribute EventHandler onloadedmetadata;
+           [SetterThrows]
+           attribute EventHandler onloadstart;
+           [SetterThrows]
+           attribute EventHandler onmousedown;
+           [SetterThrows]
+           attribute EventHandler onmousemove;
+           [SetterThrows]
+           attribute EventHandler onmouseout;
+           [SetterThrows]
+           attribute EventHandler onmouseover;
+           [SetterThrows]
+           attribute EventHandler onmouseup;
+           //(Not implemented)[SetterThrows]
+           //(Not implemented)attribute EventHandler onmousewheel;
+           [SetterThrows]
+           attribute EventHandler onpause;
+           [SetterThrows]
+           attribute EventHandler onplay;
+           [SetterThrows]
+           attribute EventHandler onplaying;
+           [SetterThrows]
+           attribute EventHandler onprogress;
+           [SetterThrows]
+           attribute EventHandler onratechange;
+           [SetterThrows]
+           attribute EventHandler onreset;
+           [SetterThrows]
+           attribute EventHandler onseeked;
+           [SetterThrows]
+           attribute EventHandler onseeking;
+           [SetterThrows]
+           attribute EventHandler onselect;
+           [SetterThrows]
+           attribute EventHandler onshow;
+           //(Not implemented)[SetterThrows]
+           //(Not implemented)attribute EventHandler onsort;
+           [SetterThrows]
+           attribute EventHandler onstalled;
+           [SetterThrows]
+           attribute EventHandler onsubmit;
+           [SetterThrows]
+           attribute EventHandler onsuspend;
+           [SetterThrows]
+           attribute EventHandler ontimeupdate;
+           [SetterThrows]
+           attribute EventHandler onvolumechange;
+           [SetterThrows]
+           attribute EventHandler onwaiting;
+
+           // Mozilla-specific handlers
+           [SetterThrows]
+           attribute EventHandler onmozfullscreenchange;
+           [SetterThrows]
+           attribute EventHandler onmozfullscreenerror;
+           [SetterThrows]
+           attribute EventHandler onmozpointerlockchange;
+           [SetterThrows]
+           attribute EventHandler onmozpointerlockerror;
+};
--- a/dom/webidl/HTMLElement.webidl
+++ b/dom/webidl/HTMLElement.webidl
@@ -73,136 +73,27 @@ interface HTMLElement : Element {
   //readonly attribute boolean? commandChecked;
 
   // styling
   [Constant]
   readonly attribute CSSStyleDeclaration style;
 
   // event handler IDL attributes
   [SetterThrows]
-           attribute EventHandler onabort;
-  [SetterThrows]
            attribute EventHandler onblur;
-  //[SetterThrows]
-  //         attribute EventHandler oncancel;
-  [SetterThrows]
-           attribute EventHandler oncanplay;
-  [SetterThrows]
-           attribute EventHandler oncanplaythrough;
-  [SetterThrows]
-           attribute EventHandler onchange;
-  [SetterThrows]
-           attribute EventHandler onclick;
-  //[SetterThrows]
-  //         attribute EventHandler onclose;
-  [SetterThrows]
-           attribute EventHandler oncontextmenu;
-  //[SetterThrows]
-  //         attribute EventHandler oncuechange;
-  [SetterThrows]
-           attribute EventHandler ondblclick;
-  [SetterThrows]
-           attribute EventHandler ondrag;
-  [SetterThrows]
-           attribute EventHandler ondragend;
-  [SetterThrows]
-           attribute EventHandler ondragenter;
-  [SetterThrows]
-           attribute EventHandler ondragleave;
-  [SetterThrows]
-           attribute EventHandler ondragover;
-  [SetterThrows]
-           attribute EventHandler ondragstart;
-  [SetterThrows]
-           attribute EventHandler ondrop;
-  [SetterThrows]
-           attribute EventHandler ondurationchange;
-  [SetterThrows]
-           attribute EventHandler onemptied;
-  [SetterThrows]
-           attribute EventHandler onended;
   // We think the spec is wrong here.
   //         attribute OnErrorEventHandler onerror;
   [SetterThrows]
            attribute EventHandler onerror;
   [SetterThrows]
            attribute EventHandler onfocus;
   [SetterThrows]
-           attribute EventHandler oninput;
-  [SetterThrows]
-           attribute EventHandler oninvalid;
-  [SetterThrows]
-           attribute EventHandler onkeydown;
-  [SetterThrows]
-           attribute EventHandler onkeypress;
-  [SetterThrows]
-           attribute EventHandler onkeyup;
-  [SetterThrows]
            attribute EventHandler onload;
   [SetterThrows]
-           attribute EventHandler onloadeddata;
-  [SetterThrows]
-           attribute EventHandler onloadedmetadata;
-  [SetterThrows]
-           attribute EventHandler onloadstart;
-  [SetterThrows]
-           attribute EventHandler onmousedown;
-  [SetterThrows]
-           attribute EventHandler onmousemove;
-  [SetterThrows]
-           attribute EventHandler onmouseout;
-  [SetterThrows]
-           attribute EventHandler onmouseover;
-  [SetterThrows]
-           attribute EventHandler onmouseup;
-  //[SetterThrows]
-  //         attribute EventHandler onmousewheel;
-  [SetterThrows]
-           attribute EventHandler onpause;
-  [SetterThrows]
-           attribute EventHandler onplay;
-  [SetterThrows]
-           attribute EventHandler onplaying;
-  [SetterThrows]
-           attribute EventHandler onprogress;
-  [SetterThrows]
-           attribute EventHandler onratechange;
-  [SetterThrows]
-           attribute EventHandler onreset;
-  [SetterThrows]
            attribute EventHandler onscroll;
-  [SetterThrows]
-           attribute EventHandler onseeked;
-  [SetterThrows]
-           attribute EventHandler onseeking;
-  [SetterThrows]
-           attribute EventHandler onselect;
-  [SetterThrows]
-           attribute EventHandler onshow;
-  [SetterThrows]
-           attribute EventHandler onstalled;
-  [SetterThrows]
-           attribute EventHandler onsubmit;
-  [SetterThrows]
-           attribute EventHandler onsuspend;
-  [SetterThrows]
-           attribute EventHandler ontimeupdate;
-  [SetterThrows]
-           attribute EventHandler onvolumechange;
-  [SetterThrows]
-           attribute EventHandler onwaiting;
-
-  [SetterThrows]
-           attribute EventHandler onmozfullscreenchange;
-  [SetterThrows]
-           attribute EventHandler onmozfullscreenerror;
-  [SetterThrows]
-           attribute EventHandler onmozpointerlockchange;
-  [SetterThrows]
-           attribute EventHandler onmozpointerlockerror;
 
   // Mozilla specific stuff
   // FIXME Bug 810677 Move className from HTMLElement to Element
            attribute DOMString className;
 
   [SetterThrows,Pref="dom.w3c_touch_events.expose"]
            attribute EventHandler ontouchstart;
   [SetterThrows,Pref="dom.w3c_touch_events.expose"]
@@ -228,9 +119,11 @@ interface HTMLElement : Element {
 partial interface HTMLElement {
   readonly attribute Element? offsetParent;
   readonly attribute long offsetTop;
   readonly attribute long offsetLeft;
   readonly attribute long offsetWidth;
   readonly attribute long offsetHeight;
 };
 
+HTMLElement implements GlobalEventHandlers;
+
 interface HTMLUnknownElement : HTMLElement {};
--- a/dom/webidl/SVGElement.webidl
+++ b/dom/webidl/SVGElement.webidl
@@ -31,136 +31,27 @@ interface SVGElement : Element {
   attribute DOMString xmlspace;*/
 
   [Throws]
   readonly attribute SVGSVGElement? ownerSVGElement;
   readonly attribute SVGElement? viewportElement;
 
   // event handler IDL attributes
   [SetterThrows]
-           attribute EventHandler onabort;
-  [SetterThrows]
            attribute EventHandler onblur;
-  //[SetterThrows]
-  //         attribute EventHandler oncancel;
-  [SetterThrows]
-           attribute EventHandler oncanplay;
-  [SetterThrows]
-           attribute EventHandler oncanplaythrough;
-  [SetterThrows]
-           attribute EventHandler onchange;
-  [SetterThrows]
-           attribute EventHandler onclick;
-  //[SetterThrows]
-  //         attribute EventHandler onclose;
-  [SetterThrows]
-           attribute EventHandler oncontextmenu;
-  //[SetterThrows]
-  //         attribute EventHandler oncuechange;
-  [SetterThrows]
-           attribute EventHandler ondblclick;
-  [SetterThrows]
-           attribute EventHandler ondrag;
-  [SetterThrows]
-           attribute EventHandler ondragend;
-  [SetterThrows]
-           attribute EventHandler ondragenter;
-  [SetterThrows]
-           attribute EventHandler ondragleave;
-  [SetterThrows]
-           attribute EventHandler ondragover;
-  [SetterThrows]
-           attribute EventHandler ondragstart;
-  [SetterThrows]
-           attribute EventHandler ondrop;
-  [SetterThrows]
-           attribute EventHandler ondurationchange;
-  [SetterThrows]
-           attribute EventHandler onemptied;
-  [SetterThrows]
-           attribute EventHandler onended;
   // We think the spec is wrong here.
   //         attribute OnErrorEventHandler onerror;
   [SetterThrows]
            attribute EventHandler onerror;
   [SetterThrows]
            attribute EventHandler onfocus;
   [SetterThrows]
-           attribute EventHandler oninput;
-  [SetterThrows]
-           attribute EventHandler oninvalid;
-  [SetterThrows]
-           attribute EventHandler onkeydown;
-  [SetterThrows]
-           attribute EventHandler onkeypress;
-  [SetterThrows]
-           attribute EventHandler onkeyup;
-  [SetterThrows]
            attribute EventHandler onload;
   [SetterThrows]
-           attribute EventHandler onloadeddata;
-  [SetterThrows]
-           attribute EventHandler onloadedmetadata;
-  [SetterThrows]
-           attribute EventHandler onloadstart;
-  [SetterThrows]
-           attribute EventHandler onmousedown;
-  [SetterThrows]
-           attribute EventHandler onmousemove;
-  [SetterThrows]
-           attribute EventHandler onmouseout;
-  [SetterThrows]
-           attribute EventHandler onmouseover;
-  [SetterThrows]
-           attribute EventHandler onmouseup;
-  //[SetterThrows]
-  //         attribute EventHandler onmousewheel;
-  [SetterThrows]
-           attribute EventHandler onpause;
-  [SetterThrows]
-           attribute EventHandler onplay;
-  [SetterThrows]
-           attribute EventHandler onplaying;
-  [SetterThrows]
-           attribute EventHandler onprogress;
-  [SetterThrows]
-           attribute EventHandler onratechange;
-  [SetterThrows]
-           attribute EventHandler onreset;
-  [SetterThrows]
            attribute EventHandler onscroll;
-  [SetterThrows]
-           attribute EventHandler onseeked;
-  [SetterThrows]
-           attribute EventHandler onseeking;
-  [SetterThrows]
-           attribute EventHandler onselect;
-  [SetterThrows]
-           attribute EventHandler onshow;
-  [SetterThrows]
-           attribute EventHandler onstalled;
-  [SetterThrows]
-           attribute EventHandler onsubmit;
-  [SetterThrows]
-           attribute EventHandler onsuspend;
-  [SetterThrows]
-           attribute EventHandler ontimeupdate;
-  [SetterThrows]
-           attribute EventHandler onvolumechange;
-  [SetterThrows]
-           attribute EventHandler onwaiting;
-
-  [SetterThrows]
-           attribute EventHandler onmozfullscreenchange;
-  [SetterThrows]
-           attribute EventHandler onmozfullscreenerror;
-  [SetterThrows]
-           attribute EventHandler onmozpointerlockchange;
-  [SetterThrows]
-           attribute EventHandler onmozpointerlockerror;
 
   [SetterThrows,Pref="dom.w3c_touch_events.expose"]
            attribute EventHandler ontouchstart;
   [SetterThrows,Pref="dom.w3c_touch_events.expose"]
            attribute EventHandler ontouchend;
   [SetterThrows,Pref="dom.w3c_touch_events.expose"]
            attribute EventHandler ontouchmove;
   [SetterThrows,Pref="dom.w3c_touch_events.expose"]
@@ -172,8 +63,10 @@ interface SVGElement : Element {
 
   [SetterThrows]
            attribute EventHandler oncopy;
   [SetterThrows]
            attribute EventHandler oncut;
   [SetterThrows]
            attribute EventHandler onpaste;
 };
+
+SVGElement implements GlobalEventHandlers;