Bug 1087378. Stop using WindowProxy for arguments in Web IDL; Window expresses what's going on more clearly. r=peterv
authorBoris Zbarsky <bzbarsky@mit.edu>
Wed, 29 Oct 2014 15:06:20 -0400
changeset 237332 8335aff95389012158d3525d9810bfc0247c994f
parent 237331 452f5c5264b24b3495309007e2e9b89340513d3a
child 237333 2a12da881f9250ee446d699eb9d6405bdc133284
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs1087378
milestone36.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 1087378. Stop using WindowProxy for arguments in Web IDL; Window expresses what's going on more clearly. r=peterv
accessible/base/moz.build
dom/events/MessageEvent.cpp
dom/webidl/CompositionEvent.webidl
dom/webidl/DragEvent.webidl
dom/webidl/KeyEvent.webidl
dom/webidl/KeyboardEvent.webidl
dom/webidl/MessageEvent.webidl
dom/webidl/MouseEvent.webidl
dom/webidl/MouseScrollEvent.webidl
dom/webidl/ScrollAreaEvent.webidl
dom/webidl/SimpleGestureEvent.webidl
dom/webidl/TimeEvent.webidl
dom/webidl/TouchEvent.webidl
dom/webidl/UIEvent.webidl
dom/webidl/XULCommandEvent.webidl
--- a/accessible/base/moz.build
+++ b/accessible/base/moz.build
@@ -58,16 +58,17 @@ if CONFIG['A11Y_LOG']:
     ]
 
 LOCAL_INCLUDES += [
     '/accessible/generic',
     '/accessible/html',
     '/accessible/ipc',
     '/accessible/xpcom',
     '/accessible/xul',
+    '/dom/base',
     '/dom/xbl',
     '/ipc/chromium/src',
     '/layout/generic',
     '/layout/style',
     '/layout/svg',
     '/layout/xul',
     '/layout/xul/tree/',
 ]
--- a/dom/events/MessageEvent.cpp
+++ b/dom/events/MessageEvent.cpp
@@ -6,16 +6,17 @@
 #include "mozilla/dom/MessageEvent.h"
 #include "mozilla/dom/MessageEventBinding.h"
 #include "mozilla/dom/MessagePort.h"
 #include "mozilla/dom/MessagePortBinding.h"
 #include "mozilla/dom/MessagePortList.h"
 
 #include "mozilla/HoldDropJSObjects.h"
 #include "jsapi.h"
+#include "nsGlobalWindow.h" // So we can assign an nsGlobalWindow* to mWindowSource
 
 namespace mozilla {
 namespace dom {
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(MessageEvent)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(MessageEvent, Event)
   tmp->mData = JSVAL_VOID;
@@ -136,18 +137,18 @@ MessageEvent::Constructor(const GlobalOb
     event->mOrigin = aParam.mOrigin.Value();
   }
 
   if (aParam.mLastEventId.WasPassed()) {
     event->mLastEventId = aParam.mLastEventId.Value();
   }
 
   if (!aParam.mSource.IsNull()) {
-    if (aParam.mSource.Value().IsWindowProxy()) {
-      event->mWindowSource = aParam.mSource.Value().GetAsWindowProxy();
+    if (aParam.mSource.Value().IsWindow()) {
+      event->mWindowSource = aParam.mSource.Value().GetAsWindow();
     } else {
       event->mPortSource = aParam.mSource.Value().GetAsMessagePort();
     }
 
     MOZ_ASSERT(event->mWindowSource || event->mPortSource);
   }
 
   if (aParam.mPorts.WasPassed() && !aParam.mPorts.Value().IsNull()) {
--- a/dom/webidl/CompositionEvent.webidl
+++ b/dom/webidl/CompositionEvent.webidl
@@ -4,26 +4,24 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  *
  * http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-CompositionEvent
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
-interface WindowProxy;
-
 interface CompositionEvent : UIEvent
 {
   readonly attribute DOMString? data;
   readonly attribute DOMString  locale;
 };
 
 partial interface CompositionEvent
 {
   [Throws]
   void initCompositionEvent(DOMString typeArg,
                             boolean canBubbleArg,
                             boolean cancelableArg,
-                            WindowProxy? viewArg,
+                            Window? viewArg,
                             DOMString? dataArg,
                             DOMString localeArg);
 };
--- a/dom/webidl/DragEvent.webidl
+++ b/dom/webidl/DragEvent.webidl
@@ -1,25 +1,23 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/.
  */
 
-interface WindowProxy;
-
 interface DragEvent : MouseEvent
 {
   readonly attribute DataTransfer? dataTransfer;
 
   [Throws]
   void initDragEvent(DOMString type,
                      boolean canBubble,
                      boolean cancelable,
-                     WindowProxy? aView,
+                     Window? aView,
                      long aDetail,
                      long aScreenX,
                      long aScreenY,
                      long aClientX,
                      long aClientY,
                      boolean aCtrlKey,
                      boolean aAltKey,
                      boolean aShiftKey,
--- a/dom/webidl/KeyEvent.webidl
+++ b/dom/webidl/KeyEvent.webidl
@@ -1,16 +1,14 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/.
  */
 
-interface WindowProxy;
-
 // http://www.w3.org/TR/1999/WD-DOM-Level-2-19990923/events.html#Events-KeyEvent
 interface KeyEvent
 {
   const unsigned long DOM_VK_CANCEL         = 0x03;
   const unsigned long DOM_VK_HELP           = 0x06;
   const unsigned long DOM_VK_BACK_SPACE     = 0x08;
   const unsigned long DOM_VK_TAB            = 0x09;
   const unsigned long DOM_VK_CLEAR          = 0x0C;
@@ -225,16 +223,16 @@ interface KeyEvent
   // OEM specific virtual keyCode of Windows should pass through DOM keyCode
   // for compatibility with the other web browsers on Windows.
   const unsigned long DOM_VK_WIN_OEM_CLEAR  = 0xFE;
 
   [Throws]
   void initKeyEvent(DOMString type,
                     boolean canBubble,
                     boolean cancelable,
-                    WindowProxy? view,
+                    Window? view,
                     boolean ctrlKey,
                     boolean altKey,
                     boolean shiftKey,
                     boolean metaKey,
                     unsigned long keyCode,
                     unsigned long charCode);
 };
--- a/dom/webidl/KeyboardEvent.webidl
+++ b/dom/webidl/KeyboardEvent.webidl
@@ -1,16 +1,14 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/.
  */
 
-interface WindowProxy;
-
 [Constructor(DOMString typeArg, optional KeyboardEventInit keyboardEventInitDict)]
 interface KeyboardEvent : UIEvent
 {
   readonly attribute unsigned long    charCode;
   readonly attribute unsigned long    keyCode;
 
   readonly attribute boolean          altKey;
   readonly attribute boolean          ctrlKey;
--- a/dom/webidl/MessageEvent.webidl
+++ b/dom/webidl/MessageEvent.webidl
@@ -2,18 +2,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/.
  *
  * For more information on this interface, please see
  * http://www.whatwg.org/specs/web-apps/current-work/#messageevent
  */
 
-interface WindowProxy;
-
 [Constructor(DOMString type, optional MessageEventInit eventInitDict),
  Exposed=(Window,Worker,System)]
 interface MessageEvent : Event {
   /**
    * Custom data associated with this event.
    */
   [GetterThrows]
   readonly attribute any data;
@@ -44,11 +42,11 @@ interface MessageEvent : Event {
    */
   readonly attribute MessagePortList? ports;
 };
 
 dictionary MessageEventInit : EventInit {
   any data;
   DOMString origin;
   DOMString lastEventId;
-  (WindowProxy or MessagePort)? source = null;
+  (Window or MessagePort)? source = null;
   sequence<MessagePort>? ports;
 };
--- a/dom/webidl/MouseEvent.webidl
+++ b/dom/webidl/MouseEvent.webidl
@@ -23,17 +23,17 @@ interface MouseEvent : UIEvent {
   readonly attribute unsigned short buttons;
   readonly attribute EventTarget?   relatedTarget;
   readonly attribute DOMString?     region;
   // Deprecated in DOM Level 3:
   [Throws]
   void                              initMouseEvent(DOMString typeArg, 
                                                    boolean canBubbleArg, 
                                                    boolean cancelableArg, 
-                                                   WindowProxy? viewArg, 
+                                                   Window? viewArg,
                                                    long detailArg, 
                                                    long screenXArg, 
                                                    long screenYArg, 
                                                    long clientXArg, 
                                                    long clientYArg, 
                                                    boolean ctrlKeyArg, 
                                                    boolean altKeyArg, 
                                                    boolean shiftKeyArg, 
@@ -47,25 +47,17 @@ interface MouseEvent : UIEvent {
 
 // Event Constructor Syntax:
 [Constructor(DOMString typeArg, optional MouseEventInit mouseEventInitDict)]
 partial interface MouseEvent
 {
 };
 
 // Suggested initMouseEvent replacement initializer:
-dictionary MouseEventInit {
-  // Attributes from Event:
-  boolean        bubbles       = false;
-  boolean        cancelable    = false;
-
-  // Attributes from UIEvent:
-  WindowProxy?   view          = null;
-  long           detail        = 0;
-
+dictionary MouseEventInit : UIEventInit {
   // Attributes for MouseEvent:
   long           screenX       = 0;
   long           screenY       = 0;
   long           clientX       = 0;
   long           clientY       = 0;
   boolean        ctrlKey       = false;
   boolean        shiftKey      = false;
   boolean        altKey        = false;
@@ -95,17 +87,17 @@ partial interface MouseEvent
   const unsigned short    MOZ_SOURCE_KEYBOARD   = 6;
 
   readonly attribute unsigned short mozInputSource;
 
   [Throws]
   void                initNSMouseEvent(DOMString typeArg,
                                        boolean canBubbleArg,
                                        boolean cancelableArg,
-                                       WindowProxy? viewArg,
+                                       Window? viewArg,
                                        long detailArg,
                                        long screenXArg,
                                        long screenYArg,
                                        long clientXArg,
                                        long clientYArg,
                                        boolean ctrlKeyArg,
                                        boolean altKeyArg,
                                        boolean shiftKeyArg,
--- a/dom/webidl/MouseScrollEvent.webidl
+++ b/dom/webidl/MouseScrollEvent.webidl
@@ -1,28 +1,26 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/.
  */
 
-interface WindowProxy;
-
 interface MouseScrollEvent : MouseEvent
 {
   const long HORIZONTAL_AXIS = 1;
   const long VERTICAL_AXIS = 2;
 
   readonly attribute long axis;
 
   [Throws]
   void initMouseScrollEvent(DOMString type,
                             boolean canBubble,
                             boolean cancelable,
-                            WindowProxy? view,
+                            Window? view,
                             long detail,
                             long screenX,
                             long screenY,
                             long clientX,
                             long clientY,
                             boolean ctrlKey,
                             boolean altKey,
                             boolean shiftKey,
--- a/dom/webidl/ScrollAreaEvent.webidl
+++ b/dom/webidl/ScrollAreaEvent.webidl
@@ -1,26 +1,24 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/.
  */
 
-interface WindowProxy;
-
 interface ScrollAreaEvent : UIEvent
 {
   readonly attribute float x;
   readonly attribute float y;
   readonly attribute float width;
   readonly attribute float height;
 
   [Throws]
   void initScrollAreaEvent(DOMString type,
                            boolean canBubble,
                            boolean cancelable,
-                           WindowProxy? view,
+                           Window? view,
                            long detail,
                            float x,
                            float y,
                            float width,
                            float height);
 };
--- a/dom/webidl/SimpleGestureEvent.webidl
+++ b/dom/webidl/SimpleGestureEvent.webidl
@@ -1,18 +1,16 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/.
  *
  * For more information see nsIDOMSimpleGestureEvent.idl.
  */
 
-interface WindowProxy;
-
 interface SimpleGestureEvent : MouseEvent
 {
   const unsigned long DIRECTION_UP = 1;
   const unsigned long DIRECTION_DOWN = 2;
   const unsigned long DIRECTION_LEFT = 4;
   const unsigned long DIRECTION_RIGHT = 8;
 
   const unsigned long ROTATION_COUNTERCLOCKWISE = 1;
@@ -25,17 +23,17 @@ interface SimpleGestureEvent : MouseEven
   readonly attribute double delta;
 
   readonly attribute unsigned long clickCount;
 
   [Throws]
   void initSimpleGestureEvent(DOMString typeArg,
                               boolean canBubbleArg,
                               boolean cancelableArg,
-                              WindowProxy? viewArg,
+                              Window? viewArg,
                               long detailArg,
                               long screenXArg,
                               long screenYArg,
                               long clientXArg,
                               long clientYArg,
                               boolean ctrlKeyArg,
                               boolean altKeyArg,
                               boolean shiftKeyArg,
--- a/dom/webidl/TimeEvent.webidl
+++ b/dom/webidl/TimeEvent.webidl
@@ -5,18 +5,16 @@
  *
  * For more information on this interface please see
  * http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
-interface WindowProxy;
-
 interface TimeEvent : Event
 {
   readonly attribute long         detail;
   readonly attribute WindowProxy? view;
   void initTimeEvent(DOMString aType,
-                     WindowProxy? aView,
+                     Window? aView,
                      long aDetail);
 };
--- a/dom/webidl/TouchEvent.webidl
+++ b/dom/webidl/TouchEvent.webidl
@@ -1,32 +1,30 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/.
  */
 
-interface WindowProxy;
-
 [Func="mozilla::dom::TouchEvent::PrefEnabled"]
 interface TouchEvent : UIEvent {
   readonly attribute TouchList touches;
   readonly attribute TouchList targetTouches;
   readonly attribute TouchList changedTouches;
 
   readonly attribute boolean altKey;
   readonly attribute boolean metaKey;
   readonly attribute boolean ctrlKey;
   readonly attribute boolean shiftKey;
 
   [Throws]
   void initTouchEvent(DOMString type,
                       boolean canBubble,
                       boolean cancelable,
-                      WindowProxy? view,
+                      Window? view,
                       long detail,
                       boolean ctrlKey,
                       boolean altKey,
                       boolean shiftKey,
                       boolean metaKey,
                       TouchList? touches,
                       TouchList? targetTouches,
                       TouchList? changedTouches);
--- a/dom/webidl/UIEvent.webidl
+++ b/dom/webidl/UIEvent.webidl
@@ -5,27 +5,25 @@
  *
  * For more information on this interface please see
  * http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
-interface WindowProxy;
-
 [Constructor(DOMString type, optional UIEventInit eventInitDict)]
 interface UIEvent : Event
 {
   readonly attribute WindowProxy? view;
   readonly attribute long         detail;
   void initUIEvent(DOMString aType,
                    boolean aCanBubble,
                    boolean aCancelable,
-                   WindowProxy? aView,
+                   Window? aView,
                    long aDetail);
 };
 
 // Additional DOM0 properties.
 partial interface UIEvent {
   const long SCROLL_PAGE_UP = -32768;
   const long SCROLL_PAGE_DOWN = 32768;
 
@@ -37,11 +35,11 @@ partial interface UIEvent {
   readonly attribute Node?         rangeParent;
   readonly attribute long          rangeOffset;
            attribute boolean       cancelBubble;
   readonly attribute boolean       isChar;
 };
 
 dictionary UIEventInit : EventInit
 {
-  WindowProxy? view = null;
-  long         detail = 0;
+  Window? view = null;
+  long    detail = 0;
 };
--- a/dom/webidl/XULCommandEvent.webidl
+++ b/dom/webidl/XULCommandEvent.webidl
@@ -1,30 +1,28 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/.
  */
 
-interface WindowProxy;
-
 [Func="IsChromeOrXBL"]
 interface XULCommandEvent : UIEvent
 {
   readonly attribute boolean ctrlKey;
   readonly attribute boolean shiftKey;
   readonly attribute boolean altKey;
   readonly attribute boolean metaKey;
 
   readonly attribute Event? sourceEvent;
 
   [Throws]
   void initCommandEvent(DOMString type,
                         boolean canBubble,
                         boolean cancelable,
-                        WindowProxy? view,
+                        Window? view,
                         long detail,
                         boolean ctrlKey,
                         boolean altKey,
                         boolean shiftKey,
                         boolean metaKey,
                         Event? sourceEvent);
 };