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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
|
/* 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 https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#window
[Global=Window, Exposed=Window /*, LegacyUnenumerableNamedProperties */]
/*sealed*/ interface Window : GlobalScope {
// the current browsing context
[LegacyUnforgeable, CrossOriginReadable] readonly attribute WindowProxy window;
[BinaryName="Self_", Replaceable, CrossOriginReadable] readonly attribute WindowProxy self;
[LegacyUnforgeable] readonly attribute Document document;
attribute DOMString name;
[PutForwards=href, LegacyUnforgeable, CrossOriginReadable, CrossOriginWritable]
readonly attribute Location location;
readonly attribute History history;
[Pref="dom_customelements_enabled"]
readonly attribute CustomElementRegistry customElements;
//[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;
[CrossOriginCallable] undefined close();
[CrossOriginReadable] readonly attribute boolean closed;
undefined stop();
//[CrossOriginCallable] void focus();
//[CrossOriginCallable] void blur();
// other browsing contexts
[Replaceable, CrossOriginReadable] readonly attribute WindowProxy frames;
[Replaceable, CrossOriginReadable] readonly attribute unsigned long length;
// Note that this can return null in the case that the browsing context has been discarded.
// https://github.com/whatwg/html/issues/2115
[LegacyUnforgeable, CrossOriginReadable] readonly attribute WindowProxy? top;
[Throws, CrossOriginReadable] attribute any opener;
// Note that this can return null in the case that the browsing context has been discarded.
// https://github.com/whatwg/html/issues/2115
[Replaceable, CrossOriginReadable] readonly attribute WindowProxy? parent;
readonly attribute Element? frameElement;
[Throws] WindowProxy? open(optional USVString url = "", optional DOMString target = "_blank",
optional DOMString features = "");
//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
undefined alert(DOMString message);
undefined alert();
boolean confirm(optional DOMString message = "");
DOMString? prompt(optional DOMString message = "", optional DOMString default = "");
//void print();
//any showModalDialog(DOMString url, optional any argument);
unsigned long requestAnimationFrame(FrameRequestCallback callback);
undefined cancelAnimationFrame(unsigned long handle);
[Throws, CrossOriginCallable]
undefined postMessage(any message, USVString targetOrigin, optional sequence<object> transfer = []);
[Throws, CrossOriginCallable]
undefined postMessage(any message, optional WindowPostMessageOptions options = {});
// also has obsolete members
};
Window includes GlobalEventHandlers;
Window includes WindowEventHandlers;
// https://html.spec.whatwg.org/multipage/#Window-partial
partial interface Window {
undefined captureEvents();
undefined releaseEvents();
};
// https://drafts.csswg.org/cssom/#extensions-to-the-window-interface
partial interface Window {
[NewObject]
CSSStyleDeclaration getComputedStyle(Element elt, optional DOMString pseudoElt);
};
// http://dev.w3.org/csswg/cssom-view/#extensions-to-the-window-interface
enum ScrollBehavior { "auto", "instant", "smooth" };
// http://dev.w3.org/csswg/cssom-view/#extensions-to-the-window-interface
dictionary ScrollOptions {
ScrollBehavior behavior = "auto";
};
// http://dev.w3.org/csswg/cssom-view/#extensions-to-the-window-interface
dictionary ScrollToOptions : ScrollOptions {
unrestricted double left;
unrestricted double top;
};
// http://dev.w3.org/csswg/cssom-view/#extensions-to-the-window-interface
partial interface Window {
[Exposed=(Window), NewObject] MediaQueryList matchMedia(DOMString query);
[SameObject, Replaceable] readonly attribute Screen screen;
// browsing context
undefined moveTo(long x, long y);
undefined moveBy(long x, long y);
undefined resizeTo(long x, long y);
undefined resizeBy(long x, long y);
// viewport
[Replaceable] readonly attribute long innerWidth;
[Replaceable] readonly attribute long innerHeight;
// viewport scrolling
[Replaceable] readonly attribute long scrollX;
[Replaceable] readonly attribute long pageXOffset;
[Replaceable] readonly attribute long scrollY;
[Replaceable] readonly attribute long pageYOffset;
undefined scroll(optional ScrollToOptions options = {});
undefined scroll(unrestricted double x, unrestricted double y);
undefined scrollTo(optional ScrollToOptions options = {});
undefined scrollTo(unrestricted double x, unrestricted double y);
undefined scrollBy(optional ScrollToOptions options = {});
undefined scrollBy(unrestricted double x, unrestricted double y);
// client
[Replaceable] readonly attribute long screenX;
[Replaceable] readonly attribute long screenY;
[Replaceable] readonly attribute long outerWidth;
[Replaceable] readonly attribute long outerHeight;
[Replaceable] readonly attribute double devicePixelRatio;
};
// Proprietary extensions.
partial interface Window {
[Pref="dom_servo_helpers_enabled"]
undefined debug(DOMString arg);
[Pref="dom_servo_helpers_enabled"]
undefined gc();
[Pref="dom_servo_helpers_enabled"]
undefined js_backtrace();
};
// WebDriver extensions
partial interface Window {
// Shouldn't be public, but just to make things work for now
undefined webdriverCallback(optional any result);
undefined webdriverTimeout();
};
// https://html.spec.whatwg.org/multipage/#dom-sessionstorage
interface mixin WindowSessionStorage {
readonly attribute Storage sessionStorage;
};
Window includes WindowSessionStorage;
// https://html.spec.whatwg.org/multipage/#dom-localstorage
interface mixin WindowLocalStorage {
readonly attribute Storage localStorage;
};
Window includes WindowLocalStorage;
// http://w3c.github.io/animation-timing/#framerequestcallback
callback FrameRequestCallback = undefined (DOMHighResTimeStamp time);
// https://webbluetoothcg.github.io/web-bluetooth/tests#test-interfaces
partial interface Window {
[Pref="dom_bluetooth_testing_enabled", Exposed=Window]
readonly attribute TestRunner testRunner;
//readonly attribute EventSender eventSender;
};
partial interface Window {
[Pref="css_animations_testing_enabled"]
readonly attribute unsigned long runningAnimationCount;
};
// https://w3c.github.io/selection-api/#dom-document
partial interface Window {
Selection? getSelection();
};
// https://dom.spec.whatwg.org/#interface-window-extensions
partial interface Window {
[Replaceable] readonly attribute any event; // historical
};
dictionary WindowPostMessageOptions : StructuredSerializeOptions {
USVString targetOrigin = "/";
};
|