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

Unified Diff: sdk/lib/html/dartium/html_dartium.dart

Issue 2159183003: Revert "Don't call _ensureRequestAnimationFrame in Dartium." (Closed) Base URL: https://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:
Download patch
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | tools/dom/scripts/htmlrenamer.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dartium/html_dartium.dart
diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart
index ff8082d4ba38543e825c33268a40231ae9d852d8..bc92d6dc423011f9620a4c0f04c23a2adbd7ef9e 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -39191,7 +39191,6 @@ class Window extends EventTarget implements WindowEventHandlers, WindowBase, Glo
return completer.future;
}
-
/**
* Called to draw an animation frame and then request the window to repaint
* after [callback] has finished (creating the animation).
@@ -39210,52 +39209,9 @@ class Window extends EventTarget implements WindowEventHandlers, WindowBase, Glo
*/
@DomName('Window.requestAnimationFrame')
int requestAnimationFrame(FrameRequestCallback callback) {
- if (identical(Zone.current, Zone.ROOT)) {
- return _requestAnimationFrame(callback);
- }
- var spec = new AnimationFrameRequestSpecification(this, callback);
- var task = Zone.current.createTask/*<AnimationFrameTask>*/(
- _createAnimationFrameTask, spec);
- AnimationFrameTask._tasks[task.id] = task;
- return task.id;
- }
-
- static _AnimationFrameTask _createAnimationFrameTask(
- AnimationFrameRequestSpecification spec, Zone zone) {
- var task;
- var id = spec.window._requestAnimationFrame((num time) {
- AnimationFrameTask.removeMapping(task.id);
- zone.runTask(_runAnimationFrame, task, time);
- });
- var callback = zone.registerUnaryCallback(spec.callback);
- task = new _AnimationFrameTask(id, zone, callback);
- return task;
- }
-
- static void _runAnimationFrame(_AnimationFrameTask task, num time) {
- task._callback(time);
- }
-
- /**
- * Cancels an animation frame request.
- *
- * ## Other resources
- *
- * * [Window.cancelAnimationFrame](https://developer.mozilla.org/en-US/docs/Web/API/Window.cancelAnimationFrame)
- * from MDN.
- */
- @DomName('Window.cancelAnimationFrame')
- void cancelAnimationFrame(int id) {
- var task = AnimationFrameTask._tasks.remove(id);
- if (task == null) {
- // Assume that the animation frame request wasn't intercepted by a zone.
- _cancelAnimationFrame(id);
- return;
- }
- task.cancel(this);
+ return _requestAnimationFrame(_wrapZone(callback));
}
-
/**
* Access a sandboxed file system of the specified `size`. If `persistent` is
* true, the application will request permission from the user to create
@@ -40022,7 +39978,7 @@ class Window extends EventTarget implements WindowEventHandlers, WindowBase, Glo
@DomName('Window.cancelAnimationFrame')
@DocsEditable()
- void _cancelAnimationFrame(int handle) => _blink.BlinkWindow.instance.cancelAnimationFrame_Callback_1_(this, handle);
+ void cancelAnimationFrame(int handle) => _blink.BlinkWindow.instance.cancelAnimationFrame_Callback_1_(this, handle);
@DomName('Window.close')
@DocsEditable()
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | tools/dom/scripts/htmlrenamer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698