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

Side by Side Diff: lib/dom/templates/dom/frog/impl_DOMWindow.darttemplate

Issue 10166024: Browser compat for window.requestAnimationFrame (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « lib/dom/frog/dom_frog.dart ('k') | lib/dom/templates/html/dartium/impl_Window.darttemplate » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { 5 class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
6 $!MEMBERS
7 6
8 Window get _top() native "return this.top;"; 7 Window get _top() native "return this.top;";
9 8
10 // Override top to return secure wrapper. 9 // Override top to return secure wrapper.
11 Window get top() => _DOMWindowCrossFrameImpl._createSafe(_top); 10 Window get top() => _DOMWindowCrossFrameImpl._createSafe(_top);
11
12 int requestAnimationFrame(RequestAnimationFrameCallback callback) native '''
13 if (!window.requestAnimationFrame) {
14 window.requestAnimationFrame =
15 window.webkitRequestAnimationFrame ||
16 window.mozRequestAnimationFrame ||
17 window.msRequestAnimationFrame ||
18 window.oRequestAnimationFrame ||
19 function (callback) {
20 window.setTimeout(callback, 16 /* 16ms ~= 60fps */);
21 };
22 }
23 return window.requestAnimationFrame(callback);
24 ''';
25
26 // Protect member 'requestAnimationFrame'.
27 _requestAnimationFrame() native 'requestAnimationFrame';
28
29 $!MEMBERS
12 } 30 }
OLDNEW
« no previous file with comments | « lib/dom/frog/dom_frog.dart ('k') | lib/dom/templates/html/dartium/impl_Window.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698