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

This commit is contained in:
Boris Zbarsky 2013-01-29 08:44:00 -05:00
Родитель e5d317697d
Коммит d1840b512d
4 изменённых файлов: 121 добавлений и 318 удалений

Просмотреть файл

@ -143,112 +143,16 @@ partial interface Document {
//(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;
@ -256,10 +160,6 @@ partial interface Document {
// 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;
@ -446,3 +346,4 @@ partial interface Document {
};
Document implements XPathEvaluator;
Document implements GlobalEventHandlers;

Просмотреть файл

@ -21,3 +21,119 @@ 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;
};

Просмотреть файл

@ -77,127 +77,18 @@ interface HTMLElement : Element {
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
@ -233,4 +124,6 @@ partial interface HTMLElement {
readonly attribute long offsetHeight;
};
HTMLElement implements GlobalEventHandlers;
interface HTMLUnknownElement : HTMLElement {};

Просмотреть файл

@ -35,127 +35,18 @@ interface SVGElement : Element {
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;
@ -177,3 +68,5 @@ interface SVGElement : Element {
[SetterThrows]
attribute EventHandler onpaste;
};
SVGElement implements GlobalEventHandlers;