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

Unified Diff: tools/dom/templates/html/impl/impl_Window.darttemplate

Issue 2124863002: Fix animationFrameRequest for dartium. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/dom/scripts/htmlrenamer.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 fe4db3d7f55beab64cb9092d47f6abb247b0d6c4..9563abb24e04da5fb4d8c5fd38f3dee43ac43a08 100644
--- a/tools/dom/templates/html/impl/impl_Window.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Window.darttemplate
@@ -187,6 +187,8 @@ $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).
@@ -205,7 +207,9 @@ $if DART2JS
*/
@DomName('Window.requestAnimationFrame')
int requestAnimationFrame(FrameRequestCallback callback) {
+$if DART2JS
_ensureRequestAnimationFrame();
+$endif
if (identical(Zone.current, Zone.ROOT)) {
return _requestAnimationFrame(callback);
}
@@ -240,6 +244,7 @@ $if DART2JS
* * [Window.cancelAnimationFrame](https://developer.mozilla.org/en-US/docs/Web/API/Window.cancelAnimationFrame)
* from MDN.
*/
+ @DomName('Window.cancelAnimationFrame')
void cancelAnimationFrame(int id) {
_ensureRequestAnimationFrame();
var task = AnimationFrameTask._tasks.remove(id);
@@ -251,6 +256,7 @@ $if DART2JS
task.cancel(this);
}
+$if DART2JS
@JSName('requestAnimationFrame')
int _requestAnimationFrame(FrameRequestCallback callback) native;
@@ -301,28 +307,6 @@ $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
/**
« no previous file with comments | « tools/dom/scripts/htmlrenamer.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698