Bug 922160 - Bring EventHandler.webidl more in line with the spec, remove NodeEventHandlers. r=bz.
☠☠ backed out by 196dfb8211f5 ☠ ☠
authorPeter Van der Beken <peterv@propagandism.org>
Tue, 08 Oct 2013 17:51:15 +0200
changeset 166629 dddecb33b3372783a61abf7f5b24cc9bafb76f6d
parent 166628 fd177e58f30bd29e9466e727a422b55af3dcde43
child 166630 f6801c7e6500efa91a05b3cb696b503a2b3b87da
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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 922160 - Bring EventHandler.webidl more in line with the spec, remove NodeEventHandlers. r=bz.
--- a/content/base/public/Element.h
+++ b/content/base/public/Element.h
@@ -1460,25 +1460,29 @@ NS_IMETHOD GetChildElementCount(uint32_t
   *aChildElementCount = Element::ChildElementCount();                         \
   return NS_OK;                                                               \
 }                                                                             \
 NS_IMETHOD MozRemove() MOZ_FINAL                                              \
 {                                                                             \
   nsINode::Remove();                                                          \
   return NS_OK;                                                               \
 }                                                                             \
+using nsINode::GetOnmouseenter;                                               \
+using nsINode::SetOnmouseenter;                                               \
 NS_IMETHOD GetOnmouseenter(JSContext* cx, JS::Value* aOnmouseenter) MOZ_FINAL \
 {                                                                             \
   return Element::GetOnmouseenter(cx, aOnmouseenter);                         \
 }                                                                             \
 NS_IMETHOD SetOnmouseenter(JSContext* cx,                                     \
                            const JS::Value& aOnmouseenter) MOZ_FINAL          \
 {                                                                             \
   return Element::SetOnmouseenter(cx, aOnmouseenter);                         \
 }                                                                             \
+using nsINode::GetOnmouseleave;                                               \
+using nsINode::SetOnmouseleave;                                               \
 NS_IMETHOD GetOnmouseleave(JSContext* cx, JS::Value* aOnmouseleave) MOZ_FINAL \
 {                                                                             \
   return Element::GetOnmouseleave(cx, aOnmouseleave);                         \
 }                                                                             \
 NS_IMETHOD SetOnmouseleave(JSContext* cx,                                     \
                            const JS::Value& aOnmouseleave) MOZ_FINAL          \
 {                                                                             \
   return Element::SetOnmouseleave(cx, aOnmouseleave);                         \
--- a/content/html/content/src/HTMLBodyElement.h
+++ b/content/html/content/src/HTMLBodyElement.h
@@ -130,19 +130,16 @@ public:
   virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const MOZ_OVERRIDE;
   NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker) MOZ_OVERRIDE;
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const MOZ_OVERRIDE;
   virtual already_AddRefed<nsIEditor> GetAssociatedEditor() MOZ_OVERRIDE;
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
   virtual bool IsEventAttributeName(nsIAtom* aName) MOZ_OVERRIDE;
-  nsresult GetColorHelper(nsIAtom* aAtom, nsAString& aColor);
   virtual JSObject* WrapNode(JSContext *aCx,
                              JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
   nsRefPtr<BodyRule> mContentStyleRule;
 } // namespace dom
--- a/dom/webidl/Document.webidl
+++ b/dom/webidl/Document.webidl
@@ -134,18 +134,16 @@ partial interface Document {
   //(HTML only)boolean queryCommandSupported(DOMString commandId);
   //(HTML only)DOMString queryCommandValue(DOMString commandId);
   //(Not implemented)readonly attribute HTMLCollection commands;
   // special event handler IDL attributes that only apply to Document objects
   [LenientThis] attribute EventHandler onreadystatechange;
   // Gecko extensions?
-  [LenientThis] attribute EventHandler onmouseenter;
-  [LenientThis] attribute EventHandler onmouseleave;
                 attribute EventHandler onwheel;
                 attribute EventHandler oncopy;
                 attribute EventHandler oncut;
                 attribute EventHandler onpaste;
                 attribute EventHandler onbeforescriptexecute;
                 attribute EventHandler onafterscriptexecute;
    * True if this document is synthetic : stand alone image, video, audio file,
@@ -330,11 +328,11 @@ partial interface Document {
 // Extension to give chrome JS the ability to determine when a document was
 // created to satisfy an iframe with srcdoc attribute.
 partial interface Document {
   [ChromeOnly] readonly attribute boolean isSrcdocDocument;
 Document implements XPathEvaluator;
 Document implements GlobalEventHandlers;
-Document implements NodeEventHandlers;
 Document implements TouchEventHandlers;
 Document implements ParentNode;
+Document implements OnErrorEventHandlerForNodes;
--- a/dom/webidl/Element.webidl
+++ b/dom/webidl/Element.webidl
@@ -66,20 +66,16 @@ interface Element : Node {
    *       font size inflation data for the element's _primary frame_, not the
    *       element itself, but for most purposes, this should be sufficient.
   readonly attribute float fontSizeInflation;
   // Mozilla specific stuff
-  [LenientThis]
-           attribute EventHandler onmouseenter;
-  [LenientThis]
-           attribute EventHandler onmouseleave;
            attribute EventHandler onwheel;
   // Selectors API
    * Returns whether this element would be selected by the given selector
    * string.
    * See <http://dev.w3.org/2006/webapi/selectors-api2/#matchesselector>
--- a/dom/webidl/EventHandler.webidl
+++ b/dom/webidl/EventHandler.webidl
@@ -10,117 +10,119 @@
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
 callback EventHandlerNonNull = any (Event event);
 typedef EventHandlerNonNull? EventHandler;
+// https://www.w3.org/Bugs/Public/show_bug.cgi?id=23489
+//callback OnBeforeUnloadEventHandlerNonNull = DOMString (Event event);
 callback OnBeforeUnloadEventHandlerNonNull = DOMString? (Event event);
 typedef OnBeforeUnloadEventHandlerNonNull? OnBeforeUnloadEventHandler;
 callback OnErrorEventHandlerNonNull = boolean ((Event or DOMString) event, optional DOMString source, optional unsigned long lineno, optional unsigned long column);
 typedef OnErrorEventHandlerNonNull? OnErrorEventHandler;
 interface GlobalEventHandlers {
            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;
            attribute EventHandler oncanplay;
            attribute EventHandler oncanplaythrough;
            attribute EventHandler onchange;
            attribute EventHandler onclick;
-           //(Not implemented)[SetterThrows]
            //(Not implemented)attribute EventHandler onclose;
            attribute EventHandler oncontextmenu;
-           //(Not implemented)[SetterThrows]
            //(Not implemented)attribute EventHandler oncuechange;
            attribute EventHandler ondblclick;
            attribute EventHandler ondrag;
            attribute EventHandler ondragend;
            attribute EventHandler ondragenter;
+           //(Not implemented)attribute EventHandler ondragexit;
            attribute EventHandler ondragleave;
            attribute EventHandler ondragover;
            attribute EventHandler ondragstart;
            attribute EventHandler ondrop;
            attribute EventHandler ondurationchange;
            attribute EventHandler onemptied;
            attribute EventHandler onended;
            attribute EventHandler oninput;
            attribute EventHandler oninvalid;
            attribute EventHandler onkeydown;
            attribute EventHandler onkeypress;
            attribute EventHandler onkeyup;
+           attribute EventHandler onload;
            attribute EventHandler onloadeddata;
            attribute EventHandler onloadedmetadata;
            attribute EventHandler onloadstart;
            attribute EventHandler onmousedown;
+  [LenientThis] attribute EventHandler onmouseenter;
+  [LenientThis] attribute EventHandler onmouseleave;
            attribute EventHandler onmousemove;
            attribute EventHandler onmouseout;
            attribute EventHandler onmouseover;
            attribute EventHandler onmouseup;
-           //(Not implemented)[SetterThrows]
            //(Not implemented)attribute EventHandler onmousewheel;
            attribute EventHandler onpause;
            attribute EventHandler onplay;
            attribute EventHandler onplaying;
            attribute EventHandler onprogress;
            attribute EventHandler onratechange;
            attribute EventHandler onreset;
+           attribute EventHandler onscroll;
            attribute EventHandler onseeked;
            attribute EventHandler onseeking;
            attribute EventHandler onselect;
            attribute EventHandler onshow;
-           //(Not implemented)[SetterThrows]
            //(Not implemented)attribute EventHandler onsort;
            attribute EventHandler onstalled;
            attribute EventHandler onsubmit;
            attribute EventHandler onsuspend;
            attribute EventHandler ontimeupdate;
            attribute EventHandler onvolumechange;
            attribute EventHandler onwaiting;
            // Mozilla-specific handlers
            attribute EventHandler onmozfullscreenchange;
            attribute EventHandler onmozfullscreenerror;
            attribute EventHandler onmozpointerlockchange;
            attribute EventHandler onmozpointerlockerror;
-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;
 interface WindowEventHandlers {
            attribute EventHandler onafterprint;
            attribute EventHandler onbeforeprint;
            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 onmessage;
            attribute EventHandler onoffline;
            attribute EventHandler ononline;
            attribute EventHandler onpagehide;
            attribute EventHandler onpageshow;
            attribute EventHandler onpopstate;
            attribute EventHandler onresize;
-           //(Not implemented)[SetterThrows]
            //(Not implemented)attribute EventHandler onstorage;
            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.
+interface OnErrorEventHandlerForNodes {
+           attribute EventHandler onerror;
+//interface OnErrorEventHandlerForWindow {
+//           attribute OnErrorEventHandler onerror;
--- a/dom/webidl/HTMLElement.webidl
+++ b/dom/webidl/HTMLElement.webidl
@@ -106,12 +106,12 @@ interface TouchEventHandlers {
            attribute EventHandler ontouchenter;
            attribute EventHandler ontouchleave;
            attribute EventHandler ontouchcancel;
 HTMLElement implements GlobalEventHandlers;
-HTMLElement implements NodeEventHandlers;
 HTMLElement implements TouchEventHandlers;
+HTMLElement implements OnErrorEventHandlerForNodes;
 interface HTMLUnknownElement : HTMLElement {};
--- a/dom/webidl/SVGElement.webidl
+++ b/dom/webidl/SVGElement.webidl
@@ -28,10 +28,10 @@ interface SVGElement : Element {
   readonly attribute SVGElement? viewportElement;
            attribute EventHandler oncopy;
            attribute EventHandler oncut;
            attribute EventHandler onpaste;
 SVGElement implements GlobalEventHandlers;
-SVGElement implements NodeEventHandlers;
 SVGElement implements TouchEventHandlers;
+SVGElement implements OnErrorEventHandlerForNodes;
--- a/dom/webidl/Window.webidl
+++ b/dom/webidl/Window.webidl
@@ -3,8 +3,10 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  * The origin of this IDL file is:
  * https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/RequestAnimationFrame/Overview.html
 callback FrameRequestCallback = void (DOMHighResTimeStamp time);
+//Window implements OnErrorEventHandlerForWindow;
--- a/dom/webidl/XULElement.webidl
+++ b/dom/webidl/XULElement.webidl
@@ -123,11 +123,11 @@ interface MozFrameLoaderOwner {
   readonly attribute MozFrameLoader? frameLoader;
   [ChromeOnly, Throws]
   void swapFrameLoaders(XULElement aOtherOwner);
 XULElement implements GlobalEventHandlers;
-XULElement implements NodeEventHandlers;
 XULElement implements TouchEventHandlers;
 XULElement implements MozFrameLoaderOwner;
+XULElement implements OnErrorEventHandlerForNodes;