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

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

Side-by-side diff isn't available for this file because of its large size.
Issue 10161014: Browser compat for window.requestAnimationFrame (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 8 years, 8 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/html/dartium/html_dartium.dart ('k') | no next file » | 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 f8d7217e78ce99f46c41db63265b7c795180828a..8643d501d9e408500912ba3efd5e1720d4c53772 100644
--- a/lib/html/frog/html_frog.dart
+++ b/lib/html/frog/html_frog.dart
@@ -16256,6 +16256,24 @@ class _WindowImpl extends _EventTargetImpl implements Window native "@*DOMWindow
_addMeasurementFrameCallback(callback);
}
+ /** @domName DOMWindow.requestAnimationFrame */
+ 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);
@@ -34328,6 +34346,10 @@ interface Window extends EventTarget {
void requestLayoutFrame(TimeoutHandler callback);
+ /** @domName DOMWindow.webkitRequestAnimationFrame */
+ int requestAnimationFrame(RequestAnimationFrameCallback callback);
+
+
/**
* @domName EventTarget.addEventListener, EventTarget.removeEventListener, EventTarget.dispatchEvent
*/
« no previous file with comments | « lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698