OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 typedef void LayoutCallback(); | |
6 typedef LayoutCallback MeasurementCallback(); | |
7 | |
8 interface WindowEvents extends Events { | 5 interface WindowEvents extends Events { |
9 EventListenerList get abort(); | 6 EventListenerList get abort(); |
10 EventListenerList get beforeUnload(); | 7 EventListenerList get beforeUnload(); |
11 EventListenerList get blur(); | 8 EventListenerList get blur(); |
12 EventListenerList get canPlay(); | 9 EventListenerList get canPlay(); |
13 EventListenerList get canPlayThrough(); | 10 EventListenerList get canPlayThrough(); |
14 EventListenerList get change(); | 11 EventListenerList get change(); |
15 EventListenerList get click(); | 12 EventListenerList get click(); |
16 EventListenerList get contextMenu(); | 13 EventListenerList get contextMenu(); |
17 EventListenerList get dblClick(); | 14 EventListenerList get dblClick(); |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 int setInterval(TimeoutHandler handler, int timeout); | 294 int setInterval(TimeoutHandler handler, int timeout); |
298 | 295 |
299 int setTimeout(TimeoutHandler handler, int timeout); | 296 int setTimeout(TimeoutHandler handler, int timeout); |
300 | 297 |
301 Object showModalDialog(String url, [Object dialogArgs, String featureArgs]); | 298 Object showModalDialog(String url, [Object dialogArgs, String featureArgs]); |
302 | 299 |
303 void stop(); | 300 void stop(); |
304 | 301 |
305 void webkitCancelRequestAnimationFrame(int id); | 302 void webkitCancelRequestAnimationFrame(int id); |
306 | 303 |
| 304 // TODO(jacobr): make these return Future<Point>. |
307 Point webkitConvertPointFromNodeToPage([Node node, Point p]); | 305 Point webkitConvertPointFromNodeToPage([Node node, Point p]); |
| 306 |
308 Point webkitConvertPointFromPageToNode([Node node, Point p]); | 307 Point webkitConvertPointFromPageToNode([Node node, Point p]); |
309 | 308 |
310 int webkitRequestAnimationFrame(RequestAnimationFrameCallback callback, [Eleme
nt element]); | 309 int webkitRequestAnimationFrame(RequestAnimationFrameCallback callback, [Eleme
nt element]); |
311 | 310 |
312 /** | 311 /** |
313 * Executes [callback] after the event loop unwinds but before the page is | 312 * Executes a [callback] after the next batch of browser layout measurements |
314 * rendered. Inside the callback, synchronous element measurement is | 313 * has completed or would have completed if any browser layout measurements |
315 * allowed and dom manipulation that could trigger a layout is disallowed. | 314 * had been scheduled. |
316 * The [callback] may return a closure that is run in the normal | |
317 * context where dom manipulation is allowed but sync measurement is | |
318 * disallowed. | |
319 */ | 315 */ |
320 void requestMeasurementFrame(MeasurementCallback callback); | 316 void requestLayoutFrame(TimeoutHandler callback); |
321 | |
322 /** | |
323 * True iff within a call to [:requestMeasurementFrame:] | |
324 * When inside a measurement frame, any DOM manipulation that could trigger | |
325 * a layout is prohibited to avoid accidentally triggering large numbers of | |
326 * layouts. | |
327 */ | |
328 bool get inMeasurementFrame(); | |
329 | 317 |
330 // Window open(String url, String target, WindowSpec features); | 318 // Window open(String url, String target, WindowSpec features); |
331 | 319 |
332 WindowEvents get on(); | 320 WindowEvents get on(); |
333 } | 321 } |
OLD | NEW |