Index: lib/dom/templates/dom/frog/impl_DOMWindow.darttemplate |
diff --git a/lib/dom/templates/dom/frog/impl_DOMWindow.darttemplate b/lib/dom/templates/dom/frog/impl_DOMWindow.darttemplate |
index 14f8d9a7aea19978140a12f97bd33419aba53186..2d20f6f6359a70f4f5f9604a24be4b254e20f8b3 100644 |
--- a/lib/dom/templates/dom/frog/impl_DOMWindow.darttemplate |
+++ b/lib/dom/templates/dom/frog/impl_DOMWindow.darttemplate |
@@ -3,10 +3,28 @@ |
// BSD-style license that can be found in the LICENSE file. |
class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { |
-$!MEMBERS |
Window get _top() native "return this.top;"; |
// Override top to return secure wrapper. |
Window get top() => _DOMWindowCrossFrameImpl._createSafe(_top); |
+ |
+ 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'; |
+ |
+$!MEMBERS |
} |