Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Side by Side Diff: Source/core/frame/Window.idl

Issue 984943002: Sync the Window interface with the many specs (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/frame/UseCounter.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 16 matching lines...) Expand all
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=Frame,
32 Custom=ToV8, 32 Custom=ToV8,
33 ImplementedAs=DOMWindow, 33 ImplementedAs=DOMWindow,
34 PrimaryGlobal, 34 PrimaryGlobal,
35 ] interface Window : EventTarget { 35 ] interface Window : EventTarget {
36 // the current browsing context 36 // the current browsing context
37 [DoNotCheckSecurity, Unforgeable] readonly attribute Window window; 37 // FIXME: The spec uses the WindowProxy type for this and many other attribu tes.
38 [Unforgeable, DoNotCheckSecurity] readonly attribute Window window;
38 [Replaceable, DoNotCheckSecurity] readonly attribute Window self; 39 [Replaceable, DoNotCheckSecurity] readonly attribute Window self;
40 // FIXME: document should be [Unforgeable].
haraken 2015/03/06 12:47:58 shiino-san: We should add [Unforgeable] in a follo
Yuki 2015/03/06 13:30:06 Good to know. By the way, why don't we make docum
39 readonly attribute Document document; 41 readonly attribute Document document;
40 attribute DOMString name; 42 attribute DOMString name;
41 [DoNotCheckSecurity, PutForwards=href, Unforgeable] readonly attribute Locat ion location; 43 [PutForwards=href, Unforgeable, DoNotCheckSecurity] readonly attribute Locat ion location;
42 readonly attribute History history; 44 readonly attribute History history;
43 [Replaceable, MeasureAs=BarPropLocationbar] readonly attribute BarProp locat ionbar; 45 [Replaceable, MeasureAs=BarPropLocationbar] readonly attribute BarProp locat ionbar;
44 [Replaceable, MeasureAs=BarPropMenubar] readonly attribute BarProp menubar; 46 [Replaceable, MeasureAs=BarPropMenubar] readonly attribute BarProp menubar;
45 [Replaceable, MeasureAs=BarPropPersonalbar] readonly attribute BarProp perso nalbar; 47 [Replaceable, MeasureAs=BarPropPersonalbar] readonly attribute BarProp perso nalbar;
46 [Replaceable, MeasureAs=BarPropScrollbars] readonly attribute BarProp scroll bars; 48 [Replaceable, MeasureAs=BarPropScrollbars] readonly attribute BarProp scroll bars;
47 [Replaceable, MeasureAs=BarPropStatusbar] readonly attribute BarProp statusb ar; 49 [Replaceable, MeasureAs=BarPropStatusbar] readonly attribute BarProp statusb ar;
48 [Replaceable, MeasureAs=BarPropToolbar] readonly attribute BarProp toolbar; 50 [Replaceable, MeasureAs=BarPropToolbar] readonly attribute BarProp toolbar;
49 attribute DOMString status; 51 attribute DOMString status;
50 [DoNotCheckSecurity, CallWith=ExecutionContext] void close(); 52 [DoNotCheckSecurity, CallWith=ExecutionContext] void close();
51 [DoNotCheckSecurity] readonly attribute boolean closed; 53 [DoNotCheckSecurity] readonly attribute boolean closed;
52 void stop(); 54 void stop();
53 [DoNotCheckSecurity, CallWith=ExecutionContext] void focus(); 55 [DoNotCheckSecurity, CallWith=ExecutionContext] void focus();
54 [DoNotCheckSecurity] void blur(); 56 [DoNotCheckSecurity] void blur();
55 57
56 // other browsing contexts 58 // other browsing contexts
57 [Replaceable, DoNotCheckSecurity] readonly attribute Window frames; 59 [Replaceable, DoNotCheckSecurity] readonly attribute Window frames;
58 [Replaceable, DoNotCheckSecurity] readonly attribute unsigned long length; 60 [Replaceable, DoNotCheckSecurity] readonly attribute unsigned long length;
59 [DoNotCheckSecurity, Unforgeable] readonly attribute Window top; 61 [Unforgeable, DoNotCheckSecurity] readonly attribute Window top;
62 // FIXME: opener should be of type any.
60 [DoNotCheckSecurity, Custom=Setter] attribute Window opener; 63 [DoNotCheckSecurity, Custom=Setter] attribute Window opener;
61 [Replaceable, DoNotCheckSecurity] readonly attribute Window parent; 64 [Replaceable, DoNotCheckSecurity] readonly attribute Window parent;
62 [CheckSecurity=Node, Custom=Getter] readonly attribute Element frameElement; 65 [CheckSecurity=Node, Custom=Getter] readonly attribute Element? frameElement ;
63 [Custom] Window open(DOMString url, 66 // FIXME: open() should have 4 optional arguments with defaults.
64 DOMString name, 67 [Custom] Window open(DOMString url, DOMString target, optional DOMString fea tures);
65 optional DOMString options); 68 // FIXME: These getters should not have [NotEnumerable].
66 [NotEnumerable, DoNotCheckSecurity] getter Window (unsigned long index); 69 [NotEnumerable, DoNotCheckSecurity] getter Window (unsigned long index);
67 [Custom, NotEnumerable, DoNotCheckSecurity] getter Window (DOMString name); 70 [Custom, NotEnumerable, DoNotCheckSecurity] getter object (DOMString name);
68 71
69 // the user agent 72 // the user agent
70 [LogActivity=GetterOnly] readonly attribute Navigator navigator; 73 [LogActivity=GetterOnly] readonly attribute Navigator navigator;
71 [RuntimeEnabled=ApplicationCache, LogActivity=GetterOnly] readonly attribute ApplicationCache applicationCache; 74 [RuntimeEnabled=ApplicationCache, LogActivity=GetterOnly] readonly attribute ApplicationCache applicationCache;
72 75
73 // user prompts 76 // user prompts
74 void alert(); 77 void alert();
75 void alert(DOMString message); 78 void alert(DOMString message);
76 boolean confirm(optional DOMString message = ""); 79 boolean confirm(optional DOMString message = "");
77 DOMString? prompt(optional DOMString message = "", 80 DOMString? prompt(optional DOMString message = "", optional DOMString defaul tValue = "");
78 optional DOMString defaultValue = "");
79 void print(); 81 void print();
80 82
83 // FIXME: requestAnimationFrame should take a FrameRequestCallback:
84 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=28152
81 [MeasureAs=UnprefixedRequestAnimationFrame] long requestAnimationFrame(Reque stAnimationFrameCallback callback); 85 [MeasureAs=UnprefixedRequestAnimationFrame] long requestAnimationFrame(Reque stAnimationFrameCallback callback);
82 void cancelAnimationFrame(long id); 86 void cancelAnimationFrame(long handle);
83 87
84 [DoNotCheckSecurity, Custom, RaisesException] void postMessage(SerializedScr iptValue message, DOMString targetOrigin, optional sequence<Transferable> transf er); 88 [DoNotCheckSecurity, Custom, RaisesException] void postMessage(any message, DOMString targetOrigin, optional sequence<Transferable> transfer);
85 89
86 // HTML obsolete features 90 // HTML obsolete features
87 // https://html.spec.whatwg.org/#Window-partial 91 // https://html.spec.whatwg.org/#Window-partial
88 [MeasureAs=WindowCaptureEvents] void captureEvents(); 92 [MeasureAs=WindowCaptureEvents] void captureEvents();
89 [MeasureAs=WindowReleaseEvents] void releaseEvents(); 93 [MeasureAs=WindowReleaseEvents] void releaseEvents();
90 94
91 // CSS Object Model (CSSOM) 95 // CSS Object Model (CSSOM)
92 // http://dev.w3.org/csswg/cssom/#extensions-to-the-window-interface 96 // http://dev.w3.org/csswg/cssom/#extensions-to-the-window-interface
93 [TypeChecking=Interface] CSSStyleDeclaration getComputedStyle(Element elemen t, optional DOMString? pseudoElt = null); 97 // FIXME: The optional pseudoElt argument should have no default.
98 [TypeChecking=Interface] CSSStyleDeclaration getComputedStyle(Element elt, o ptional DOMString? pseudoElt = null);
94 // http://dev.w3.org/csswg/cssom/#utility-apis 99 // http://dev.w3.org/csswg/cssom/#utility-apis
100 // FIXME: CSS should be an interface with static members, in which
101 // case this getter would not be needed.
95 [Replaceable] readonly attribute CSS CSS; 102 [Replaceable] readonly attribute CSS CSS;
96 103
97 // CSSOM View Module 104 // CSSOM View Module
98 // http://dev.w3.org/csswg/cssom-view/#extensions-to-the-window-interface 105 // http://dev.w3.org/csswg/cssom-view/#extensions-to-the-window-interface
99 MediaQueryList matchMedia(DOMString query); 106 MediaQueryList matchMedia(DOMString query);
100 readonly attribute Screen screen; 107 readonly attribute Screen screen;
101 108
102 // browsing context 109 // browsing context
103 void moveTo(optional long x, optional long y); // FIXME: Arguments should no t be optional, or should have defaults. 110 // FIXME: The x and y arguments should not be optional. crbug.com/453421
111 void moveTo(optional long x, optional long y);
104 void moveBy(optional long x, optional long y); 112 void moveBy(optional long x, optional long y);
105 void resizeTo(optional long width, optional long height); // FIXME: Argument s should not be optional, or should have defaults. 113 void resizeTo(optional long x, optional long y);
106 void resizeBy(optional long x, optional long y); 114 void resizeBy(optional long x, optional long y);
107 115
108 // viewport 116 // viewport
117 // FIXME: None of the CCSOM View Module attributes should be [Replaceable].
109 [Replaceable] readonly attribute long innerWidth; 118 [Replaceable] readonly attribute long innerWidth;
110 [Replaceable] readonly attribute long innerHeight; 119 [Replaceable] readonly attribute long innerHeight;
111 120
112 // viewport scrolling 121 // viewport scrolling
113 [Replaceable] readonly attribute double scrollX; 122 [Replaceable] readonly attribute double scrollX;
114 readonly attribute double pageXOffset; 123 readonly attribute double pageXOffset;
115 [Replaceable] readonly attribute double scrollY; 124 [Replaceable] readonly attribute double scrollY;
116 readonly attribute double pageYOffset; 125 readonly attribute double pageYOffset;
117 [RuntimeEnabled=CSSOMSmoothScroll] void scroll([Default=Undefined] optional ScrollToOptions scrollOptions); 126 [RuntimeEnabled=CSSOMSmoothScroll] void scroll(optional ScrollToOptions opti ons);
118 void scroll(unrestricted double x, unrestricted double y); 127 void scroll(unrestricted double x, unrestricted double y);
119 [RuntimeEnabled=CSSOMSmoothScroll] void scrollTo([Default=Undefined] optiona l ScrollToOptions scrollToOptions); 128 [RuntimeEnabled=CSSOMSmoothScroll] void scrollTo(optional ScrollToOptions op tions);
120 void scrollTo(unrestricted double x, unrestricted double y); 129 void scrollTo(unrestricted double x, unrestricted double y);
121 [RuntimeEnabled=CSSOMSmoothScroll] void scrollBy([Default=Undefined] optiona l ScrollToOptions scrollToOptions); 130 [RuntimeEnabled=CSSOMSmoothScroll] void scrollBy(optional ScrollToOptions op tions);
122 void scrollBy(unrestricted double x, unrestricted double y); 131 void scrollBy(unrestricted double x, unrestricted double y);
123 132
124 // client 133 // client
125 [Replaceable] readonly attribute long screenX; 134 [Replaceable] readonly attribute long screenX;
126 [Replaceable] readonly attribute long screenY; 135 [Replaceable] readonly attribute long screenY;
127 [Replaceable] readonly attribute long outerWidth; 136 [Replaceable] readonly attribute long outerWidth;
128 [Replaceable] readonly attribute long outerHeight; 137 [Replaceable] readonly attribute long outerHeight;
129 [Replaceable] readonly attribute double devicePixelRatio; 138 [Replaceable] readonly attribute double devicePixelRatio;
130 139
131 // Selection API 140 // Selection API
132 // http://w3c.github.io/selection-api/#extensions-to-window-interface 141 // http://w3c.github.io/selection-api/#extensions-to-window-interface
133 Selection getSelection(); 142 Selection? getSelection();
134 143
135 // Console API (non-standard but widely implemented in some form) 144 // Console API (non-standard but widely implemented in some form)
136 // https://developer.chrome.com/devtools/docs/console-api 145 // https://developer.chrome.com/devtools/docs/console-api
137 [Replaceable] readonly attribute Console console; 146 [Replaceable] readonly attribute Console console;
138 147
139 // Non-standard APIs 148 // Non-standard APIs
140 [Replaceable] readonly attribute Navigator clientInformation; 149 [MeasureAs=WindowClientInformation, Replaceable] readonly attribute Navigato r clientInformation;
141 [Custom, MeasureAs=WindowEvent, NotEnumerable] attribute Event event; 150 [MeasureAs=WindowEvent, Custom, NotEnumerable] attribute Event event;
142 boolean find([Default=Undefined] optional DOMString string, 151 [MeasureAs=WindowFind] boolean find([Default=Undefined] optional DOMString s tring,
143 [Default=Undefined] optional boolean caseSensitive, 152 [Default=Undefined] optional boolean cas eSensitive,
144 [Default=Undefined] optional boolean backwards, 153 [Default=Undefined] optional boolean bac kwards,
145 [Default=Undefined] optional boolean wrap, 154 [Default=Undefined] optional boolean wra p,
146 [Default=Undefined] optional boolean wholeWord, 155 [Default=Undefined] optional boolean who leWord,
147 [Default=Undefined] optional boolean searchInFrames, 156 [Default=Undefined] optional boolean sea rchInFrames,
148 [Default=Undefined] optional boolean showDialog); 157 [Default=Undefined] optional boolean sho wDialog);
149 [Replaceable, MeasureAs=WindowOffscreenBuffering, NotEnumerable] readonly at tribute boolean offscreenBuffering; 158 [MeasureAs=WindowOffscreenBuffering, Replaceable, NotEnumerable] readonly at tribute boolean offscreenBuffering;
150 [Replaceable] readonly attribute long screenLeft; 159 [MeasureAs=WindowScreenLeft, Replaceable] readonly attribute long screenLeft ;
151 [Replaceable] readonly attribute long screenTop; 160 [MeasureAs=WindowScreenTop, Replaceable] readonly attribute long screenTop;
152 [MeasureAs=WindowDefaultStatus] attribute DOMString defaultStatus; 161 [MeasureAs=WindowDefaultStatus] attribute DOMString defaultStatus;
153 [ImplementedAs=defaultStatus, MeasureAs=WindowDefaultstatus] attribute DOMSt ring defaultstatus; 162 [MeasureAs=WindowDefaultstatus, ImplementedAs=defaultStatus] attribute DOMSt ring defaultstatus;
154 [MeasureAs=StyleMedia] readonly attribute StyleMedia styleMedia; 163 [MeasureAs=StyleMedia] readonly attribute StyleMedia styleMedia;
155 [DeprecateAs=GetMatchedCSSRules] CSSRuleList getMatchedCSSRules([Default=Und efined] optional Element element, 164 [DeprecateAs=GetMatchedCSSRules] CSSRuleList getMatchedCSSRules([Default=Und efined] optional Element element,
156 [TreatUndefi nedAs=NullString, Default=Undefined] optional DOMString? pseudoElement); 165 [TreatUndefi nedAs=NullString, Default=Undefined] optional DOMString? pseudoElement);
157 // This is the interface orientation in degrees. Some examples are: 166 // This is the interface orientation in degrees. Some examples are:
158 // 0 is straight up; -90 is when the device is rotated 90 clockwise; 167 // 0 is straight up; -90 is when the device is rotated 90 clockwise;
159 // 90 is when rotated counter clockwise. 168 // 90 is when rotated counter clockwise.
160 [RuntimeEnabled=OrientationEvent, MeasureAs=WindowOrientation] readonly attr ibute long orientation; 169 [MeasureAs=WindowOrientation, RuntimeEnabled=OrientationEvent] readonly attr ibute long orientation;
161 [DeprecateAs=PrefixedRequestAnimationFrame] long webkitRequestAnimationFrame (RequestAnimationFrameCallback callback); 170 [DeprecateAs=PrefixedRequestAnimationFrame] long webkitRequestAnimationFrame (RequestAnimationFrameCallback callback);
162 [DeprecateAs=PrefixedCancelAnimationFrame, ImplementedAs=cancelAnimationFram e] void webkitCancelAnimationFrame(long id); 171 [DeprecateAs=PrefixedCancelAnimationFrame, ImplementedAs=cancelAnimationFram e] void webkitCancelAnimationFrame(long id);
163 [DeprecateAs=PrefixedCancelRequestAnimationFrame, ImplementedAs=cancelAnimat ionFrame] void webkitCancelRequestAnimationFrame(long id); 172 [DeprecateAs=PrefixedCancelRequestAnimationFrame, ImplementedAs=cancelAnimat ionFrame] void webkitCancelRequestAnimationFrame(long id);
164 [MeasureAs=PrefixedTransitionEventConstructor] attribute TransitionEventCons tructor WebKitTransitionEvent; 173 [MeasureAs=PrefixedTransitionEventConstructor] attribute TransitionEventCons tructor WebKitTransitionEvent;
174 // FIXME: Reverse this to make WebKitAnimationEvent an alias of AnimationEve nt instead.
165 [RuntimeEnabled=CSSAnimationUnprefixed] attribute WebKitAnimationEventConstr uctor AnimationEvent; 175 [RuntimeEnabled=CSSAnimationUnprefixed] attribute WebKitAnimationEventConstr uctor AnimationEvent;
166 [DeprecateAs=PrefixedWindowURL] attribute URLConstructor webkitURL; 176 [DeprecateAs=PrefixedWindowURL] attribute URLConstructor webkitURL;
167 [MeasureAs=PrefixedMutationObserverConstructor] attribute MutationObserverCo nstructor WebKitMutationObserver; 177 [MeasureAs=PrefixedMutationObserverConstructor] attribute MutationObserverCo nstructor WebKitMutationObserver;
168 178
169 // Event handler attributes 179 // Event handler attributes
170 [RuntimeEnabled=CSSAnimationUnprefixed] attribute EventHandler onanimationen d; 180 [RuntimeEnabled=CSSAnimationUnprefixed] attribute EventHandler onanimationen d;
171 [RuntimeEnabled=CSSAnimationUnprefixed] attribute EventHandler onanimationit eration; 181 [RuntimeEnabled=CSSAnimationUnprefixed] attribute EventHandler onanimationit eration;
172 [RuntimeEnabled=CSSAnimationUnprefixed] attribute EventHandler onanimationst art; 182 [RuntimeEnabled=CSSAnimationUnprefixed] attribute EventHandler onanimationst art;
173 [RuntimeEnabled=OrientationEvent] attribute EventHandler onorientationchange ; 183 [RuntimeEnabled=OrientationEvent] attribute EventHandler onorientationchange ;
174 attribute EventHandler onsearch; 184 attribute EventHandler onsearch;
(...skipping 24 matching lines...) Expand all
199 // FIXME: make this typedef accurate once enough of http://crbug.com/240176 209 // FIXME: make this typedef accurate once enough of http://crbug.com/240176
200 // is in place. 210 // is in place.
201 // FIXME: consider putting this typedef in an .idl file containing spec-wide 211 // FIXME: consider putting this typedef in an .idl file containing spec-wide
202 // utility type definitions. 212 // utility type definitions.
203 typedef MessagePort Transferable; 213 typedef MessagePort Transferable;
204 214
205 Window implements GlobalEventHandlers; 215 Window implements GlobalEventHandlers;
206 Window implements WindowBase64; 216 Window implements WindowBase64;
207 Window implements WindowEventHandlers; 217 Window implements WindowEventHandlers;
208 Window implements WindowTimers; 218 Window implements WindowTimers;
OLDNEW
« no previous file with comments | « Source/core/frame/UseCounter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698