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] | |
30 [ | 29 [ |
31 CheckSecurity=Frame, | |
32 Custom=ToV8, | |
33 ImplementedAs=LocalDOMWindow, | 30 ImplementedAs=LocalDOMWindow, |
34 PrimaryGlobal, | |
35 ] interface Window : EventTarget { | 31 ] interface Window : EventTarget { |
36 readonly attribute Screen screen; | 32 readonly attribute Screen screen; |
37 [DoNotCheckSecurity, Unforgeable, Replaceable, PutForwards=href] readonly at
tribute Location location; | 33 [Replaceable, PutForwards=href] readonly attribute Location location; |
38 | 34 |
39 Selection getSelection(); | 35 Selection getSelection(); |
40 | 36 |
41 [DoNotCheckSecurity, CallWith=ExecutionContext] void focus(); | 37 void focus(); |
42 | 38 |
43 [Replaceable] readonly attribute long outerHeight; | 39 [Replaceable] readonly attribute long outerHeight; |
44 [Replaceable] readonly attribute long outerWidth; | 40 [Replaceable] readonly attribute long outerWidth; |
45 [Replaceable] readonly attribute long innerHeight; | 41 [Replaceable] readonly attribute long innerHeight; |
46 [Replaceable] readonly attribute long innerWidth; | 42 [Replaceable] readonly attribute long innerWidth; |
47 [Replaceable] readonly attribute long screenX; | 43 [Replaceable] readonly attribute long screenX; |
48 [Replaceable] readonly attribute long screenY; | 44 [Replaceable] readonly attribute long screenY; |
49 [Replaceable] readonly attribute long screenLeft; | 45 [Replaceable] readonly attribute long screenLeft; |
50 [Replaceable] readonly attribute long screenTop; | 46 [Replaceable] readonly attribute long screenTop; |
51 | 47 |
52 void moveBy([Default=Undefined] optional float x, [Default=Undefined] option
al float y); // FIXME: this should take longs not floats. | 48 void moveBy([Default=Undefined] optional float x, [Default=Undefined] option
al float y); // FIXME: this should take longs not floats. |
53 void moveTo([Default=Undefined] optional float x, [Default=Undefined] option
al float y); // FIXME: this should take longs not floats. | 49 void moveTo([Default=Undefined] optional float x, [Default=Undefined] option
al float y); // FIXME: this should take longs not floats. |
54 void resizeBy([Default=Undefined] optional float x, [Default=Undefined] opti
onal float y); // FIXME: this should take longs not floats. | 50 void resizeBy([Default=Undefined] optional float x, [Default=Undefined] opti
onal float y); // FIXME: this should take longs not floats. |
55 void resizeTo([Default=Undefined] optional float width, [Default=Undefined]
optional float height); // FIXME: this should take longs not floats. | 51 void resizeTo([Default=Undefined] optional float width, [Default=Undefined]
optional float height); // FIXME: this should take longs not floats. |
56 | 52 |
57 // Self referential attributes | 53 // Self referential attributes |
58 [DoNotCheckSecurity, Unforgeable] readonly attribute Window window; | 54 readonly attribute Window window; |
59 | 55 |
60 // DOM Level 2 AbstractView Interface | 56 // DOM Level 2 AbstractView Interface |
61 readonly attribute Document document; | 57 readonly attribute Document document; |
62 | 58 |
63 // CSSOM View Module | 59 // CSSOM View Module |
64 MediaQueryList matchMedia(DOMString query); | 60 MediaQueryList matchMedia(DOMString query); |
65 | 61 |
66 // DOM Level 2 Style Interface | 62 // DOM Level 2 Style Interface |
67 CSSStyleDeclaration getComputedStyle([Default=Undefined] optional Element el
ement); | 63 CSSStyleDeclaration getComputedStyle([Default=Undefined] optional Element el
ement); |
68 | 64 |
69 [Replaceable] readonly attribute double devicePixelRatio; | 65 [Replaceable] readonly attribute double devicePixelRatio; |
70 | 66 |
71 // This is the interface orientation in degrees. Some examples are: | 67 // This is the interface orientation in degrees. Some examples are: |
72 // 0 is straight up; -90 is when the device is rotated 90 clockwise; | 68 // 0 is straight up; -90 is when the device is rotated 90 clockwise; |
73 // 90 is when rotated counter clockwise. | 69 // 90 is when rotated counter clockwise. |
74 [RuntimeEnabled=OrientationEvent, MeasureAs=WindowOrientation] readonly attr
ibute long orientation; | 70 readonly attribute long orientation; |
75 | 71 |
76 [Replaceable] readonly attribute Console console; | 72 long requestAnimationFrame(RequestAnimationFrameCallback callback); |
77 | |
78 [MeasureAs=UnprefixedRequestAnimationFrame] long requestAnimationFrame(Reque
stAnimationFrameCallback callback); | |
79 void cancelAnimationFrame(long id); | 73 void cancelAnimationFrame(long id); |
80 | 74 |
81 [Replaceable] readonly attribute CSS CSS; | 75 [Replaceable] readonly attribute CSS CSS; |
82 | 76 |
83 // window.toString() requires special handling in V8 | |
84 [DoNotCheckSignature, DoNotCheckSecurity, Custom, NotEnumerable] stringifier
; | |
85 | |
86 // FIXME(sky): can't remove w/o also removing hacks in bindings generator. | 77 // FIXME(sky): can't remove w/o also removing hacks in bindings generator. |
87 [Custom, NotEnumerable] getter Window (DOMString name); | 78 [Custom, NotEnumerable] getter Window (DOMString name); |
88 }; | 79 }; |
89 | 80 |
90 Window implements WindowBase64; | 81 Window implements WindowBase64; |
91 Window implements WindowTimers; | 82 Window implements WindowTimers; |
OLD | NEW |