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

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

Issue 10161018: Revert "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
1263 static final int PERSISTENT = 1; 1240 static final int PERSISTENT = 1;
1264 1241
1265 static final int TEMPORARY = 0; 1242 static final int TEMPORARY = 0;
1266 1243
1267 final _DOMApplicationCacheJs applicationCache; 1244 final _DOMApplicationCacheJs applicationCache;
1268 1245
1269 final _NavigatorJs clientInformation; 1246 final _NavigatorJs clientInformation;
1270 1247
1271 final bool closed; 1248 final bool closed;
1272 1249
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
1439 _WebKitPointJs webkitConvertPointFromPageToNode(_NodeJs node, _WebKitPointJs p ) native; 1416 _WebKitPointJs webkitConvertPointFromPageToNode(_NodeJs node, _WebKitPointJs p ) native;
1440 1417
1441 void webkitPostMessage(message, String targetOrigin, [List transferList = null ]) native; 1418 void webkitPostMessage(message, String targetOrigin, [List transferList = null ]) native;
1442 1419
1443 int webkitRequestAnimationFrame(RequestAnimationFrameCallback callback) native ; 1420 int webkitRequestAnimationFrame(RequestAnimationFrameCallback callback) native ;
1444 1421
1445 void webkitRequestFileSystem(int type, int size, FileSystemCallback successCal lback, [ErrorCallback errorCallback = null]) native; 1422 void webkitRequestFileSystem(int type, int size, FileSystemCallback successCal lback, [ErrorCallback errorCallback = null]) native;
1446 1423
1447 void webkitResolveLocalFileSystemURL(String url, [EntryCallback successCallbac k = null, ErrorCallback errorCallback = null]) native; 1424 void webkitResolveLocalFileSystemURL(String url, [EntryCallback successCallbac k = null, ErrorCallback errorCallback = null]) native;
1448 1425
1426
1427 Window get _top() native "return this.top;";
1428
1429 // Override top to return secure wrapper.
1430 Window get top() => _DOMWindowCrossFrameImpl._createSafe(_top);
1449 } 1431 }
1450 1432
1451 class _DataTransferItemJs extends _DOMTypeJs implements DataTransferItem native "*DataTransferItem" { 1433 class _DataTransferItemJs extends _DOMTypeJs implements DataTransferItem native "*DataTransferItem" {
1452 1434
1453 final String kind; 1435 final String kind;
1454 1436
1455 final String type; 1437 final String type;
1456 1438
1457 _BlobJs getAsFile() native; 1439 _BlobJs getAsFile() native;
1458 1440
(...skipping 23745 matching lines...) Expand 10 before | Expand all | Expand 10 after
25204 if (length < 0) throw new IllegalArgumentException('length'); 25186 if (length < 0) throw new IllegalArgumentException('length');
25205 if (start < 0) throw new IndexOutOfRangeException(start); 25187 if (start < 0) throw new IndexOutOfRangeException(start);
25206 int end = start + length; 25188 int end = start + length;
25207 if (end > a.length) throw new IndexOutOfRangeException(end); 25189 if (end > a.length) throw new IndexOutOfRangeException(end);
25208 for (int i = start; i < end; i++) { 25190 for (int i = start; i < end; i++) {
25209 accumulator.add(a[i]); 25191 accumulator.add(a[i]);
25210 } 25192 }
25211 return accumulator; 25193 return accumulator;
25212 } 25194 }
25213 } 25195 }
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