Bug 1087378. Stop using WindowProxy for arguments in Web IDL; Window expresses what's going on more clearly. r=peterv

This commit is contained in:
Boris Zbarsky 2014-10-29 15:06:20 -04:00
parent e91695b082
commit 84bd1c446e
15 changed files with 20 additions and 50 deletions

View File

@ -63,6 +63,7 @@ LOCAL_INCLUDES += [
'/accessible/ipc', '/accessible/ipc',
'/accessible/xpcom', '/accessible/xpcom',
'/accessible/xul', '/accessible/xul',
'/dom/base',
'/dom/xbl', '/dom/xbl',
'/ipc/chromium/src', '/ipc/chromium/src',
'/layout/generic', '/layout/generic',

View File

@ -11,6 +11,7 @@
#include "mozilla/HoldDropJSObjects.h" #include "mozilla/HoldDropJSObjects.h"
#include "jsapi.h" #include "jsapi.h"
#include "nsGlobalWindow.h" // So we can assign an nsGlobalWindow* to mWindowSource
namespace mozilla { namespace mozilla {
namespace dom { namespace dom {
@ -141,8 +142,8 @@ MessageEvent::Constructor(const GlobalObject& aGlobal,
} }
if (!aParam.mSource.IsNull()) { if (!aParam.mSource.IsNull()) {
if (aParam.mSource.Value().IsWindowProxy()) { if (aParam.mSource.Value().IsWindow()) {
event->mWindowSource = aParam.mSource.Value().GetAsWindowProxy(); event->mWindowSource = aParam.mSource.Value().GetAsWindow();
} else { } else {
event->mPortSource = aParam.mSource.Value().GetAsMessagePort(); event->mPortSource = aParam.mSource.Value().GetAsMessagePort();
} }

View File

@ -9,8 +9,6 @@
* liability, trademark and document use rules apply. * liability, trademark and document use rules apply.
*/ */
interface WindowProxy;
interface CompositionEvent : UIEvent interface CompositionEvent : UIEvent
{ {
readonly attribute DOMString? data; readonly attribute DOMString? data;
@ -23,7 +21,7 @@ partial interface CompositionEvent
void initCompositionEvent(DOMString typeArg, void initCompositionEvent(DOMString typeArg,
boolean canBubbleArg, boolean canBubbleArg,
boolean cancelableArg, boolean cancelableArg,
WindowProxy? viewArg, Window? viewArg,
DOMString? dataArg, DOMString? dataArg,
DOMString localeArg); DOMString localeArg);
}; };

View File

@ -4,8 +4,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/ */
interface WindowProxy;
interface DragEvent : MouseEvent interface DragEvent : MouseEvent
{ {
readonly attribute DataTransfer? dataTransfer; readonly attribute DataTransfer? dataTransfer;
@ -14,7 +12,7 @@ interface DragEvent : MouseEvent
void initDragEvent(DOMString type, void initDragEvent(DOMString type,
boolean canBubble, boolean canBubble,
boolean cancelable, boolean cancelable,
WindowProxy? aView, Window? aView,
long aDetail, long aDetail,
long aScreenX, long aScreenX,
long aScreenY, long aScreenY,

View File

@ -4,8 +4,6 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. * 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 // http://www.w3.org/TR/1999/WD-DOM-Level-2-19990923/events.html#Events-KeyEvent
interface KeyEvent interface KeyEvent
{ {
@ -230,7 +228,7 @@ interface KeyEvent
void initKeyEvent(DOMString type, void initKeyEvent(DOMString type,
boolean canBubble, boolean canBubble,
boolean cancelable, boolean cancelable,
WindowProxy? view, Window? view,
boolean ctrlKey, boolean ctrlKey,
boolean altKey, boolean altKey,
boolean shiftKey, boolean shiftKey,

View File

@ -4,8 +4,6 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. * You can obtain one at http://mozilla.org/MPL/2.0/.
*/ */
interface WindowProxy;
[Constructor(DOMString typeArg, optional KeyboardEventInit keyboardEventInitDict)] [Constructor(DOMString typeArg, optional KeyboardEventInit keyboardEventInitDict)]
interface KeyboardEvent : UIEvent interface KeyboardEvent : UIEvent
{ {

View File

@ -7,8 +7,6 @@
* http://www.whatwg.org/specs/web-apps/current-work/#messageevent * http://www.whatwg.org/specs/web-apps/current-work/#messageevent
*/ */
interface WindowProxy;
[Constructor(DOMString type, optional MessageEventInit eventInitDict), [Constructor(DOMString type, optional MessageEventInit eventInitDict),
Exposed=(Window,Worker,System)] Exposed=(Window,Worker,System)]
interface MessageEvent : Event { interface MessageEvent : Event {
@ -49,6 +47,6 @@ dictionary MessageEventInit : EventInit {
any data; any data;
DOMString origin; DOMString origin;
DOMString lastEventId; DOMString lastEventId;
(WindowProxy or MessagePort)? source = null; (Window or MessagePort)? source = null;
sequence<MessagePort>? ports; sequence<MessagePort>? ports;
}; };

View File

@ -28,7 +28,7 @@ interface MouseEvent : UIEvent {
void initMouseEvent(DOMString typeArg, void initMouseEvent(DOMString typeArg,
boolean canBubbleArg, boolean canBubbleArg,
boolean cancelableArg, boolean cancelableArg,
WindowProxy? viewArg, Window? viewArg,
long detailArg, long detailArg,
long screenXArg, long screenXArg,
long screenYArg, long screenYArg,
@ -52,15 +52,7 @@ partial interface MouseEvent
}; };
// Suggested initMouseEvent replacement initializer: // Suggested initMouseEvent replacement initializer:
dictionary MouseEventInit { dictionary MouseEventInit : UIEventInit {
// Attributes from Event:
boolean bubbles = false;
boolean cancelable = false;
// Attributes from UIEvent:
WindowProxy? view = null;
long detail = 0;
// Attributes for MouseEvent: // Attributes for MouseEvent:
long screenX = 0; long screenX = 0;
long screenY = 0; long screenY = 0;
@ -100,7 +92,7 @@ partial interface MouseEvent
void initNSMouseEvent(DOMString typeArg, void initNSMouseEvent(DOMString typeArg,
boolean canBubbleArg, boolean canBubbleArg,
boolean cancelableArg, boolean cancelableArg,
WindowProxy? viewArg, Window? viewArg,
long detailArg, long detailArg,
long screenXArg, long screenXArg,
long screenYArg, long screenYArg,

View File

@ -4,8 +4,6 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. * You can obtain one at http://mozilla.org/MPL/2.0/.
*/ */
interface WindowProxy;
interface MouseScrollEvent : MouseEvent interface MouseScrollEvent : MouseEvent
{ {
const long HORIZONTAL_AXIS = 1; const long HORIZONTAL_AXIS = 1;
@ -17,7 +15,7 @@ interface MouseScrollEvent : MouseEvent
void initMouseScrollEvent(DOMString type, void initMouseScrollEvent(DOMString type,
boolean canBubble, boolean canBubble,
boolean cancelable, boolean cancelable,
WindowProxy? view, Window? view,
long detail, long detail,
long screenX, long screenX,
long screenY, long screenY,

View File

@ -4,8 +4,6 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. * You can obtain one at http://mozilla.org/MPL/2.0/.
*/ */
interface WindowProxy;
interface ScrollAreaEvent : UIEvent interface ScrollAreaEvent : UIEvent
{ {
readonly attribute float x; readonly attribute float x;
@ -17,7 +15,7 @@ interface ScrollAreaEvent : UIEvent
void initScrollAreaEvent(DOMString type, void initScrollAreaEvent(DOMString type,
boolean canBubble, boolean canBubble,
boolean cancelable, boolean cancelable,
WindowProxy? view, Window? view,
long detail, long detail,
float x, float x,
float y, float y,

View File

@ -6,8 +6,6 @@
* For more information see nsIDOMSimpleGestureEvent.idl. * For more information see nsIDOMSimpleGestureEvent.idl.
*/ */
interface WindowProxy;
interface SimpleGestureEvent : MouseEvent interface SimpleGestureEvent : MouseEvent
{ {
const unsigned long DIRECTION_UP = 1; const unsigned long DIRECTION_UP = 1;
@ -30,7 +28,7 @@ interface SimpleGestureEvent : MouseEvent
void initSimpleGestureEvent(DOMString typeArg, void initSimpleGestureEvent(DOMString typeArg,
boolean canBubbleArg, boolean canBubbleArg,
boolean cancelableArg, boolean cancelableArg,
WindowProxy? viewArg, Window? viewArg,
long detailArg, long detailArg,
long screenXArg, long screenXArg,
long screenYArg, long screenYArg,

View File

@ -10,13 +10,11 @@
* liability, trademark and document use rules apply. * liability, trademark and document use rules apply.
*/ */
interface WindowProxy;
interface TimeEvent : Event interface TimeEvent : Event
{ {
readonly attribute long detail; readonly attribute long detail;
readonly attribute WindowProxy? view; readonly attribute WindowProxy? view;
void initTimeEvent(DOMString aType, void initTimeEvent(DOMString aType,
WindowProxy? aView, Window? aView,
long aDetail); long aDetail);
}; };

View File

@ -4,8 +4,6 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. * You can obtain one at http://mozilla.org/MPL/2.0/.
*/ */
interface WindowProxy;
[Func="mozilla::dom::TouchEvent::PrefEnabled"] [Func="mozilla::dom::TouchEvent::PrefEnabled"]
interface TouchEvent : UIEvent { interface TouchEvent : UIEvent {
readonly attribute TouchList touches; readonly attribute TouchList touches;
@ -21,7 +19,7 @@ interface TouchEvent : UIEvent {
void initTouchEvent(DOMString type, void initTouchEvent(DOMString type,
boolean canBubble, boolean canBubble,
boolean cancelable, boolean cancelable,
WindowProxy? view, Window? view,
long detail, long detail,
boolean ctrlKey, boolean ctrlKey,
boolean altKey, boolean altKey,

View File

@ -10,8 +10,6 @@
* liability, trademark and document use rules apply. * liability, trademark and document use rules apply.
*/ */
interface WindowProxy;
[Constructor(DOMString type, optional UIEventInit eventInitDict)] [Constructor(DOMString type, optional UIEventInit eventInitDict)]
interface UIEvent : Event interface UIEvent : Event
{ {
@ -20,7 +18,7 @@ interface UIEvent : Event
void initUIEvent(DOMString aType, void initUIEvent(DOMString aType,
boolean aCanBubble, boolean aCanBubble,
boolean aCancelable, boolean aCancelable,
WindowProxy? aView, Window? aView,
long aDetail); long aDetail);
}; };
@ -42,6 +40,6 @@ partial interface UIEvent {
dictionary UIEventInit : EventInit dictionary UIEventInit : EventInit
{ {
WindowProxy? view = null; Window? view = null;
long detail = 0; long detail = 0;
}; };

View File

@ -4,8 +4,6 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. * You can obtain one at http://mozilla.org/MPL/2.0/.
*/ */
interface WindowProxy;
[Func="IsChromeOrXBL"] [Func="IsChromeOrXBL"]
interface XULCommandEvent : UIEvent interface XULCommandEvent : UIEvent
{ {
@ -20,7 +18,7 @@ interface XULCommandEvent : UIEvent
void initCommandEvent(DOMString type, void initCommandEvent(DOMString type,
boolean canBubble, boolean canBubble,
boolean cancelable, boolean cancelable,
WindowProxy? view, Window? view,
long detail, long detail,
boolean ctrlKey, boolean ctrlKey,
boolean altKey, boolean altKey,