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 |
11 * notice, this list of conditions and the following disclaimer in the | 11 * notice, this list of conditions and the following disclaimer in the |
12 * documentation and/or other materials provided with the distribution. | 12 * documentation and/or other materials provided with the distribution. |
13 * | 13 * |
14 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY | 14 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY |
15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR | 17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR |
18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
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 // HTML 5 draft spec: | 27 // HTML 5 draft spec: |
28 // http://www.w3.org/html/wg/drafts/html/master/browsers.html#window | 28 // http://www.w3.org/html/wg/drafts/html/master/browsers.html#window |
| 29 // FIXME: explain all uses of [DoNotCheckSecurity] |
29 [ | 30 [ |
30 CheckSecurity, | 31 CheckSecurity=Frame, |
31 CustomToV8, | 32 Custom=ToV8, |
32 DoNotGenerateWrap, | 33 ImplementedAs=DOMWindow, |
33 ImplementedAs=DOMWindow | |
34 ] interface Window : EventTarget { | 34 ] interface Window : EventTarget { |
35 // DOM Level 0 | 35 // DOM Level 0 |
36 [Replaceable] readonly attribute Screen screen; | 36 [Replaceable] readonly attribute Screen screen; |
37 [Replaceable] readonly attribute History history; | 37 [Replaceable] readonly attribute History history; |
38 [Replaceable] readonly attribute BarProp locationbar; | 38 [Replaceable] readonly attribute BarProp locationbar; |
39 [Replaceable] readonly attribute BarProp menubar; | 39 [Replaceable] readonly attribute BarProp menubar; |
40 [Replaceable] readonly attribute BarProp personalbar; | 40 [Replaceable] readonly attribute BarProp personalbar; |
41 [Replaceable] readonly attribute BarProp scrollbars; | 41 [Replaceable] readonly attribute BarProp scrollbars; |
42 [Replaceable] readonly attribute BarProp statusbar; | 42 [Replaceable] readonly attribute BarProp statusbar; |
43 [Replaceable] readonly attribute BarProp toolbar; | 43 [Replaceable] readonly attribute BarProp toolbar; |
44 [Replaceable, PerWorldBindings, ActivityLogging=GetterForIsolatedWorlds] rea
donly attribute Navigator navigator; | 44 [Replaceable, PerWorldBindings, ActivityLogging=GetterForIsolatedWorlds] rea
donly attribute Navigator navigator; |
45 [Replaceable] readonly attribute Navigator clientInformation; | 45 [Replaceable] readonly attribute Navigator clientInformation; |
46 [DoNotCheckSecurity, Unforgeable, Replaceable, PerWorldBindings, ActivityLog
ging=AccessForIsolatedWorlds, PutForwards=href] readonly attribute Location loca
tion; | 46 [DoNotCheckSecurity, Unforgeable, Replaceable, PerWorldBindings, ActivityLog
ging=ForIsolatedWorlds, PutForwards=href] readonly attribute Location location; |
47 [Custom, MeasureAs=WindowEvent, NotEnumerable] attribute Event event; | 47 [Custom, MeasureAs=WindowEvent, NotEnumerable] attribute Event event; |
48 | 48 |
49 Selection getSelection(); | 49 Selection getSelection(); |
50 | 50 |
51 [CheckSecurityForNode] readonly attribute Element frameElement; | 51 [CheckSecurity=Node, Custom=Getter] readonly attribute Element frameElement; |
52 | 52 |
53 [DoNotCheckSecurity, CallWith=ExecutionContext] void focus(); | 53 [DoNotCheckSecurity, CallWith=ExecutionContext] void focus(); |
54 [DoNotCheckSecurity] void blur(); | 54 [DoNotCheckSecurity] void blur(); |
55 [DoNotCheckSecurity, CallWith=ExecutionContext] void close(); | 55 [DoNotCheckSecurity, CallWith=ExecutionContext] void close(); |
56 | 56 |
57 void print(); | 57 void print(); |
58 void stop(); | 58 void stop(); |
59 | 59 |
60 [Custom] Window open(DOMString url, | 60 [Custom] Window open(DOMString url, |
61 DOMString name, | 61 DOMString name, |
(...skipping 24 matching lines...) Expand all Loading... |
86 [Replaceable] readonly attribute long innerWidth; | 86 [Replaceable] readonly attribute long innerWidth; |
87 [Replaceable] readonly attribute long screenX; | 87 [Replaceable] readonly attribute long screenX; |
88 [Replaceable] readonly attribute long screenY; | 88 [Replaceable] readonly attribute long screenY; |
89 [Replaceable] readonly attribute long screenLeft; | 89 [Replaceable] readonly attribute long screenLeft; |
90 [Replaceable] readonly attribute long screenTop; | 90 [Replaceable] readonly attribute long screenTop; |
91 [Replaceable] readonly attribute long scrollX; | 91 [Replaceable] readonly attribute long scrollX; |
92 [Replaceable] readonly attribute long scrollY; | 92 [Replaceable] readonly attribute long scrollY; |
93 readonly attribute long pageXOffset; | 93 readonly attribute long pageXOffset; |
94 readonly attribute long pageYOffset; | 94 readonly attribute long pageYOffset; |
95 | 95 |
96 void scrollBy([Default=Undefined] optional long x, [Default=Undefined] optio
nal long y); | 96 void scrollBy(long x, long y); |
97 void scrollTo([Default=Undefined] optional long x, [Default=Undefined] optio
nal long y); | 97 void scrollTo(long x, long y); |
98 void scroll([Default=Undefined] optional long x, [Default=Undefined] optiona
l long y); | 98 void scroll(long x, long y); |
99 void moveBy([Default=Undefined] optional float x, [Default=Undefined] option
al float y); // FIXME: this should take longs not floats. | 99 void moveBy([Default=Undefined] optional float x, [Default=Undefined] option
al float y); // FIXME: this should take longs not floats. |
100 void moveTo([Default=Undefined] optional float x, [Default=Undefined] option
al float y); // FIXME: this should take longs not floats. | 100 void moveTo([Default=Undefined] optional float x, [Default=Undefined] option
al float y); // FIXME: this should take longs not floats. |
101 void resizeBy([Default=Undefined] optional float x, [Default=Undefined] opti
onal float y); // FIXME: this should take longs not floats. | 101 void resizeBy([Default=Undefined] optional float x, [Default=Undefined] opti
onal float y); // FIXME: this should take longs not floats. |
102 void resizeTo([Default=Undefined] optional float width, [Default=Undefined]
optional float height); // FIXME: this should take longs not floats. | 102 void resizeTo([Default=Undefined] optional float width, [Default=Undefined]
optional float height); // FIXME: this should take longs not floats. |
103 | 103 |
104 [DoNotCheckSecurity] readonly attribute boolean closed; | 104 [DoNotCheckSecurity] readonly attribute boolean closed; |
105 | 105 |
106 [Replaceable, DoNotCheckSecurityOnGetter] readonly attribute unsigned long l
ength; | 106 [Replaceable, DoNotCheckSecurity] readonly attribute unsigned long length; |
107 | 107 |
108 attribute DOMString name; | 108 attribute DOMString name; |
109 | 109 |
110 attribute DOMString status; | 110 attribute DOMString status; |
111 attribute DOMString defaultStatus; | 111 attribute DOMString defaultStatus; |
112 // This attribute is an alias of defaultStatus and is necessary for legacy u
ses. | 112 // This attribute is an alias of defaultStatus and is necessary for legacy u
ses. |
113 attribute DOMString defaultstatus; | 113 [ImplementedAs=defaultStatus] attribute DOMString defaultstatus; |
114 | 114 |
115 // Self referential attributes | 115 // Self referential attributes |
116 [Replaceable, DoNotCheckSecurityOnGetter] readonly attribute Window self; | 116 [Replaceable, DoNotCheckSecurity] readonly attribute Window self; |
117 [DoNotCheckSecurity, Unforgeable] readonly attribute Window window; | 117 [DoNotCheckSecurity, Unforgeable] readonly attribute Window window; |
118 [Replaceable, DoNotCheckSecurityOnGetter] readonly attribute Window frames; | 118 [Replaceable, DoNotCheckSecurity] readonly attribute Window frames; |
119 | 119 |
120 [DoNotCheckSecurityOnGetter, CustomSetter] attribute Window opener; | 120 [DoNotCheckSecurity, Custom=Setter] attribute Window opener; |
121 [Replaceable, DoNotCheckSecurityOnGetter] readonly attribute Window parent; | 121 [Replaceable, DoNotCheckSecurity] readonly attribute Window parent; |
122 [DoNotCheckSecurityOnGetter, Unforgeable] readonly attribute Window top; | 122 [DoNotCheckSecurity, Unforgeable] readonly attribute Window top; |
123 | 123 |
124 // DOM Level 2 AbstractView Interface | 124 // DOM Level 2 AbstractView Interface |
125 readonly attribute Document document; | 125 readonly attribute Document document; |
126 | 126 |
127 // CSSOM View Module | 127 // CSSOM View Module |
128 MediaQueryList matchMedia(DOMString query); | 128 MediaQueryList matchMedia(DOMString query); |
129 | 129 |
130 // styleMedia has been removed from the CSSOM View specification. | 130 // styleMedia has been removed from the CSSOM View specification. |
131 readonly attribute StyleMedia styleMedia; | 131 readonly attribute StyleMedia styleMedia; |
132 | 132 |
133 // DOM Level 2 Style Interface | 133 // DOM Level 2 Style Interface |
134 [PerWorldBindings] CSSStyleDeclaration getComputedStyle([Default=Undefined]
optional Element element, | 134 [PerWorldBindings] CSSStyleDeclaration getComputedStyle([Default=Undefined]
optional Element element, |
135 [TreatNullAs=NullS
tring, TreatUndefinedAs=NullString,Default=Undefined] optional DOMString pseudoE
lement); | 135 [TreatNullAs=NullS
tring, TreatUndefinedAs=NullString,Default=Undefined] optional DOMString pseudoE
lement); |
136 | 136 |
137 // WebKit extensions | 137 // WebKit extensions |
138 CSSRuleList getMatchedCSSRules([Default=Undefined] optional Element element, | 138 CSSRuleList getMatchedCSSRules([Default=Undefined] optional Element element, |
139 [TreatNullAs=NullString, TreatUndefinedAs=Nul
lString,Default=Undefined] optional DOMString pseudoElement); | 139 [TreatNullAs=NullString, TreatUndefinedAs=Nul
lString,Default=Undefined] optional DOMString pseudoElement); |
140 | 140 |
141 [Replaceable] readonly attribute double devicePixelRatio; | 141 [Replaceable] readonly attribute double devicePixelRatio; |
142 | 142 |
143 WebKitPoint webkitConvertPointFromPageToNode([Default=Undefined] optional No
de node, | 143 WebKitPoint webkitConvertPointFromPageToNode([Default=Undefined] optional No
de node, |
144 [Default=Undefined] optional We
bKitPoint p); | 144 [Default=Undefined] optional We
bKitPoint p); |
145 WebKitPoint webkitConvertPointFromNodeToPage([Default=Undefined] optional No
de node, | 145 WebKitPoint webkitConvertPointFromNodeToPage([Default=Undefined] optional No
de node, |
146 [Default=Undefined] optional We
bKitPoint p); | 146 [Default=Undefined] optional We
bKitPoint p); |
147 | 147 |
148 [RuntimeEnabled=ApplicationCache, PerWorldBindings, ActivityLogging=GetterFo
rIsolatedWorlds] readonly attribute ApplicationCache applicationCache; | 148 [RuntimeEnabled=ApplicationCache, PerWorldBindings, ActivityLogging=GetterFo
rIsolatedWorlds] readonly attribute ApplicationCache applicationCache; |
149 | 149 |
150 [RuntimeEnabled=SessionStorage, PerWorldBindings, ActivityLogging=GetterForI
solatedWorlds, GetterRaisesException] readonly attribute Storage sessionStorage; | 150 [RuntimeEnabled=SessionStorage, PerWorldBindings, ActivityLogging=GetterForI
solatedWorlds, RaisesException=Getter] readonly attribute Storage sessionStorage
; |
151 [RuntimeEnabled=LocalStorage, PerWorldBindings, ActivityLogging=GetterForIso
latedWorlds, GetterRaisesException] readonly attribute Storage localStorage; | 151 [RuntimeEnabled=LocalStorage, PerWorldBindings, ActivityLogging=GetterForIso
latedWorlds, RaisesException=Getter] readonly attribute Storage localStorage; |
152 | 152 |
153 // This is the interface orientation in degrees. Some examples are: | 153 // This is the interface orientation in degrees. Some examples are: |
154 // 0 is straight up; -90 is when the device is rotated 90 clockwise; | 154 // 0 is straight up; -90 is when the device is rotated 90 clockwise; |
155 // 90 is when rotated counter clockwise. | 155 // 90 is when rotated counter clockwise. |
156 [Conditional=ORIENTATION_EVENTS] readonly attribute long orientation; | 156 [Conditional=ORIENTATION_EVENTS] readonly attribute long orientation; |
157 | 157 |
158 [Replaceable] readonly attribute Console console; | 158 [Replaceable] readonly attribute Console console; |
159 | 159 |
160 // cross-document messaging | 160 // cross-document messaging |
161 [DoNotCheckSecurity, Custom, RaisesException] void postMessage(SerializedScr
iptValue message, DOMString targetOrigin, optional Array messagePorts); | 161 [DoNotCheckSecurity, Custom, RaisesException] void postMessage(SerializedScr
iptValue message, DOMString targetOrigin, optional Array messagePorts); |
(...skipping 18 matching lines...) Expand all Loading... |
180 attribute EventHandler onsearch; | 180 attribute EventHandler onsearch; |
181 [RuntimeEnabled=Touch] attribute EventHandler ontouchcancel; | 181 [RuntimeEnabled=Touch] attribute EventHandler ontouchcancel; |
182 [RuntimeEnabled=Touch] attribute EventHandler ontouchend; | 182 [RuntimeEnabled=Touch] attribute EventHandler ontouchend; |
183 [RuntimeEnabled=Touch] attribute EventHandler ontouchmove; | 183 [RuntimeEnabled=Touch] attribute EventHandler ontouchmove; |
184 [RuntimeEnabled=Touch] attribute EventHandler ontouchstart; | 184 [RuntimeEnabled=Touch] attribute EventHandler ontouchstart; |
185 attribute EventHandler ontransitionend; | 185 attribute EventHandler ontransitionend; |
186 attribute EventHandler onwebkitanimationend; | 186 attribute EventHandler onwebkitanimationend; |
187 attribute EventHandler onwebkitanimationiteration; | 187 attribute EventHandler onwebkitanimationiteration; |
188 attribute EventHandler onwebkitanimationstart; | 188 attribute EventHandler onwebkitanimationstart; |
189 attribute EventHandler onwebkittransitionend; | 189 attribute EventHandler onwebkittransitionend; |
190 [ActivityLogging=SetterForAllWorlds] attribute EventHandler onwheel; | 190 [PerWorldBindings, ActivityLogging=SetterForIsolatedWorlds] attribute EventH
andler onwheel; |
191 | 191 |
192 [DeprecateAs=CaptureEvents] void captureEvents(); | 192 [DeprecateAs=CaptureEvents] void captureEvents(); |
193 [DeprecateAs=ReleaseEvents] void releaseEvents(); | 193 [DeprecateAs=ReleaseEvents] void releaseEvents(); |
194 | 194 |
195 // Additional constructors. | 195 // Additional constructors. |
196 attribute TransitionEventConstructor WebKitTransitionEvent; | 196 attribute TransitionEventConstructor WebKitTransitionEvent; |
197 [RuntimeEnabled=CSSAnimationUnprefixed] attribute WebKitAnimationEventConstr
uctor AnimationEvent; | 197 [RuntimeEnabled=CSSAnimationUnprefixed] attribute WebKitAnimationEventConstr
uctor AnimationEvent; |
198 // Mozilla has a separate XMLDocument object for XML documents. | 198 // Mozilla has a separate XMLDocument object for XML documents. |
199 // We just use Document for this. | 199 // We just use Document for this. |
200 attribute DocumentConstructor XMLDocument; | 200 attribute DocumentConstructor XMLDocument; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 | 234 |
235 [ImplementedAs=anonymousIndexedGetter, NotEnumerable] getter Window(unsigned
long index); | 235 [ImplementedAs=anonymousIndexedGetter, NotEnumerable] getter Window(unsigned
long index); |
236 [Custom, NotEnumerable] getter Window (DOMString name); | 236 [Custom, NotEnumerable] getter Window (DOMString name); |
237 }; | 237 }; |
238 | 238 |
239 Window implements GlobalEventHandlers; | 239 Window implements GlobalEventHandlers; |
240 Window implements ImageBitmapFactories; | 240 Window implements ImageBitmapFactories; |
241 Window implements WindowBase64; | 241 Window implements WindowBase64; |
242 Window implements WindowEventHandlers; | 242 Window implements WindowEventHandlers; |
243 Window implements WindowTimers; | 243 Window implements WindowTimers; |
OLD | NEW |