Bug 922160 - Bring EventHandler.webidl more in line with the spec, remove NodeEventHandlers. r=bz.

--HG--
extra : rebase_source : f43383fb1447174ef8f791240ddfe27052ef0aa3
This commit is contained in:
Peter Van der Beken 2013-10-08 17:51:15 +02:00
Родитель d27efa298e
Коммит bb44a6154b
9 изменённых файлов: 37 добавлений и 38 удалений

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

@ -1465,6 +1465,8 @@ NS_IMETHOD MozRemove() MOZ_FINAL \
nsINode::Remove(); \ nsINode::Remove(); \
return NS_OK; \ return NS_OK; \
} \ } \
using nsINode::GetOnmouseenter; \
using nsINode::SetOnmouseenter; \
NS_IMETHOD GetOnmouseenter(JSContext* cx, JS::Value* aOnmouseenter) MOZ_FINAL \ NS_IMETHOD GetOnmouseenter(JSContext* cx, JS::Value* aOnmouseenter) MOZ_FINAL \
{ \ { \
return Element::GetOnmouseenter(cx, aOnmouseenter); \ return Element::GetOnmouseenter(cx, aOnmouseenter); \
@ -1474,6 +1476,8 @@ NS_IMETHOD SetOnmouseenter(JSContext* cx, \
{ \ { \
return Element::SetOnmouseenter(cx, aOnmouseenter); \ return Element::SetOnmouseenter(cx, aOnmouseenter); \
} \ } \
using nsINode::GetOnmouseleave; \
using nsINode::SetOnmouseleave; \
NS_IMETHOD GetOnmouseleave(JSContext* cx, JS::Value* aOnmouseleave) MOZ_FINAL \ NS_IMETHOD GetOnmouseleave(JSContext* cx, JS::Value* aOnmouseleave) MOZ_FINAL \
{ \ { \
return Element::GetOnmouseleave(cx, aOnmouseleave); \ return Element::GetOnmouseleave(cx, aOnmouseleave); \

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

@ -135,9 +135,6 @@ public:
virtual bool IsEventAttributeName(nsIAtom* aName) MOZ_OVERRIDE; virtual bool IsEventAttributeName(nsIAtom* aName) MOZ_OVERRIDE;
private:
nsresult GetColorHelper(nsIAtom* aAtom, nsAString& aColor);
protected: protected:
virtual JSObject* WrapNode(JSContext *aCx, virtual JSObject* WrapNode(JSContext *aCx,
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE; JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;

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

@ -139,8 +139,6 @@ partial interface Document {
[LenientThis] attribute EventHandler onreadystatechange; [LenientThis] attribute EventHandler onreadystatechange;
// Gecko extensions? // Gecko extensions?
[LenientThis] attribute EventHandler onmouseenter;
[LenientThis] attribute EventHandler onmouseleave;
attribute EventHandler onwheel; attribute EventHandler onwheel;
attribute EventHandler oncopy; attribute EventHandler oncopy;
attribute EventHandler oncut; attribute EventHandler oncut;
@ -335,6 +333,6 @@ partial interface Document {
Document implements XPathEvaluator; Document implements XPathEvaluator;
Document implements GlobalEventHandlers; Document implements GlobalEventHandlers;
Document implements NodeEventHandlers;
Document implements TouchEventHandlers; Document implements TouchEventHandlers;
Document implements ParentNode; Document implements ParentNode;
Document implements OnErrorEventHandlerForNodes;

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

@ -71,10 +71,6 @@ interface Element : Node {
// Mozilla specific stuff // Mozilla specific stuff
[LenientThis]
attribute EventHandler onmouseenter;
[LenientThis]
attribute EventHandler onmouseleave;
attribute EventHandler onwheel; attribute EventHandler onwheel;
// Selectors API // Selectors API

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

@ -15,6 +15,8 @@ callback EventHandlerNonNull = any (Event event);
typedef EventHandlerNonNull? EventHandler; typedef EventHandlerNonNull? EventHandler;
[TreatNonCallableAsNull] [TreatNonCallableAsNull]
// https://www.w3.org/Bugs/Public/show_bug.cgi?id=23489
//callback OnBeforeUnloadEventHandlerNonNull = DOMString (Event event);
callback OnBeforeUnloadEventHandlerNonNull = DOMString? (Event event); callback OnBeforeUnloadEventHandlerNonNull = DOMString? (Event event);
typedef OnBeforeUnloadEventHandlerNonNull? OnBeforeUnloadEventHandler; typedef OnBeforeUnloadEventHandlerNonNull? OnBeforeUnloadEventHandler;
@ -25,21 +27,24 @@ typedef OnErrorEventHandlerNonNull? OnErrorEventHandler;
[NoInterfaceObject] [NoInterfaceObject]
interface GlobalEventHandlers { interface GlobalEventHandlers {
attribute EventHandler onabort; attribute EventHandler onabort;
//(Not implemented)[SetterThrows] attribute EventHandler onblur;
// We think the spec is wrong here. See OnErrorEventHandlerForNodes/Window
// below.
// attribute OnErrorEventHandler onerror;
attribute EventHandler onfocus;
//(Not implemented)attribute EventHandler oncancel; //(Not implemented)attribute EventHandler oncancel;
attribute EventHandler oncanplay; attribute EventHandler oncanplay;
attribute EventHandler oncanplaythrough; attribute EventHandler oncanplaythrough;
attribute EventHandler onchange; attribute EventHandler onchange;
attribute EventHandler onclick; attribute EventHandler onclick;
//(Not implemented)[SetterThrows]
//(Not implemented)attribute EventHandler onclose; //(Not implemented)attribute EventHandler onclose;
attribute EventHandler oncontextmenu; attribute EventHandler oncontextmenu;
//(Not implemented)[SetterThrows]
//(Not implemented)attribute EventHandler oncuechange; //(Not implemented)attribute EventHandler oncuechange;
attribute EventHandler ondblclick; attribute EventHandler ondblclick;
attribute EventHandler ondrag; attribute EventHandler ondrag;
attribute EventHandler ondragend; attribute EventHandler ondragend;
attribute EventHandler ondragenter; attribute EventHandler ondragenter;
//(Not implemented)attribute EventHandler ondragexit;
attribute EventHandler ondragleave; attribute EventHandler ondragleave;
attribute EventHandler ondragover; attribute EventHandler ondragover;
attribute EventHandler ondragstart; attribute EventHandler ondragstart;
@ -52,15 +57,17 @@ interface GlobalEventHandlers {
attribute EventHandler onkeydown; attribute EventHandler onkeydown;
attribute EventHandler onkeypress; attribute EventHandler onkeypress;
attribute EventHandler onkeyup; attribute EventHandler onkeyup;
attribute EventHandler onload;
attribute EventHandler onloadeddata; attribute EventHandler onloadeddata;
attribute EventHandler onloadedmetadata; attribute EventHandler onloadedmetadata;
attribute EventHandler onloadstart; attribute EventHandler onloadstart;
attribute EventHandler onmousedown; attribute EventHandler onmousedown;
[LenientThis] attribute EventHandler onmouseenter;
[LenientThis] attribute EventHandler onmouseleave;
attribute EventHandler onmousemove; attribute EventHandler onmousemove;
attribute EventHandler onmouseout; attribute EventHandler onmouseout;
attribute EventHandler onmouseover; attribute EventHandler onmouseover;
attribute EventHandler onmouseup; attribute EventHandler onmouseup;
//(Not implemented)[SetterThrows]
//(Not implemented)attribute EventHandler onmousewheel; //(Not implemented)attribute EventHandler onmousewheel;
attribute EventHandler onpause; attribute EventHandler onpause;
attribute EventHandler onplay; attribute EventHandler onplay;
@ -68,11 +75,11 @@ interface GlobalEventHandlers {
attribute EventHandler onprogress; attribute EventHandler onprogress;
attribute EventHandler onratechange; attribute EventHandler onratechange;
attribute EventHandler onreset; attribute EventHandler onreset;
attribute EventHandler onscroll;
attribute EventHandler onseeked; attribute EventHandler onseeked;
attribute EventHandler onseeking; attribute EventHandler onseeking;
attribute EventHandler onselect; attribute EventHandler onselect;
attribute EventHandler onshow; attribute EventHandler onshow;
//(Not implemented)[SetterThrows]
//(Not implemented)attribute EventHandler onsort; //(Not implemented)attribute EventHandler onsort;
attribute EventHandler onstalled; attribute EventHandler onstalled;
attribute EventHandler onsubmit; attribute EventHandler onsubmit;
@ -88,30 +95,11 @@ interface GlobalEventHandlers {
attribute EventHandler onmozpointerlockerror; attribute EventHandler onmozpointerlockerror;
}; };
[NoInterfaceObject]
interface NodeEventHandlers {
attribute EventHandler onblur;
// We think the spec is wrong here.
// attribute OnErrorEventHandler onerror;
attribute EventHandler onerror;
attribute EventHandler onfocus;
attribute EventHandler onload;
attribute EventHandler onscroll;
};
[NoInterfaceObject] [NoInterfaceObject]
interface WindowEventHandlers { interface WindowEventHandlers {
attribute EventHandler onafterprint; attribute EventHandler onafterprint;
attribute EventHandler onbeforeprint; attribute EventHandler onbeforeprint;
attribute OnBeforeUnloadEventHandler onbeforeunload; attribute OnBeforeUnloadEventHandler onbeforeunload;
// For now, onerror comes from NodeEventHandlers
// When we convert Window to WebIDL this may need to change.
// [SetterThrows]
// attribute OnErrorEventHandler onerror;
//(Not implemented)[SetterThrows]
//(Not implemented)attribute EventHandler onfullscreenchange;
//(Not implemented)[SetterThrows]
//(Not implemented)attribute EventHandler onfullscreenerror;
attribute EventHandler onhashchange; attribute EventHandler onhashchange;
attribute EventHandler onmessage; attribute EventHandler onmessage;
attribute EventHandler onoffline; attribute EventHandler onoffline;
@ -120,7 +108,21 @@ interface WindowEventHandlers {
attribute EventHandler onpageshow; attribute EventHandler onpageshow;
attribute EventHandler onpopstate; attribute EventHandler onpopstate;
attribute EventHandler onresize; attribute EventHandler onresize;
//(Not implemented)[SetterThrows]
//(Not implemented)attribute EventHandler onstorage; //(Not implemented)attribute EventHandler onstorage;
attribute EventHandler onunload; attribute EventHandler onunload;
}; };
// The spec has |attribute OnErrorEventHandler onerror;| on
// GlobalEventHandlers, and calls the handler differently depending on
// whether an ErrorEvent was fired. We don't do that, and until we do we'll
// need to distinguish between onerror on Window or on nodes.
[NoInterfaceObject]
interface OnErrorEventHandlerForNodes {
attribute EventHandler onerror;
};
//[NoInterfaceObject]
//interface OnErrorEventHandlerForWindow {
// attribute OnErrorEventHandler onerror;
//};

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

@ -111,7 +111,7 @@ interface TouchEventHandlers {
}; };
HTMLElement implements GlobalEventHandlers; HTMLElement implements GlobalEventHandlers;
HTMLElement implements NodeEventHandlers;
HTMLElement implements TouchEventHandlers; HTMLElement implements TouchEventHandlers;
HTMLElement implements OnErrorEventHandlerForNodes;
interface HTMLUnknownElement : HTMLElement {}; interface HTMLUnknownElement : HTMLElement {};

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

@ -33,5 +33,5 @@ interface SVGElement : Element {
}; };
SVGElement implements GlobalEventHandlers; SVGElement implements GlobalEventHandlers;
SVGElement implements NodeEventHandlers;
SVGElement implements TouchEventHandlers; SVGElement implements TouchEventHandlers;
SVGElement implements OnErrorEventHandlerForNodes;

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

@ -8,3 +8,5 @@
*/ */
callback FrameRequestCallback = void (DOMHighResTimeStamp time); callback FrameRequestCallback = void (DOMHighResTimeStamp time);
//Window implements OnErrorEventHandlerForWindow;

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

@ -128,6 +128,6 @@ interface MozFrameLoaderOwner {
}; };
XULElement implements GlobalEventHandlers; XULElement implements GlobalEventHandlers;
XULElement implements NodeEventHandlers;
XULElement implements TouchEventHandlers; XULElement implements TouchEventHandlers;
XULElement implements MozFrameLoaderOwner; XULElement implements MozFrameLoaderOwner;
XULElement implements OnErrorEventHandlerForNodes;