aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/webidls/Window.webidl
blob: ea8559dadb7f17d8734c4c3bd0245711a755e754 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/* -*- 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/. */

// http://www.whatwg.org/html/#window
[PrimaryGlobal]
/*sealed*/ interface Window : EventTarget {
  // the current browsing context
  //[Unforgeable] readonly attribute WindowProxy window;
  //[Replaceable] readonly attribute WindowProxy self;
  readonly attribute Window window;
  readonly attribute Window self;
  /*[Unforgeable]*/ readonly attribute Document document;
  //         attribute DOMString name;
  /*[PutForwards=href, Unforgeable]*/ readonly attribute Location location;
  //readonly attribute History history;
  //[Replaceable] readonly attribute BarProp locationbar;
  //[Replaceable] readonly attribute BarProp menubar;
  //[Replaceable] readonly attribute BarProp personalbar;
  //[Replaceable] readonly attribute BarProp scrollbars;
  //[Replaceable] readonly attribute BarProp statusbar;
  //[Replaceable] readonly attribute BarProp toolbar;
  //         attribute DOMString status;
  void close();
  //readonly attribute boolean closed;
  //void stop();
  //void focus();
  //void blur();

  // other browsing contexts
  //[Replaceable] readonly attribute WindowProxy frames;
  readonly attribute Window frames;
  //[Replaceable] readonly attribute unsigned long length;
  //[Unforgeable] readonly attribute WindowProxy top;
  //         attribute any opener;
  //readonly attribute WindowProxy parent;
  readonly attribute Window parent;
  readonly attribute Element? frameElement;
  //WindowProxy open(optional DOMString url = "about:blank", optional DOMString target = "_blank", optional DOMString features = "", optional boolean replace = false);
  //getter WindowProxy (unsigned long index);
  //getter object (DOMString name);

  // the user agent
  readonly attribute Navigator navigator;
  //[Replaceable] readonly attribute External external;
  //readonly attribute ApplicationCache applicationCache;

  // user prompts
  //void alert();
  void alert(DOMString message);
  //boolean confirm(optional DOMString message = "");
  //DOMString? prompt(optional DOMString message = "", optional DOMString default = "");
  //void print();
  //any showModalDialog(DOMString url, optional any argument);

  //void postMessage(any message, DOMString targetOrigin, optional sequence<Transferable> transfer);

  // also has obsolete members
};
Window implements GlobalEventHandlers;
Window implements WindowEventHandlers;

// http://www.whatwg.org/html/#windowtimers
[NoInterfaceObject/*, Exposed=Window,Worker*/]
interface WindowTimers {
  long setTimeout(Function handler, optional long timeout = 0, any... arguments);
  long setTimeout(DOMString handler, optional long timeout = 0, any... arguments);
  void clearTimeout(optional long handle = 0);
  long setInterval(Function handler, optional long timeout = 0, any... arguments);
  long setInterval(DOMString handler, optional long timeout = 0, any... arguments);
  void clearInterval(optional long handle = 0);
};
Window implements WindowTimers;

// http://www.whatwg.org/html/#atob
[NoInterfaceObject/*, Exposed=Window,Worker*/]
interface WindowBase64 {
  [Throws]
  DOMString btoa(DOMString btoa);
  [Throws]
  DOMString atob(DOMString atob);
};
Window implements WindowBase64;

// https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html#sec-window.performance-attribute
partial interface Window {
  /*[Replaceable]*/ readonly attribute Performance performance;
};

// http://dev.w3.org/csswg/cssom-view/#extensions-to-the-window-interface
partial interface Window {
  //MediaQueryList matchMedia(DOMString query);
  [SameObject] readonly attribute Screen screen;

  // browsing context
  //void moveTo(double x, double y);
  //void moveBy(double x, double y);
  //void resizeTo(double x, double y);
  //void resizeBy(double x, double y);

  // viewport
  //readonly attribute double innerWidth;
  //readonly attribute double innerHeight;

  // viewport scrolling
  //readonly attribute double scrollX;
  //readonly attribute double pageXOffset;
  //readonly attribute double scrollY;
  //readonly attribute double pageYOffset;
  //void scroll(double x, double y, optional ScrollOptions options);
  //void scrollTo(double x, double y, optional ScrollOptions options);
  //void scrollBy(double x, double y, optional ScrollOptions options);

  // client
  //readonly attribute double screenX;
  //readonly attribute double screenY;
  //readonly attribute double outerWidth;
  //readonly attribute double outerHeight;
  //readonly attribute double devicePixelRatio;
};

// Proprietary extensions.
partial interface Window {
  readonly attribute Console console;
  void debug(DOMString arg);
  void gc();
};
Window implements OnErrorEventHandlerForWindow;

// https://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage
[NoInterfaceObject]
interface WindowSessionStorage {
  readonly attribute Storage sessionStorage;
};
Window implements WindowSessionStorage;