| Index: tools/dom/templates/html/impl/impl_Window.darttemplate
|
| diff --git a/tools/dom/templates/html/impl/impl_Window.darttemplate b/tools/dom/templates/html/impl/impl_Window.darttemplate
|
| index 19999f4bea96d6434262100231177124aad6489e..aaa1b97296d0dd76e9662ac907ce7ae04ce5292d 100644
|
| --- a/tools/dom/templates/html/impl/impl_Window.darttemplate
|
| +++ b/tools/dom/templates/html/impl/impl_Window.darttemplate
|
| @@ -12,6 +12,19 @@ $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
|
| $endif
|
|
|
| /**
|
| + * Executes a [callback] after the immediate execution stack has completed.
|
| + *
|
| + * This differs from using Timer.run(callback)
|
| + * because Timer will run in about 4-15 milliseconds, depending on browser,
|
| + * depending on load. [setImmediate], in contrast, makes browser-specific
|
| + * changes in behavior to attempt to run immediately after the current
|
| + * frame unwinds, causing the future to complete after all processing has
|
| + * completed for the current event, but before any subsequent events.
|
| + */
|
| + void setImmediate(TimeoutHandler callback) {
|
| + _addMicrotaskCallback(callback);
|
| + }
|
| + /**
|
| * Lookup a port by its [name]. Return null if no port is
|
| * registered under [name].
|
| */
|
| @@ -208,6 +221,44 @@ $if DART2JS
|
|
|
| @DomName('Window.console')
|
| Console get console => Console._safeConsole;
|
| +
|
| + /// Checks if _setImmediate is supported.
|
| + static bool get _supportsSetImmediate =>
|
| + JS('bool', '!!(window.setImmediate)');
|
| +
|
| + // Set immediate implementation for IE
|
| + void _setImmediate(void callback()) {
|
| + JS('void', '#.setImmediate(#)', this, convertDartClosureToJS(callback, 0));
|
| + }
|
| +$else
|
| + /// Checks if _setImmediate is supported.
|
| + static bool get _supportsSetImmediate => false;
|
| +
|
| + /// Dartium stub for IE's setImmediate.
|
| + void _setImmediate(void callback()) {
|
| + throw new UnsupportedError('setImmediate is not supported');
|
| + }
|
| +
|
| + /**
|
| + * Called to draw an animation frame and then request the window to repaint
|
| + * after [callback] has finished (creating the animation).
|
| + *
|
| + * Use this method only if you need to later call [cancelAnimationFrame]. If
|
| + * not, the preferred Dart idiom is to set animation frames by calling
|
| + * [animationFrame], which returns a Future.
|
| + *
|
| + * Returns a non-zero valued integer to represent the request id for this
|
| + * request. This value only needs to be saved if you intend to call
|
| + * [cancelAnimationFrame] so you can specify the particular animation to
|
| + * cancel.
|
| + *
|
| + * Note: The supplied [callback] needs to call [requestAnimationFrame] again
|
| + * for the animation to continue.
|
| + */
|
| + @DomName('Window.requestAnimationFrame')
|
| + int requestAnimationFrame(RequestAnimationFrameCallback callback) {
|
| + return _requestAnimationFrame(_wrapZone(callback));
|
| + }
|
| $endif
|
|
|
| /**
|
|
|