OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 part of $LIBRARYNAME; | 5 part of $LIBRARYNAME; |
6 | 6 |
7 typedef void RemoveFrameRequestMapping(int id); | 7 typedef void RemoveFrameRequestMapping(int id); |
8 | 8 |
9 /** | 9 /** |
10 * The task object representing animation-frame requests. | 10 * The task object representing animation-frame requests. |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 /** | 239 /** |
240 * Cancels an animation frame request. | 240 * Cancels an animation frame request. |
241 * | 241 * |
242 * ## Other resources | 242 * ## Other resources |
243 * | 243 * |
244 * * [Window.cancelAnimationFrame](https://developer.mozilla.org/en-US/docs/We
b/API/Window.cancelAnimationFrame) | 244 * * [Window.cancelAnimationFrame](https://developer.mozilla.org/en-US/docs/We
b/API/Window.cancelAnimationFrame) |
245 * from MDN. | 245 * from MDN. |
246 */ | 246 */ |
247 @DomName('Window.cancelAnimationFrame') | 247 @DomName('Window.cancelAnimationFrame') |
248 void cancelAnimationFrame(int id) { | 248 void cancelAnimationFrame(int id) { |
| 249 $if DART2JS |
249 _ensureRequestAnimationFrame(); | 250 _ensureRequestAnimationFrame(); |
| 251 $endif |
250 var task = AnimationFrameTask._tasks.remove(id); | 252 var task = AnimationFrameTask._tasks.remove(id); |
251 if (task == null) { | 253 if (task == null) { |
252 // Assume that the animation frame request wasn't intercepted by a zone. | 254 // Assume that the animation frame request wasn't intercepted by a zone. |
253 _cancelAnimationFrame(id); | 255 _cancelAnimationFrame(id); |
254 return; | 256 return; |
255 } | 257 } |
256 task.cancel(this); | 258 task.cancel(this); |
257 } | 259 } |
258 | 260 |
259 $if DART2JS | 261 $if DART2JS |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 {bool useCapture: false}) { | 481 {bool useCapture: false}) { |
480 $if DART2JS | 482 $if DART2JS |
481 // Specify the generic type for _ElementEventStreamImpl only in dart2js to | 483 // Specify the generic type for _ElementEventStreamImpl only in dart2js to |
482 // avoid checked mode errors in dartium. | 484 // avoid checked mode errors in dartium. |
483 return new _ElementListEventStreamImpl<BeforeUnloadEvent>(e, _eventType, use
Capture); | 485 return new _ElementListEventStreamImpl<BeforeUnloadEvent>(e, _eventType, use
Capture); |
484 $else | 486 $else |
485 return new _ElementListEventStreamImpl(e, _eventType, useCapture); | 487 return new _ElementListEventStreamImpl(e, _eventType, useCapture); |
486 $endif | 488 $endif |
487 } | 489 } |
488 } | 490 } |
OLD | NEW |