OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
3 * Copyright (C) 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2011 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 10 matching lines...) Expand all Loading... |
21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
25 */ | 25 */ |
26 | 26 |
27 // https://html.spec.whatwg.org/#the-window-object | 27 // https://html.spec.whatwg.org/#the-window-object |
28 | 28 |
29 // FIXME: explain all uses of [DoNotCheckSecurity] | 29 // FIXME: explain all uses of [DoNotCheckSecurity] |
30 [ | 30 [ |
31 CheckSecurity=Frame, | 31 CheckSecurity=Receiver, |
32 ImplementedAs=DOMWindow, | 32 ImplementedAs=DOMWindow, |
33 PrimaryGlobal, | 33 PrimaryGlobal, |
34 ] interface Window : EventTarget { | 34 ] interface Window : EventTarget { |
35 // the current browsing context | 35 // the current browsing context |
36 // FIXME: The spec uses the WindowProxy type for this and many other attribu
tes. | 36 // FIXME: The spec uses the WindowProxy type for this and many other attribu
tes. |
37 [Unforgeable, DoNotCheckSecurity] readonly attribute Window window; | 37 [Unforgeable, DoNotCheckSecurity] readonly attribute Window window; |
38 [Replaceable, DoNotCheckSecurity] readonly attribute Window self; | 38 [Replaceable, DoNotCheckSecurity] readonly attribute Window self; |
39 [Unforgeable] readonly attribute Document document; | 39 [Unforgeable] readonly attribute Document document; |
40 attribute DOMString name; | 40 attribute DOMString name; |
41 [PutForwards=href, Unforgeable, DoNotCheckSecurity] readonly attribute Locat
ion location; | 41 [PutForwards=href, Unforgeable, DoNotCheckSecurity] readonly attribute Locat
ion location; |
(...skipping 11 matching lines...) Expand all Loading... |
53 [DoNotCheckSecurity, CallWith=ExecutionContext] void focus(); | 53 [DoNotCheckSecurity, CallWith=ExecutionContext] void focus(); |
54 [DoNotCheckSecurity] void blur(); | 54 [DoNotCheckSecurity] void blur(); |
55 | 55 |
56 // other browsing contexts | 56 // other browsing contexts |
57 [Replaceable, DoNotCheckSecurity] readonly attribute Window frames; | 57 [Replaceable, DoNotCheckSecurity] readonly attribute Window frames; |
58 [Replaceable, DoNotCheckSecurity] readonly attribute unsigned long length; | 58 [Replaceable, DoNotCheckSecurity] readonly attribute unsigned long length; |
59 [Unforgeable, DoNotCheckSecurity] readonly attribute Window top; | 59 [Unforgeable, DoNotCheckSecurity] readonly attribute Window top; |
60 // FIXME: opener should be of type any. | 60 // FIXME: opener should be of type any. |
61 [DoNotCheckSecurity, Custom=Setter] attribute Window opener; | 61 [DoNotCheckSecurity, Custom=Setter] attribute Window opener; |
62 [Replaceable, DoNotCheckSecurity] readonly attribute Window parent; | 62 [Replaceable, DoNotCheckSecurity] readonly attribute Window parent; |
63 [CheckSecurity=Node, Custom=Getter] readonly attribute Element? frameElement
; | 63 [CheckSecurity=ReturnValue, Custom=Getter] readonly attribute Element? frame
Element; |
64 // FIXME: open() should have 4 optional arguments with defaults. | 64 // FIXME: open() should have 4 optional arguments with defaults. |
65 [Custom] Window open(DOMString url, DOMString target, optional DOMString fea
tures); | 65 [Custom] Window? open(DOMString url, DOMString target, optional DOMString fe
atures); |
66 // FIXME: These getters should not have [NotEnumerable]. | 66 // FIXME: These getters should not have [NotEnumerable]. |
67 [NotEnumerable, DoNotCheckSecurity] getter Window (unsigned long index); | 67 [NotEnumerable, DoNotCheckSecurity] getter Window (unsigned long index); |
68 [Custom, NotEnumerable, DoNotCheckSecurity] getter object (DOMString name); | 68 [Custom, NotEnumerable, DoNotCheckSecurity] getter object (DOMString name); |
69 | 69 |
70 // the user agent | 70 // the user agent |
71 [LogActivity=GetterOnly] readonly attribute Navigator navigator; | 71 [LogActivity=GetterOnly] readonly attribute Navigator navigator; |
72 [RuntimeEnabled=ApplicationCache, LogActivity=GetterOnly] readonly attribute
ApplicationCache applicationCache; | 72 [RuntimeEnabled=ApplicationCache, LogActivity=GetterOnly] readonly attribute
ApplicationCache applicationCache; |
73 | 73 |
74 // user prompts | 74 // user prompts |
75 void alert(); | 75 [Measure] void alert(); |
76 void alert(DOMString message); | 76 [Measure] void alert(DOMString message); |
77 boolean confirm(optional DOMString message = ""); | 77 [Measure] boolean confirm(optional DOMString message = ""); |
78 DOMString? prompt(optional DOMString message = "", optional DOMString defaul
tValue = ""); | 78 [Measure] DOMString? prompt(optional DOMString message = "", optional DOMStr
ing defaultValue = ""); |
79 void print(); | 79 [Measure] void print(); |
80 | 80 |
81 // FIXME: requestAnimationFrame should take a FrameRequestCallback: | |
82 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=28152 | |
83 [MeasureAs=UnprefixedRequestAnimationFrame] long requestAnimationFrame(Frame
RequestCallback callback); | 81 [MeasureAs=UnprefixedRequestAnimationFrame] long requestAnimationFrame(Frame
RequestCallback callback); |
84 void cancelAnimationFrame(long handle); | 82 void cancelAnimationFrame(long handle); |
85 | 83 |
| 84 [Measure, RuntimeEnabled=RequestIdleCallback] long requestIdleCallback(IdleR
equestCallback callback, optional IdleRequestOptions options); |
| 85 [RuntimeEnabled=RequestIdleCallback] void cancelIdleCallback(long handle); |
| 86 |
86 [DoNotCheckSecurity, Custom, RaisesException] void postMessage(any message,
DOMString targetOrigin, optional sequence<Transferable> transfer); | 87 [DoNotCheckSecurity, Custom, RaisesException] void postMessage(any message,
DOMString targetOrigin, optional sequence<Transferable> transfer); |
87 | 88 |
88 // HTML obsolete features | 89 // HTML obsolete features |
89 // https://html.spec.whatwg.org/#Window-partial | 90 // https://html.spec.whatwg.org/#Window-partial |
90 [MeasureAs=WindowCaptureEvents] void captureEvents(); | 91 [MeasureAs=WindowCaptureEvents] void captureEvents(); |
91 [MeasureAs=WindowReleaseEvents] void releaseEvents(); | 92 [MeasureAs=WindowReleaseEvents] void releaseEvents(); |
92 | 93 |
93 // CSS Object Model (CSSOM) | 94 // CSS Object Model (CSSOM) |
94 // http://dev.w3.org/csswg/cssom/#extensions-to-the-window-interface | 95 // http://dev.w3.org/csswg/cssom/#extensions-to-the-window-interface |
95 // FIXME: The optional pseudoElt argument should have no default. | 96 // FIXME: The optional pseudoElt argument should have no default. |
96 [NewObject, TypeChecking=Interface] CSSStyleDeclaration getComputedStyle(Ele
ment elt, optional DOMString? pseudoElt = null); | 97 [NewObject] CSSStyleDeclaration getComputedStyle(Element elt, optional DOMSt
ring? pseudoElt = null); |
97 | 98 |
98 // CSSOM View Module | 99 // CSSOM View Module |
99 // http://dev.w3.org/csswg/cssom-view/#extensions-to-the-window-interface | 100 // http://dev.w3.org/csswg/cssom-view/#extensions-to-the-window-interface |
100 [NewObject] MediaQueryList matchMedia(DOMString query); | 101 [NewObject] MediaQueryList matchMedia(DOMString query); |
101 [SameObject, Replaceable] readonly attribute Screen screen; | 102 [SameObject, Replaceable] readonly attribute Screen screen; |
102 | 103 |
103 // browsing context | 104 // browsing context |
104 void moveTo(long x, long y); | 105 void moveTo(long x, long y); |
105 void moveBy(long x, long y); | 106 void moveBy(long x, long y); |
106 void resizeTo(long x, long y); | 107 void resizeTo(long x, long y); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 [Default=Undefined] optional boolean wra
p, | 147 [Default=Undefined] optional boolean wra
p, |
147 [Default=Undefined] optional boolean who
leWord, | 148 [Default=Undefined] optional boolean who
leWord, |
148 [Default=Undefined] optional boolean sea
rchInFrames, | 149 [Default=Undefined] optional boolean sea
rchInFrames, |
149 [Default=Undefined] optional boolean sho
wDialog); | 150 [Default=Undefined] optional boolean sho
wDialog); |
150 [MeasureAs=WindowOffscreenBuffering, Replaceable, NotEnumerable] readonly at
tribute boolean offscreenBuffering; | 151 [MeasureAs=WindowOffscreenBuffering, Replaceable, NotEnumerable] readonly at
tribute boolean offscreenBuffering; |
151 [MeasureAs=WindowScreenLeft, Replaceable] readonly attribute long screenLeft
; | 152 [MeasureAs=WindowScreenLeft, Replaceable] readonly attribute long screenLeft
; |
152 [MeasureAs=WindowScreenTop, Replaceable] readonly attribute long screenTop; | 153 [MeasureAs=WindowScreenTop, Replaceable] readonly attribute long screenTop; |
153 [MeasureAs=WindowDefaultStatus] attribute DOMString defaultStatus; | 154 [MeasureAs=WindowDefaultStatus] attribute DOMString defaultStatus; |
154 [MeasureAs=WindowDefaultstatus, ImplementedAs=defaultStatus] attribute DOMSt
ring defaultstatus; | 155 [MeasureAs=WindowDefaultstatus, ImplementedAs=defaultStatus] attribute DOMSt
ring defaultstatus; |
155 [MeasureAs=StyleMedia] readonly attribute StyleMedia styleMedia; | 156 [MeasureAs=StyleMedia] readonly attribute StyleMedia styleMedia; |
156 [DeprecateAs=GetMatchedCSSRules] CSSRuleList getMatchedCSSRules([Default=Und
efined] optional Element element, | 157 [DeprecateAs=GetMatchedCSSRules, LegacyInterfaceTypeChecking] CSSRuleList ge
tMatchedCSSRules([Default=Undefined] optional Element element, |
157 [TreatUndefi
nedAs=NullString, Default=Undefined] optional DOMString? pseudoElement); | 158
[TreatUndefinedAs=NullString, Default=Undefined] optional DOMSt
ring? pseudoElement); |
158 // This is the interface orientation in degrees. Some examples are: | 159 // This is the interface orientation in degrees. Some examples are: |
159 // 0 is straight up; -90 is when the device is rotated 90 clockwise; | 160 // 0 is straight up; -90 is when the device is rotated 90 clockwise; |
160 // 90 is when rotated counter clockwise. | 161 // 90 is when rotated counter clockwise. |
161 [MeasureAs=WindowOrientation, RuntimeEnabled=OrientationEvent] readonly attr
ibute long orientation; | 162 [MeasureAs=WindowOrientation, RuntimeEnabled=OrientationEvent] readonly attr
ibute long orientation; |
162 [DeprecateAs=PrefixedRequestAnimationFrame] long webkitRequestAnimationFrame
(FrameRequestCallback callback); | 163 [DeprecateAs=PrefixedRequestAnimationFrame] long webkitRequestAnimationFrame
(FrameRequestCallback callback); |
163 [DeprecateAs=PrefixedCancelAnimationFrame, ImplementedAs=cancelAnimationFram
e] void webkitCancelAnimationFrame(long id); | 164 [DeprecateAs=PrefixedCancelAnimationFrame, ImplementedAs=cancelAnimationFram
e] void webkitCancelAnimationFrame(long id); |
164 [DeprecateAs=PrefixedCancelRequestAnimationFrame, ImplementedAs=cancelAnimat
ionFrame] void webkitCancelRequestAnimationFrame(long id); | 165 [DeprecateAs=PrefixedCancelRequestAnimationFrame, ImplementedAs=cancelAnimat
ionFrame] void webkitCancelRequestAnimationFrame(long id); |
165 [MeasureAs=PrefixedTransitionEventConstructor] attribute TransitionEventCons
tructor WebKitTransitionEvent; | 166 [MeasureAs=PrefixedTransitionEventConstructor] attribute TransitionEventCons
tructor WebKitTransitionEvent; |
166 [Measure] attribute AnimationEventConstructor WebKitAnimationEvent; | 167 [Measure] attribute AnimationEventConstructor WebKitAnimationEvent; |
167 [DeprecateAs=PrefixedWindowURL] attribute URLConstructor webkitURL; | 168 [DeprecateAs=PrefixedWindowURL] attribute URLConstructor webkitURL; |
168 [MeasureAs=PrefixedMutationObserverConstructor] attribute MutationObserverCo
nstructor WebKitMutationObserver; | 169 [MeasureAs=PrefixedMutationObserverConstructor] attribute MutationObserverCo
nstructor WebKitMutationObserver; |
169 | 170 |
170 // Event handler attributes | 171 // Event handler attributes |
171 attribute EventHandler onanimationend; | 172 attribute EventHandler onanimationend; |
172 attribute EventHandler onanimationiteration; | 173 attribute EventHandler onanimationiteration; |
173 attribute EventHandler onanimationstart; | 174 attribute EventHandler onanimationstart; |
174 [RuntimeEnabled=OrientationEvent] attribute EventHandler onorientationchange
; | 175 [RuntimeEnabled=OrientationEvent] attribute EventHandler onorientationchange
; |
175 attribute EventHandler onsearch; | 176 attribute EventHandler onsearch; |
176 [RuntimeEnabled=Touch] attribute EventHandler ontouchcancel; | |
177 [RuntimeEnabled=Touch] attribute EventHandler ontouchend; | |
178 [RuntimeEnabled=Touch] attribute EventHandler ontouchmove; | |
179 [RuntimeEnabled=Touch] attribute EventHandler ontouchstart; | |
180 attribute EventHandler ontransitionend; | 177 attribute EventHandler ontransitionend; |
181 attribute EventHandler onwebkitanimationend; | 178 attribute EventHandler onwebkitanimationend; |
182 attribute EventHandler onwebkitanimationiteration; | 179 attribute EventHandler onwebkitanimationiteration; |
183 attribute EventHandler onwebkitanimationstart; | 180 attribute EventHandler onwebkitanimationstart; |
184 attribute EventHandler onwebkittransitionend; | 181 attribute EventHandler onwebkittransitionend; |
185 attribute EventHandler onwheel; | 182 attribute EventHandler onwheel; |
186 | 183 |
187 // window.toString() requires special handling in V8 | 184 // https://w3c.github.io/webappsec/specs/powerfulfeatures/#monkey-patching-g
lobal-object |
188 [DoNotCheckSignature, DoNotCheckSecurity, Custom, NotEnumerable] stringifier
; | 185 readonly attribute boolean isSecureContext; |
189 }; | 186 }; |
190 | 187 |
191 // http://www.whatwg.org/specs/web-apps/current-work/#transferable-objects | 188 // http://www.whatwg.org/specs/web-apps/current-work/#transferable-objects |
192 // | 189 // |
193 // Expressing the Transferable typedef in IDL depends on http://crbug.com/240176
. | 190 // Expressing the Transferable typedef in IDL depends on http://crbug.com/240176
. |
194 // The postMessage() methods taking a Transferable array argument have custom | 191 // The postMessage() methods taking a Transferable array argument have custom |
195 // binding code that is able to handle the Transferables that we currently | 192 // binding code that is able to handle the Transferables that we currently |
196 // recognize. To be able to declare a postMessage() signature that matches | 193 // recognize. To be able to declare a postMessage() signature that matches |
197 // the implementation, we provide a Transferable typedef but with an | 194 // the implementation, we provide a Transferable typedef but with an |
198 // incomplete type. | 195 // incomplete type. |
199 // | 196 // |
200 // FIXME: make this typedef accurate once enough of http://crbug.com/240176 | 197 // FIXME: make this typedef accurate once enough of http://crbug.com/240176 |
201 // is in place. | 198 // is in place. |
202 // FIXME: consider putting this typedef in an .idl file containing spec-wide | 199 // FIXME: consider putting this typedef in an .idl file containing spec-wide |
203 // utility type definitions. | 200 // utility type definitions. |
204 typedef MessagePort Transferable; | 201 typedef MessagePort Transferable; |
205 | 202 |
206 Window implements GlobalEventHandlers; | 203 Window implements GlobalEventHandlers; |
207 Window implements WindowBase64; | 204 Window implements WindowBase64; |
208 Window implements WindowEventHandlers; | 205 Window implements WindowEventHandlers; |
209 Window implements WindowTimers; | 206 Window implements WindowTimers; |
OLD | NEW |