| Index: sdk/lib/html/dartium/html_dartium.dart
|
| diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart
|
| index aadc9eeb45bcbdab42820ff510ff06ceb881d66a..80875d2a4524485bb8e13092f1ffad4adba8b6dc 100644
|
| --- a/sdk/lib/html/dartium/html_dartium.dart
|
| +++ b/sdk/lib/html/dartium/html_dartium.dart
|
| @@ -28992,21 +28992,28 @@ class WheelEvent extends MouseEvent {
|
| class Window extends EventTarget implements WindowBase {
|
|
|
| /**
|
| - * Executes a [callback] after the immediate execution stack has completed.
|
| - *
|
| - * This will cause the callback to be executed after all processing has
|
| + * Returns a Future that will complete when the immediate execution stack has
|
| + * completed.
|
| + *
|
| + * This differs from using Timer(const Duration(milliseconds: 0), callback)
|
| + * because Timer will run in about 4-15 milliseconds, depending on browser,
|
| + * depending on load. [immediate], in contrast, performs makes
|
| + * browser-specific changes to attempt to run immediately after the current
|
| + * frame unwinds, causing the future to complete after all processing has
|
| * completed for the current event, but before any subsequent events.
|
| */
|
| - void setImmediate(TimeoutHandler callback) {
|
| - _addMicrotaskCallback(callback);
|
| + Future get immediate {
|
| + var completer = new Completer<int>();
|
| + _addMicrotaskCallback(() { completer.complete(); });
|
| + return completer.future;
|
| }
|
| -
|
| /**
|
| * Lookup a port by its [name]. Return null if no port is
|
| * registered under [name].
|
| */
|
| - lookupPort(String name) {
|
| - var port = json.parse(document.documentElement.attributes['dart-port:$name']);
|
| + SendPortSync lookupPort(String name) {
|
| + var port =
|
| + json.parse(document.documentElement.attributes['dart-port:$name']);
|
| return _deserialize(port);
|
| }
|
|
|
| @@ -29015,9 +29022,26 @@ class Window extends EventTarget implements WindowBase {
|
| * port may be retrieved by any isolate (or JavaScript script)
|
| * running in this window.
|
| */
|
| - registerPort(String name, var port) {
|
| + void registerPort(String name, var port) {
|
| var serialized = _serialize(port);
|
| - document.documentElement.attributes['dart-port:$name'] = json.stringify(serialized);
|
| + document.documentElement.attributes['dart-port:$name'] =
|
| + json.stringify(serialized);
|
| + }
|
| +
|
| + /**
|
| + * Returns a Future that completes just before the window is about to repaint
|
| + * so the user can draw an animation frame
|
| + *
|
| + * If you need to later cancel this animation, use [requestAnimationFrame]
|
| + * instead.
|
| + *
|
| + * Note: The code that runs when the future completes should call
|
| + * [animationFrame] again for the animation to continue.
|
| + */
|
| + Future<int> get animationFrame {
|
| + var completer = new Completer<int>();
|
| + requestAnimationFrame((scheduledTime) {completer.complete(scheduledTime);});
|
| + return completer.future;
|
| }
|
|
|
| /// Checks if _setImmediate is supported.
|
| @@ -29350,14 +29374,6 @@ class Window extends EventTarget implements WindowBase {
|
| @DocsEditable
|
| void captureEvents() native "DOMWindow_captureEvents_Callback";
|
|
|
| - @DomName('DOMWindow.clearInterval')
|
| - @DocsEditable
|
| - void clearInterval(int handle) native "DOMWindow_clearInterval_Callback";
|
| -
|
| - @DomName('DOMWindow.clearTimeout')
|
| - @DocsEditable
|
| - void clearTimeout(int handle) native "DOMWindow_clearTimeout_Callback";
|
| -
|
| @DomName('DOMWindow.close')
|
| @DocsEditable
|
| void close() native "DOMWindow_close_Callback";
|
| @@ -29449,14 +29465,6 @@ class Window extends EventTarget implements WindowBase {
|
| @DocsEditable
|
| void scrollTo(int x, int y) native "DOMWindow_scrollTo_Callback";
|
|
|
| - @DomName('DOMWindow.setInterval')
|
| - @DocsEditable
|
| - int setInterval(TimeoutHandler handler, int timeout) native "DOMWindow_setInterval_Callback";
|
| -
|
| - @DomName('DOMWindow.setTimeout')
|
| - @DocsEditable
|
| - int setTimeout(TimeoutHandler handler, int timeout) native "DOMWindow_setTimeout_Callback";
|
| -
|
| @DomName('DOMWindow.showModalDialog')
|
| @DocsEditable
|
| Object showModalDialog(String url, [Object dialogArgs, String featureArgs]) native "DOMWindow_showModalDialog_Callback";
|
| @@ -35378,7 +35386,7 @@ class _MutationObserverScheduler extends _MicrotaskScheduler {
|
| }
|
|
|
| /**
|
| - * Scheduler which uses window.setImmediate to schedule events.
|
| + * Scheduler which uses window.immediate to schedule events.
|
| */
|
| class _SetImmediateScheduler extends _MicrotaskScheduler {
|
| _SetImmediateScheduler(_MicrotaskCallback callback): super(callback);
|
|
|