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

Side by Side Diff: lib/dom/frog/dom_frog.dart

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
OLDNEW
1 #library('dom'); 1 #library('dom');
2 2
3 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 3 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
4 // for details. All rights reserved. Use of this source code is governed by a 4 // for details. All rights reserved. Use of this source code is governed by a
5 // BSD-style license that can be found in the LICENSE file. 5 // BSD-style license that can be found in the LICENSE file.
6 6
7 // DO NOT EDIT 7 // DO NOT EDIT
8 // Auto-generated Dart DOM library. 8 // Auto-generated Dart DOM library.
9 9
10 10
(...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after
1230 String createObjectURL(blob_OR_stream) native; 1230 String createObjectURL(blob_OR_stream) native;
1231 1231
1232 void revokeObjectURL(String url) native; 1232 void revokeObjectURL(String url) native;
1233 } 1233 }
1234 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1234 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
1235 // for details. All rights reserved. Use of this source code is governed by a 1235 // for details. All rights reserved. Use of this source code is governed by a
1236 // BSD-style license that can be found in the LICENSE file. 1236 // BSD-style license that can be found in the LICENSE file.
1237 1237
1238 class _DOMWindowJs extends _EventTargetJs implements DOMWindow native "@*DOMWind ow" { 1238 class _DOMWindowJs extends _EventTargetJs implements DOMWindow native "@*DOMWind ow" {
1239 1239
1240 Window get _top() native "return this.top;";
1241
1242 // Override top to return secure wrapper.
1243 Window get top() => _DOMWindowCrossFrameImpl._createSafe(_top);
1244
1245 int requestAnimationFrame(RequestAnimationFrameCallback callback) native '''
1246 if (!window.requestAnimationFrame) {
1247 window.requestAnimationFrame =
1248 window.webkitRequestAnimationFrame ||
1249 window.mozRequestAnimationFrame ||
1250 window.msRequestAnimationFrame ||
1251 window.oRequestAnimationFrame ||
1252 function (callback) {
1253 window.setTimeout(callback, 16 /* 16ms ~= 60fps */);
1254 };
1255 }
1256 return window.requestAnimationFrame(callback);
1257 ''';
1258
1259 // Protect member 'requestAnimationFrame'.
1260 _requestAnimationFrame() native 'requestAnimationFrame';
1261
1262
1240 static final int PERSISTENT = 1; 1263 static final int PERSISTENT = 1;
1241 1264
1242 static final int TEMPORARY = 0; 1265 static final int TEMPORARY = 0;
1243 1266
1244 final _DOMApplicationCacheJs applicationCache; 1267 final _DOMApplicationCacheJs applicationCache;
1245 1268
1246 final _NavigatorJs clientInformation; 1269 final _NavigatorJs clientInformation;
1247 1270
1248 final bool closed; 1271 final bool closed;
1249 1272
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
1416 _WebKitPointJs webkitConvertPointFromPageToNode(_NodeJs node, _WebKitPointJs p ) native; 1439 _WebKitPointJs webkitConvertPointFromPageToNode(_NodeJs node, _WebKitPointJs p ) native;
1417 1440
1418 void webkitPostMessage(message, String targetOrigin, [List transferList = null ]) native; 1441 void webkitPostMessage(message, String targetOrigin, [List transferList = null ]) native;
1419 1442
1420 int webkitRequestAnimationFrame(RequestAnimationFrameCallback callback) native ; 1443 int webkitRequestAnimationFrame(RequestAnimationFrameCallback callback) native ;
1421 1444
1422 void webkitRequestFileSystem(int type, int size, FileSystemCallback successCal lback, [ErrorCallback errorCallback = null]) native; 1445 void webkitRequestFileSystem(int type, int size, FileSystemCallback successCal lback, [ErrorCallback errorCallback = null]) native;
1423 1446
1424 void webkitResolveLocalFileSystemURL(String url, [EntryCallback successCallbac k = null, ErrorCallback errorCallback = null]) native; 1447 void webkitResolveLocalFileSystemURL(String url, [EntryCallback successCallbac k = null, ErrorCallback errorCallback = null]) native;
1425 1448
1426
1427 Window get _top() native "return this.top;";
1428
1429 // Override top to return secure wrapper.
1430 Window get top() => _DOMWindowCrossFrameImpl._createSafe(_top);
1431 } 1449 }
1432 1450
1433 class _DataTransferItemJs extends _DOMTypeJs implements DataTransferItem native "*DataTransferItem" { 1451 class _DataTransferItemJs extends _DOMTypeJs implements DataTransferItem native "*DataTransferItem" {
1434 1452
1435 final String kind; 1453 final String kind;
1436 1454
1437 final String type; 1455 final String type;
1438 1456
1439 _BlobJs getAsFile() native; 1457 _BlobJs getAsFile() native;
1440 1458
(...skipping 23745 matching lines...) Expand 10 before | Expand all | Expand 10 after
25186 if (length < 0) throw new IllegalArgumentException('length'); 25204 if (length < 0) throw new IllegalArgumentException('length');
25187 if (start < 0) throw new IndexOutOfRangeException(start); 25205 if (start < 0) throw new IndexOutOfRangeException(start);
25188 int end = start + length; 25206 int end = start + length;
25189 if (end > a.length) throw new IndexOutOfRangeException(end); 25207 if (end > a.length) throw new IndexOutOfRangeException(end);
25190 for (int i = start; i < end; i++) { 25208 for (int i = start; i < end; i++) {
25191 accumulator.add(a[i]); 25209 accumulator.add(a[i]);
25192 } 25210 }
25193 return accumulator; 25211 return accumulator;
25194 } 25212 }
25195 } 25213 }
OLDNEW
« no previous file with comments | « client/tests/client/html/RequestAnimationFrameTest.dart ('k') | lib/dom/templates/dom/frog/impl_DOMWindow.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698