| Index: lib/html/frog/html_frog.dart
|
| diff --git a/lib/html/frog/html_frog.dart b/lib/html/frog/html_frog.dart
|
| index b6c15e0ebfedaed23560919f3590e72cbb6647f6..c63973efa2f88307cebe2c78beb577ffe9522cbd 100644
|
| --- a/lib/html/frog/html_frog.dart
|
| +++ b/lib/html/frog/html_frog.dart
|
| @@ -16375,22 +16375,37 @@ class _WindowImpl extends _EventTargetImpl implements Window native "@*DOMWindow
|
| }
|
|
|
| /** @domName DOMWindow.requestAnimationFrame */
|
| - int requestAnimationFrame(RequestAnimationFrameCallback callback) native '''
|
| - if (!window.requestAnimationFrame) {
|
| - window.requestAnimationFrame =
|
| - window.webkitRequestAnimationFrame ||
|
| - window.mozRequestAnimationFrame ||
|
| - window.msRequestAnimationFrame ||
|
| - window.oRequestAnimationFrame ||
|
| - function (callback) {
|
| - window.setTimeout(callback, 16 /* 16ms ~= 60fps */);
|
| - };
|
| - }
|
| - return window.requestAnimationFrame(callback);
|
| -''';
|
| + int requestAnimationFrame(RequestAnimationFrameCallback callback) {
|
| + _ensureRequestAnimationFrame();
|
| + return _requestAnimationFrame(callback);
|
| + }
|
| +
|
| + void cancelAnimationFrame(id) {
|
| + _ensureRequestAnimationFrame();
|
| + _cancelAnimationFrame(id);
|
| + }
|
|
|
| - // Protect member 'requestAnimationFrame'.
|
| - _requestAnimationFrame() native 'requestAnimationFrame';
|
| + int _requestAnimationFrame(RequestAnimationFrameCallback callback)
|
| + native 'requestAnimationFrame';
|
| +
|
| + void _cancelAnimationFrame(int id)
|
| + native 'cancelAnimationFrame';
|
| +
|
| + _ensureRequestAnimationFrame() native '''
|
| + if (this.requestAnimationFrame && this.cancelAnimationFrame) return;
|
| + vendors = ['ms', 'moz', 'webkit', 'o', ''];
|
| + for (var i = 0; i < vendors.length && !this.requestAnimationFrame; ++i) {
|
| + this.requestAnimationFrame = this[vendors[i] + 'RequestAnimationFrame'];
|
| + this.cancelAnimationFrame =
|
| + this[vendors[i]+'CancelAnimationFrame'] ||
|
| + this[vendors[i]+'CancelRequestAnimationFrame'];
|
| + }
|
| + if (this.requestAnimationFrame && this.cancelAnimationFrame) return;
|
| + this.requestAnimationFrame = function(callback) {
|
| + window.setTimeout(callback, 16 /* 16ms ~= 60fps */);
|
| + };
|
| + this.cancelAnimationFrame = function(id) { clearTimeout(id); }
|
| +''';
|
|
|
|
|
| _WindowEventsImpl get on() =>
|
| @@ -34611,6 +34626,8 @@ interface Window extends EventTarget {
|
| /** @domName DOMWindow.webkitRequestAnimationFrame */
|
| int requestAnimationFrame(RequestAnimationFrameCallback callback);
|
|
|
| + void cancelAnimationFrame(int id);
|
| +
|
|
|
| /**
|
| * @domName EventTarget.addEventListener, EventTarget.removeEventListener, EventTarget.dispatchEvent
|
|
|