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 6f56b8729cc81bf9471955817ec5208f6b3717f5..8abac3775c4146f65b923db522ae32ae4fa881ac 100644 |
--- a/tools/dom/templates/html/impl/impl_Window.darttemplate |
+++ b/tools/dom/templates/html/impl/impl_Window.darttemplate |
@@ -96,8 +96,6 @@ $if DART2JS |
JS('void', '#.location = #', this, value); |
} |
-$endif |
- |
/** |
* Called to draw an animation frame and then request the window to repaint |
* after [callback] has finished (creating the animation). |
@@ -116,9 +114,7 @@ $endif |
*/ |
@DomName('Window.requestAnimationFrame') |
int requestAnimationFrame(FrameRequestCallback callback) { |
-$if DART2JS |
_ensureRequestAnimationFrame(); |
-$endif |
return _requestAnimationFrame(_wrapZone/*<num, dynamic>*/(callback)); |
} |
@@ -130,15 +126,11 @@ $endif |
* * [Window.cancelAnimationFrame](https://developer.mozilla.org/en-US/docs/Web/API/Window.cancelAnimationFrame) |
* from MDN. |
*/ |
- @DomName('Window.cancelAnimationFrame') |
void cancelAnimationFrame(int id) { |
-$if DART2JS |
_ensureRequestAnimationFrame(); |
-$endif |
_cancelAnimationFrame(id); |
} |
-$if DART2JS |
@JSName('requestAnimationFrame') |
int _requestAnimationFrame(FrameRequestCallback callback) native; |
@@ -189,6 +181,28 @@ $if DART2JS |
/// The debugging console for this window. |
@DomName('Window.console') |
Console get console => Console._safeConsole; |
+ |
+$else |
+ /** |
+ * 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(FrameRequestCallback callback) { |
+ return _requestAnimationFrame(_wrapZone(callback)); |
+ } |
$endif |
/** |