| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | |
| 3 * Copyright (C) 2011 Google Inc. All rights reserved. | |
| 4 * | |
| 5 * Redistribution and use in source and binary forms, with or without | |
| 6 * modification, are permitted provided that the following conditions | |
| 7 * are met: | |
| 8 * 1. Redistributions of source code must retain the above copyright | |
| 9 * notice, this list of conditions and the following disclaimer. | |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | |
| 11 * notice, this list of conditions and the following disclaimer in the | |
| 12 * documentation and/or other materials provided with the distribution. | |
| 13 * | |
| 14 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY | |
| 15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
| 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
| 17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR | |
| 18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | |
| 19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | |
| 20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | |
| 21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | |
| 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
| 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. | |
| 25 */ | |
| 26 | |
| 27 [ | |
| 28 CheckSecurity, | |
| 29 EventTarget, | |
| 30 CustomToV8, | |
| 31 DoNotGenerateWrap, | |
| 32 InterfaceName=Window | |
| 33 ] interface DOMWindow { | |
| 34 // DOM Level 0 | |
| 35 [Replaceable] readonly attribute Screen screen; | |
| 36 [Replaceable] readonly attribute History history; | |
| 37 [Replaceable] readonly attribute BarProp locationbar; | |
| 38 [Replaceable] readonly attribute BarProp menubar; | |
| 39 [Replaceable] readonly attribute BarProp personalbar; | |
| 40 [Replaceable] readonly attribute BarProp scrollbars; | |
| 41 [Replaceable] readonly attribute BarProp statusbar; | |
| 42 [Replaceable] readonly attribute BarProp toolbar; | |
| 43 [Replaceable, PerWorldBindings, ActivityLog=GetterForIsolatedWorlds] readonl
y attribute Navigator navigator; | |
| 44 [Replaceable] readonly attribute Navigator clientInformation; | |
| 45 readonly attribute Crypto crypto; | |
| 46 [DoNotCheckSecurity, CustomSetter, Unforgeable, Replaceable, PerWorldBinding
s, ActivityLog=AccessForIsolatedWorlds] readonly attribute Location location; | |
| 47 [MeasureAs=WindowEvent, NotEnumerable, Replaceable, CustomGetter, CustomSett
er] readonly attribute Event event; | |
| 48 | |
| 49 Selection getSelection(); | |
| 50 | |
| 51 [CheckSecurityForNode] readonly attribute Element frameElement; | |
| 52 | |
| 53 [DoNotCheckSecurity, CallWith=ScriptExecutionContext] void focus(); | |
| 54 [DoNotCheckSecurity] void blur(); | |
| 55 [DoNotCheckSecurity, CallWith=ScriptExecutionContext] void close(); | |
| 56 | |
| 57 void print(); | |
| 58 void stop(); | |
| 59 | |
| 60 [Custom] DOMWindow open(DOMString url, | |
| 61 DOMString name, | |
| 62 optional DOMString options); | |
| 63 | |
| 64 [Custom] any showModalDialog(DOMString url, | |
| 65 optional any dialogArgs, | |
| 66 optional DOMString featureArgs); | |
| 67 | |
| 68 void alert([Default=Undefined] optional DOMString message); | |
| 69 boolean confirm([Default=Undefined] optional DOMString message); | |
| 70 [TreatReturnedNullStringAs=Null] DOMString prompt([Default=Undefined] option
al DOMString message, | |
| 71 [TreatNullAs=NullString, TreatUn
definedAs=NullString,Default=Undefined] optional DOMString defaultValue); | |
| 72 | |
| 73 boolean find([Default=Undefined] optional DOMString string, | |
| 74 [Default=Undefined] optional boolean caseSensitive, | |
| 75 [Default=Undefined] optional boolean backwards, | |
| 76 [Default=Undefined] optional boolean wrap, | |
| 77 [Default=Undefined] optional boolean wholeWord, | |
| 78 [Default=Undefined] optional boolean searchInFrames, | |
| 79 [Default=Undefined] optional boolean showDialog); | |
| 80 | |
| 81 [Replaceable] readonly attribute boolean offscreenBuffering; | |
| 82 | |
| 83 [Replaceable] readonly attribute long outerHeight; | |
| 84 [Replaceable] readonly attribute long outerWidth; | |
| 85 [Replaceable] readonly attribute long innerHeight; | |
| 86 [Replaceable] readonly attribute long innerWidth; | |
| 87 [Replaceable] readonly attribute long screenX; | |
| 88 [Replaceable] readonly attribute long screenY; | |
| 89 [Replaceable] readonly attribute long screenLeft; | |
| 90 [Replaceable] readonly attribute long screenTop; | |
| 91 [Replaceable] readonly attribute long scrollX; | |
| 92 [Replaceable] readonly attribute long scrollY; | |
| 93 readonly attribute long pageXOffset; | |
| 94 readonly attribute long pageYOffset; | |
| 95 | |
| 96 void scrollBy([Default=Undefined] optional long x, [Default=Undefined] optio
nal long y); | |
| 97 void scrollTo([Default=Undefined] optional long x, [Default=Undefined] optio
nal long y); | |
| 98 void scroll([Default=Undefined] optional long x, [Default=Undefined] optiona
l long y); | |
| 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. | |
| 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. | |
| 103 | |
| 104 [DoNotCheckSecurity] readonly attribute boolean closed; | |
| 105 | |
| 106 [Replaceable, DoNotCheckSecurityOnGetter] readonly attribute unsigned long l
ength; | |
| 107 | |
| 108 attribute DOMString name; | |
| 109 | |
| 110 attribute DOMString status; | |
| 111 attribute DOMString defaultStatus; | |
| 112 // This attribute is an alias of defaultStatus and is necessary for legacy u
ses. | |
| 113 attribute DOMString defaultstatus; | |
| 114 | |
| 115 // Self referential attributes | |
| 116 [Replaceable, DoNotCheckSecurityOnGetter] readonly attribute DOMWindow self; | |
| 117 [DoNotCheckSecurity, Unforgeable] readonly attribute DOMWindow window; | |
| 118 [Replaceable, DoNotCheckSecurityOnGetter] readonly attribute DOMWindow fram
es; | |
| 119 | |
| 120 [Replaceable, DoNotCheckSecurityOnGetter, CustomSetter] readonly attribute D
OMWindow opener; | |
| 121 [Replaceable, DoNotCheckSecurityOnGetter] readonly attribute DOMWindow paren
t; | |
| 122 [DoNotCheckSecurityOnGetter, Unforgeable] readonly attribute DOMWindow top; | |
| 123 | |
| 124 // DOM Level 2 AbstractView Interface | |
| 125 readonly attribute Document document; | |
| 126 | |
| 127 // CSSOM View Module | |
| 128 MediaQueryList matchMedia(DOMString query); | |
| 129 | |
| 130 // styleMedia has been removed from the CSSOM View specification. | |
| 131 readonly attribute StyleMedia styleMedia; | |
| 132 | |
| 133 // DOM Level 2 Style Interface | |
| 134 [PerWorldBindings] CSSStyleDeclaration getComputedStyle([Default=Undefined]
optional Element element, | |
| 135 [TreatNullAs=NullS
tring, TreatUndefinedAs=NullString,Default=Undefined] optional DOMString pseudoE
lement); | |
| 136 | |
| 137 // WebKit extensions | |
| 138 CSSRuleList getMatchedCSSRules([Default=Undefined] optional Element element, | |
| 139 [TreatNullAs=NullString, TreatUndefinedAs=Nul
lString,Default=Undefined] optional DOMString pseudoElement); | |
| 140 | |
| 141 [Replaceable] readonly attribute double devicePixelRatio; | |
| 142 | |
| 143 DOMPoint webkitConvertPointFromPageToNode([Default=Undefined] optional Node
node, | |
| 144 [Default=Undefined] optional DOMPo
int p); | |
| 145 DOMPoint webkitConvertPointFromNodeToPage([Default=Undefined] optional Node
node, | |
| 146 [Default=Undefined] optional DOMPo
int p); | |
| 147 | |
| 148 [EnabledAtRuntime, PerWorldBindings, ActivityLog=GetterForIsolatedWorlds] re
adonly attribute DOMApplicationCache applicationCache; | |
| 149 | |
| 150 [EnabledAtRuntime, PerWorldBindings, ActivityLog=GetterForIsolatedWorlds, Ge
tterRaisesException] readonly attribute Storage sessionStorage; | |
| 151 [EnabledAtRuntime, PerWorldBindings, ActivityLog=GetterForIsolatedWorlds, Ge
tterRaisesException] readonly attribute Storage localStorage; | |
| 152 | |
| 153 #if defined(ENABLE_ORIENTATION_EVENTS) && ENABLE_ORIENTATION_EVENTS | |
| 154 // This is the interface orientation in degrees. Some examples are: | |
| 155 // 0 is straight up; -90 is when the device is rotated 90 clockwise; | |
| 156 // 90 is when rotated counter clockwise. | |
| 157 readonly attribute long orientation; | |
| 158 #endif | |
| 159 | |
| 160 [Replaceable] readonly attribute Console console; | |
| 161 | |
| 162 // cross-document messaging | |
| 163 [DoNotCheckSecurity, Custom, RaisesException] void postMessage(SerializedScr
iptValue message, DOMString targetOrigin, optional Array messagePorts); | |
| 164 | |
| 165 [Replaceable] readonly attribute Performance performance; | |
| 166 | |
| 167 // Timers | |
| 168 [Custom] long setTimeout(any handler, [Default=Undefined] optional long time
out); | |
| 169 void clearTimeout([Default=Undefined] optional long handle); | |
| 170 [Custom] long setInterval(any handler, [Default=Undefined] optional long tim
eout); | |
| 171 void clearInterval([Default=Undefined] optional long handle); | |
| 172 | |
| 173 [MeasureAs=UnprefixedRequestAnimationFrame] long requestAnimationFrame(Reque
stAnimationFrameCallback callback); | |
| 174 void cancelAnimationFrame(long id); | |
| 175 [MeasureAs=PrefixedRequestAnimationFrame] long webkitRequestAnimationFrame(R
equestAnimationFrameCallback callback); | |
| 176 [ImplementedAs=cancelAnimationFrame] void webkitCancelAnimationFrame(long id
); | |
| 177 [ImplementedAs=cancelAnimationFrame] void webkitCancelRequestAnimationFrame(
long id); // This is a deprecated alias for webkitCancelAnimationFrame(). Remove
this when removing vendor prefix. | |
| 178 | |
| 179 // Base64 | |
| 180 [RaisesException] DOMString atob([TreatNullAs=NullString,Default=Undefined]
optional DOMString string); | |
| 181 [RaisesException] DOMString btoa([TreatNullAs=NullString,Default=Undefined]
optional DOMString string); | |
| 182 | |
| 183 [Replaceable] readonly attribute CSS CSS; | |
| 184 | |
| 185 // Events | |
| 186 attribute EventListener onabort; | |
| 187 attribute EventListener onbeforeunload; | |
| 188 attribute EventListener onblur; | |
| 189 attribute EventListener oncanplay; | |
| 190 attribute EventListener oncanplaythrough; | |
| 191 attribute EventListener onchange; | |
| 192 attribute EventListener onclick; | |
| 193 attribute EventListener oncontextmenu; | |
| 194 attribute EventListener ondblclick; | |
| 195 attribute EventListener ondrag; | |
| 196 attribute EventListener ondragend; | |
| 197 attribute EventListener ondragenter; | |
| 198 attribute EventListener ondragleave; | |
| 199 attribute EventListener ondragover; | |
| 200 attribute EventListener ondragstart; | |
| 201 attribute EventListener ondrop; | |
| 202 attribute EventListener ondurationchange; | |
| 203 attribute EventListener onemptied; | |
| 204 attribute EventListener onended; | |
| 205 attribute EventListener onerror; | |
| 206 attribute EventListener onfocus; | |
| 207 attribute EventListener onhashchange; | |
| 208 attribute EventListener oninput; | |
| 209 attribute EventListener oninvalid; | |
| 210 attribute EventListener onkeydown; | |
| 211 attribute EventListener onkeypress; | |
| 212 attribute EventListener onkeyup; | |
| 213 attribute EventListener onload; | |
| 214 attribute EventListener onloadeddata; | |
| 215 attribute EventListener onloadedmetadata; | |
| 216 attribute EventListener onloadstart; | |
| 217 attribute EventListener onmessage; | |
| 218 attribute EventListener onmousedown; | |
| 219 attribute EventListener onmousemove; | |
| 220 attribute EventListener onmouseout; | |
| 221 attribute EventListener onmouseover; | |
| 222 attribute EventListener onmouseup; | |
| 223 attribute EventListener onmousewheel; | |
| 224 attribute EventListener onoffline; | |
| 225 attribute EventListener ononline; | |
| 226 attribute EventListener onpagehide; | |
| 227 attribute EventListener onpageshow; | |
| 228 attribute EventListener onpause; | |
| 229 attribute EventListener onplay; | |
| 230 attribute EventListener onplaying; | |
| 231 attribute EventListener onpopstate; | |
| 232 attribute EventListener onprogress; | |
| 233 attribute EventListener onratechange; | |
| 234 attribute EventListener onresize; | |
| 235 attribute EventListener onscroll; | |
| 236 attribute EventListener onseeked; | |
| 237 attribute EventListener onseeking; | |
| 238 attribute EventListener onselect; | |
| 239 attribute EventListener onstalled; | |
| 240 attribute EventListener onstorage; | |
| 241 attribute EventListener onsubmit; | |
| 242 attribute EventListener onsuspend; | |
| 243 attribute EventListener ontimeupdate; | |
| 244 attribute EventListener onunload; | |
| 245 attribute EventListener onvolumechange; | |
| 246 attribute EventListener onwaiting; | |
| 247 | |
| 248 // Not implemented yet. | |
| 249 // attribute EventListener onafterprint; | |
| 250 // attribute EventListener onbeforeprint; | |
| 251 // attribute EventListener onreadystatechange; | |
| 252 // attribute EventListener onredo; | |
| 253 // attribute EventListener onshow; | |
| 254 // attribute EventListener onundo; | |
| 255 | |
| 256 // Webkit extensions | |
| 257 attribute EventListener onreset; | |
| 258 attribute EventListener onsearch; | |
| 259 attribute EventListener onwebkitanimationend; | |
| 260 attribute EventListener onwebkitanimationiteration; | |
| 261 attribute EventListener onwebkitanimationstart; | |
| 262 attribute EventListener onwebkittransitionend; | |
| 263 attribute EventListener ontransitionend; | |
| 264 #if defined(ENABLE_ORIENTATION_EVENTS) && ENABLE_ORIENTATION_EVENTS | |
| 265 attribute EventListener onorientationchange; | |
| 266 #endif | |
| 267 [EnabledAtRuntime=touch] attribute EventListener ontouchstart; | |
| 268 [EnabledAtRuntime=touch] attribute EventListener ontouchmove; | |
| 269 [EnabledAtRuntime=touch] attribute EventListener ontouchend; | |
| 270 [EnabledAtRuntime=touch] attribute EventListener ontouchcancel; | |
| 271 | |
| 272 [EnabledAtRuntime=deviceMotion] attribute EventListener ondevicemotion; | |
| 273 [EnabledAtRuntime=deviceOrientation] attribute EventListener ondeviceorienta
tion; | |
| 274 | |
| 275 // EventTarget interface | |
| 276 [Custom] void addEventListener(DOMString type, | |
| 277 EventListener listener, | |
| 278 optional boolean useCapture); | |
| 279 [Custom] void removeEventListener(DOMString type, | |
| 280 EventListener listener, | |
| 281 optional boolean useCapture); | |
| 282 [RaisesException] boolean dispatchEvent(Event evt); | |
| 283 | |
| 284 // Additional constructors. | |
| 285 attribute TransitionEventConstructor WebKitTransitionEvent; | |
| 286 [CustomConstructor] attribute HTMLImageElementConstructorConstructor Image;
// Usable with new operator | |
| 287 // Mozilla has a separate XMLDocument object for XML documents. | |
| 288 // We just use Document for this. | |
| 289 attribute DocumentConstructor XMLDocument; | |
| 290 attribute URLConstructor webkitURL; // FIXME: deprecate this. | |
| 291 attribute MutationObserverConstructor WebKitMutationObserver; // FIXME: Add
metrics to determine when we can remove this. | |
| 292 attribute IDBCursorConstructor webkitIDBCursor; | |
| 293 attribute IDBDatabaseConstructor webkitIDBDatabase; | |
| 294 attribute IDBFactoryConstructor webkitIDBFactory; | |
| 295 attribute IDBIndexConstructor webkitIDBIndex; | |
| 296 attribute IDBKeyRangeConstructor webkitIDBKeyRange; | |
| 297 attribute IDBObjectStoreConstructor webkitIDBObjectStore; | |
| 298 attribute IDBRequestConstructor webkitIDBRequest; | |
| 299 attribute IDBTransactionConstructor webkitIDBTransaction; | |
| 300 | |
| 301 // Constructors enabled at runtime but whose interface does not have Enabled
AtRuntime | |
| 302 // extended attribute. | |
| 303 // FIXME: Remove these. | |
| 304 [EnabledAtRuntime=media] attribute MediaErrorConstructor MediaError; | |
| 305 [EnabledAtRuntime=media] attribute TimeRangesConstructor TimeRanges; | |
| 306 [EnabledAtRuntime=media] attribute HTMLSourceElementConstructor HTMLSourceEl
ement; | |
| 307 [EnabledAtRuntime=media] attribute MediaControllerConstructor MediaControlle
r; | |
| 308 [EnabledAtRuntime=deviceMotion] attribute DeviceMotionEventConstructor Devic
eMotionEvent; | |
| 309 [EnabledAtRuntime=touch] attribute TouchConstructor Touch; | |
| 310 [EnabledAtRuntime=touch] attribute TouchEventConstructor TouchEvent; | |
| 311 [EnabledAtRuntime=touch] attribute TouchListConstructor TouchList; | |
| 312 [EnabledAtRuntime=webMIDI] attribute MIDIConnectionEventConstructor MIDIConn
ectionEvent; | |
| 313 [EnabledAtRuntime=webMIDI] attribute MIDIMessageEventConstructor MIDIMessage
Event; | |
| 314 [EnabledAtRuntime=mediaStream] attribute MediaStreamConstructor webkitMediaS
tream; | |
| 315 [Conditional=WEB_AUDIO, EnabledAtRuntime=WebAudio] attribute AudioContextCon
structor webkitAudioContext; | |
| 316 [Conditional=WEB_AUDIO, EnabledAtRuntime=WebAudio] attribute OfflineAudioCon
textConstructor webkitOfflineAudioContext; | |
| 317 [EnabledAtRuntime=peerConnection] attribute RTCPeerConnectionConstructor web
kitRTCPeerConnection; | |
| 318 [EnabledAtRuntime=experimentalContentSecurityPolicyFeatures] attribute Secur
ityPolicyViolationEventConstructor SecurityPolicyViolationEvent; | |
| 319 [EnabledAtRuntime] attribute SharedWorkerConstructor SharedWorker; // Usable
with the new operator | |
| 320 [EnabledAtRuntime=scriptedSpeech] attribute SpeechGrammarConstructor webkitS
peechGrammar; | |
| 321 [EnabledAtRuntime=scriptedSpeech] attribute SpeechGrammarListConstructor web
kitSpeechGrammarList; | |
| 322 [EnabledAtRuntime=scriptedSpeech] attribute SpeechRecognitionConstructor web
kitSpeechRecognition; | |
| 323 [EnabledAtRuntime=scriptedSpeech] attribute SpeechRecognitionErrorConstructo
r webkitSpeechRecognitionError; | |
| 324 [EnabledAtRuntime=scriptedSpeech] attribute SpeechRecognitionEventConstructo
r webkitSpeechRecognitionEvent; | |
| 325 | |
| 326 // Constructors whose name does not match the interface name. | |
| 327 // FIXME: Remove these once [ImplementedAs] is used and once constructor nam
es match interface names. | |
| 328 attribute ShadowRootConstructor WebKitShadowRoot; | |
| 329 [Conditional=WEB_AUDIO] attribute PannerNodeConstructor webkitAudioPannerNod
e; | |
| 330 | |
| 331 // window.toString() requires special handling in V8 | |
| 332 [DoNotCheckSignature, DoNotCheckSecurity, Custom, NotEnumerable] DOMString t
oString(); | |
| 333 | |
| 334 [ImplementedAs=anonymousIndexedGetter, NotEnumerable] getter DOMWindow(unsig
ned long index); | |
| 335 [Custom, NotEnumerable] getter DOMWindow (DOMString name); | |
| 336 }; | |
| 337 | |
| OLD | NEW |