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

Side by Side Diff: lib/html/templates/html/dart2js/impl_Window.darttemplate

Issue 11053020: Changing return value of request animation frame. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixing dartium build error. Created 8 years, 2 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/html/idl/dart/dart.idl ('k') | no next file » | 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 native "@*DOMWindow" { 5 class $CLASSNAME$EXTENDS$IMPLEMENTS native "@*DOMWindow" {
6 6
7 _DocumentImpl get document() native "return this.document;"; 7 _DocumentImpl get document() native "return this.document;";
8 8
9 Window get _top() native "return this.top;"; 9 Window get _top() native "return this.top;";
10 10
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 if (this.requestAnimationFrame && this.cancelAnimationFrame) return; 100 if (this.requestAnimationFrame && this.cancelAnimationFrame) return;
101 var vendors = ['ms', 'moz', 'webkit', 'o']; 101 var vendors = ['ms', 'moz', 'webkit', 'o'];
102 for (var i = 0; i < vendors.length && !this.requestAnimationFrame; ++i) { 102 for (var i = 0; i < vendors.length && !this.requestAnimationFrame; ++i) {
103 this.requestAnimationFrame = this[vendors[i] + 'RequestAnimationFrame']; 103 this.requestAnimationFrame = this[vendors[i] + 'RequestAnimationFrame'];
104 this.cancelAnimationFrame = 104 this.cancelAnimationFrame =
105 this[vendors[i]+'CancelAnimationFrame'] || 105 this[vendors[i]+'CancelAnimationFrame'] ||
106 this[vendors[i]+'CancelRequestAnimationFrame']; 106 this[vendors[i]+'CancelRequestAnimationFrame'];
107 } 107 }
108 if (this.requestAnimationFrame && this.cancelAnimationFrame) return; 108 if (this.requestAnimationFrame && this.cancelAnimationFrame) return;
109 this.requestAnimationFrame = function(callback) { 109 this.requestAnimationFrame = function(callback) {
110 return window.setTimeout(callback, 16 /* 16ms ~= 60fps */); 110 return window.setTimeout(function() {
111 callback(Date.now());
112 }, 16 /* 16ms ~= 60fps */);
111 }; 113 };
112 this.cancelAnimationFrame = function(id) { clearTimeout(id); } 114 this.cancelAnimationFrame = function(id) { clearTimeout(id); }
113 '''; 115 ''';
114 116
115 117
116 _IDBFactoryImpl get indexedDB => _get_indexedDB(); 118 _IDBFactoryImpl get indexedDB => _get_indexedDB();
117 119
118 _IDBFactoryImpl _get_indexedDB() native 120 _IDBFactoryImpl _get_indexedDB() native
119 'return this.indexedDB || this.webkitIndexedDB || this.mozIndexedDB'; 121 'return this.indexedDB || this.webkitIndexedDB || this.mozIndexedDB';
120 122
(...skipping 10 matching lines...) Expand all
131 133
132 String createObjectUrl(object) native ''' 134 String createObjectUrl(object) native '''
133 return (window.URL || window.webkitURL).createObjectURL(object) 135 return (window.URL || window.webkitURL).createObjectURL(object)
134 '''; 136 ''';
135 137
136 void revokeObjectUrl(String objectUrl) native ''' 138 void revokeObjectUrl(String objectUrl) native '''
137 (window.URL || window.webkitURL).revokeObjectURL(objectUrl) 139 (window.URL || window.webkitURL).revokeObjectURL(objectUrl)
138 '''; 140 ''';
139 $!MEMBERS 141 $!MEMBERS
140 } 142 }
OLDNEW
« no previous file with comments | « lib/html/idl/dart/dart.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698