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/xpcom',
'/accessible/xul',
'/dom/base',
'/dom/xbl',
'/ipc/chromium/src',
'/layout/generic',

View File

@ -11,6 +11,7 @@
#include "mozilla/HoldDropJSObjects.h"
#include "jsapi.h"
#include "nsGlobalWindow.h" // So we can assign an nsGlobalWindow* to mWindowSource
namespace mozilla {
namespace dom {
@ -141,8 +142,8 @@ MessageEvent::Constructor(const GlobalObject& aGlobal,
}
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();
}

View File

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

View File

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

View File

@ -4,8 +4,6 @@
* 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
{
@ -230,7 +228,7 @@ interface KeyEvent
void initKeyEvent(DOMString type,
boolean canBubble,
boolean cancelable,
WindowProxy? view,
Window? view,
boolean ctrlKey,
boolean altKey,
boolean shiftKey,

View File

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

View File

@ -7,8 +7,6 @@
* 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 {
@ -49,6 +47,6 @@ dictionary MessageEventInit : EventInit {
any data;
DOMString origin;
DOMString lastEventId;
(WindowProxy or MessagePort)? source = null;
(Window or MessagePort)? source = null;
sequence<MessagePort>? ports;
};

View File

@ -28,7 +28,7 @@ interface MouseEvent : UIEvent {
void initMouseEvent(DOMString typeArg,
boolean canBubbleArg,
boolean cancelableArg,
WindowProxy? viewArg,
Window? viewArg,
long detailArg,
long screenXArg,
long screenYArg,
@ -52,15 +52,7 @@ 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;
@ -100,7 +92,7 @@ partial interface MouseEvent
void initNSMouseEvent(DOMString typeArg,
boolean canBubbleArg,
boolean cancelableArg,
WindowProxy? viewArg,
Window? viewArg,
long detailArg,
long screenXArg,
long screenYArg,

View File

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

View File

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

View File

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

View File

@ -10,13 +10,11 @@
* 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);
};

View File

@ -4,8 +4,6 @@
* 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;
@ -21,7 +19,7 @@ interface TouchEvent : UIEvent {
void initTouchEvent(DOMString type,
boolean canBubble,
boolean cancelable,
WindowProxy? view,
Window? view,
long detail,
boolean ctrlKey,
boolean altKey,

View File

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

View File

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