| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |