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

Unified Diff: lib/html/frog/html_frog.dart

Issue 10450033: Revert "Add cancelAnimationFrame" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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 | « lib/dom/templates/html/interface/interface_Window.darttemplate ('k') | tests/html/html.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/html/frog/html_frog.dart
diff --git a/lib/html/frog/html_frog.dart b/lib/html/frog/html_frog.dart
index c63973efa2f88307cebe2c78beb577ffe9522cbd..b6c15e0ebfedaed23560919f3590e72cbb6647f6 100644
--- a/lib/html/frog/html_frog.dart
+++ b/lib/html/frog/html_frog.dart
@@ -16375,38 +16375,23 @@ class _WindowImpl extends _EventTargetImpl implements Window native "@*DOMWindow
}
/** @domName DOMWindow.requestAnimationFrame */
- int requestAnimationFrame(RequestAnimationFrameCallback callback) {
- _ensureRequestAnimationFrame();
- return _requestAnimationFrame(callback);
- }
-
- void cancelAnimationFrame(id) {
- _ensureRequestAnimationFrame();
- _cancelAnimationFrame(id);
- }
-
- int _requestAnimationFrame(RequestAnimationFrameCallback callback)
- native 'requestAnimationFrame';
-
- void _cancelAnimationFrame(int id)
- native 'cancelAnimationFrame';
-
- _ensureRequestAnimationFrame() native '''
- if (this.requestAnimationFrame && this.cancelAnimationFrame) return;
- vendors = ['ms', 'moz', 'webkit', 'o', ''];
- for (var i = 0; i < vendors.length && !this.requestAnimationFrame; ++i) {
- this.requestAnimationFrame = this[vendors[i] + 'RequestAnimationFrame'];
- this.cancelAnimationFrame =
- this[vendors[i]+'CancelAnimationFrame'] ||
- this[vendors[i]+'CancelRequestAnimationFrame'];
- }
- if (this.requestAnimationFrame && this.cancelAnimationFrame) return;
- this.requestAnimationFrame = function(callback) {
- window.setTimeout(callback, 16 /* 16ms ~= 60fps */);
- };
- this.cancelAnimationFrame = function(id) { clearTimeout(id); }
+ int requestAnimationFrame(RequestAnimationFrameCallback callback) native '''
+ if (!window.requestAnimationFrame) {
+ window.requestAnimationFrame =
+ window.webkitRequestAnimationFrame ||
+ window.mozRequestAnimationFrame ||
+ window.msRequestAnimationFrame ||
+ window.oRequestAnimationFrame ||
+ function (callback) {
+ window.setTimeout(callback, 16 /* 16ms ~= 60fps */);
+ };
+ }
+ return window.requestAnimationFrame(callback);
''';
+ // Protect member 'requestAnimationFrame'.
+ _requestAnimationFrame() native 'requestAnimationFrame';
+
_WindowEventsImpl get on() =>
new _WindowEventsImpl(this);
@@ -34626,8 +34611,6 @@ interface Window extends EventTarget {
/** @domName DOMWindow.webkitRequestAnimationFrame */
int requestAnimationFrame(RequestAnimationFrameCallback callback);
- void cancelAnimationFrame(int id);
-
/**
* @domName EventTarget.addEventListener, EventTarget.removeEventListener, EventTarget.dispatchEvent
« no previous file with comments | « lib/dom/templates/html/interface/interface_Window.darttemplate ('k') | tests/html/html.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698