| 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 3bd668148510230cf7601de87f91e0a4718e94f2..9cd6d89cd739e3c2e86db37e23d8017a63a7a33b 100644
|
| --- a/sdk/lib/html/dartium/html_dartium.dart
|
| +++ b/sdk/lib/html/dartium/html_dartium.dart
|
| @@ -27373,22 +27373,9 @@ class WheelEvent extends MouseEvent {
|
|
|
| @DocsEditable
|
| @DomName('Window')
|
| -class Window extends EventTarget implements WindowBase, WindowTimers, WindowBase64 {
|
| +class Window extends EventTarget implements WindowBase, _WindowTimers, WindowBase64 {
|
|
|
| /**
|
| - * Executes a [callback] after the immediate execution stack has completed.
|
| - *
|
| - * This differs from using Timer.run(callback)
|
| - * because Timer will run in about 4-15 milliseconds, depending on browser,
|
| - * depending on load. [setImmediate], in contrast, makes browser-specific
|
| - * changes in behavior 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);
|
| - }
|
| - /**
|
| * Lookup a port by its [name]. Return null if no port is
|
| * registered under [name].
|
| */
|
| @@ -27444,14 +27431,6 @@ class Window extends EventTarget implements WindowBase, WindowTimers, WindowBase
|
| return completer.future;
|
| }
|
|
|
| - /// Checks if _setImmediate is supported.
|
| - static bool get _supportsSetImmediate => false;
|
| -
|
| - /// Dartium stub for IE's setImmediate.
|
| - void _setImmediate(void callback()) {
|
| - throw new UnsupportedError('setImmediate is not supported');
|
| - }
|
| -
|
| /**
|
| * Called to draw an animation frame and then request the window to repaint
|
| * after [callback] has finished (creating the animation).
|
| @@ -28433,41 +28412,6 @@ abstract class WindowBase64 extends NativeFieldWrapperClass1 {
|
|
|
|
|
| @DocsEditable()
|
| -@DomName('WindowTimers')
|
| -@Experimental() // untriaged
|
| -abstract class WindowTimers extends NativeFieldWrapperClass1 {
|
| - // To suppress missing implicit constructor warnings.
|
| - factory WindowTimers._() { throw new UnsupportedError("Not supported"); }
|
| -
|
| - @DomName('WindowTimers.clearInterval')
|
| - @DocsEditable()
|
| - @Experimental() // untriaged
|
| - void clearInterval(int handle) native "WindowTimers_clearInterval_Callback";
|
| -
|
| - @DomName('WindowTimers.clearTimeout')
|
| - @DocsEditable()
|
| - @Experimental() // untriaged
|
| - void clearTimeout(int handle) native "WindowTimers_clearTimeout_Callback";
|
| -
|
| - @DomName('WindowTimers.setInterval')
|
| - @DocsEditable()
|
| - @Experimental() // untriaged
|
| - int setInterval(Object handler, int timeout) native "WindowTimers_setInterval_Callback";
|
| -
|
| - @DomName('WindowTimers.setTimeout')
|
| - @DocsEditable()
|
| - @Experimental() // untriaged
|
| - int setTimeout(Object handler, int timeout) native "WindowTimers_setTimeout_Callback";
|
| -
|
| -}
|
| -// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
| -// for details. All rights reserved. Use of this source code is governed by a
|
| -// BSD-style license that can be found in the LICENSE file.
|
| -
|
| -// WARNING: Do not edit - generated code.
|
| -
|
| -
|
| -@DocsEditable()
|
| @DomName('Worker')
|
| @SupportedBrowser(SupportedBrowser.CHROME)
|
| @SupportedBrowser(SupportedBrowser.FIREFOX)
|
| @@ -28578,7 +28522,7 @@ class WorkerCrypto extends NativeFieldWrapperClass1 {
|
| @DocsEditable()
|
| @DomName('WorkerGlobalScope')
|
| @Experimental() // untriaged
|
| -class WorkerGlobalScope extends EventTarget implements WindowTimers, WindowBase64 {
|
| +class WorkerGlobalScope extends EventTarget implements _WindowTimers, WindowBase64 {
|
| // To suppress missing implicit constructor warnings.
|
| factory WorkerGlobalScope._() { throw new UnsupportedError("Not supported"); }
|
|
|
| @@ -30506,6 +30450,41 @@ abstract class _WebKitSourceBufferList extends EventTarget {
|
|
|
|
|
| @DocsEditable()
|
| +@DomName('WindowTimers')
|
| +@Experimental() // untriaged
|
| +abstract class _WindowTimers extends NativeFieldWrapperClass1 {
|
| + // To suppress missing implicit constructor warnings.
|
| + factory _WindowTimers._() { throw new UnsupportedError("Not supported"); }
|
| +
|
| + @DomName('WindowTimers.clearInterval')
|
| + @DocsEditable()
|
| + @Experimental() // untriaged
|
| + void clearInterval(int handle) native "WindowTimers_clearInterval_Callback";
|
| +
|
| + @DomName('WindowTimers.clearTimeout')
|
| + @DocsEditable()
|
| + @Experimental() // untriaged
|
| + void clearTimeout(int handle) native "WindowTimers_clearTimeout_Callback";
|
| +
|
| + @DomName('WindowTimers.setInterval')
|
| + @DocsEditable()
|
| + @Experimental() // untriaged
|
| + int setInterval(Object handler, int timeout) native "WindowTimers_setInterval_Callback";
|
| +
|
| + @DomName('WindowTimers.setTimeout')
|
| + @DocsEditable()
|
| + @Experimental() // untriaged
|
| + int setTimeout(Object handler, int timeout) native "WindowTimers_setTimeout_Callback";
|
| +
|
| +}
|
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| +// WARNING: Do not edit - generated code.
|
| +
|
| +
|
| +@DocsEditable()
|
| @DomName('WorkerLocation')
|
| // http://www.whatwg.org/specs/web-apps/current-work/multipage/workers.html#workerlocation
|
| @Experimental()
|
| @@ -33816,161 +33795,6 @@ class KeyboardEventStream {
|
| static CustomStream<KeyEvent> onKeyDown(EventTarget target) =>
|
| new _KeyboardEventHandler('keydown').forTarget(target);
|
| }
|
| -// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
| -// for details. All rights reserved. Use of this source code is governed by a
|
| -// BSD-style license that can be found in the LICENSE file.
|
| -
|
| -
|
| -typedef void _MicrotaskCallback();
|
| -
|
| -/**
|
| - * This class attempts to invoke a callback as soon as the current event stack
|
| - * unwinds, but before the browser repaints.
|
| - */
|
| -abstract class _MicrotaskScheduler {
|
| - bool _nextMicrotaskFrameScheduled = false;
|
| - final _MicrotaskCallback _callback;
|
| -
|
| - _MicrotaskScheduler(this._callback);
|
| -
|
| - /**
|
| - * Creates the best possible microtask scheduler for the current platform.
|
| - */
|
| - factory _MicrotaskScheduler.best(_MicrotaskCallback callback) {
|
| - if (Window._supportsSetImmediate) {
|
| - return new _SetImmediateScheduler(callback);
|
| - } else if (MutationObserver.supported) {
|
| - return new _MutationObserverScheduler(callback);
|
| - }
|
| - return new _PostMessageScheduler(callback);
|
| - }
|
| -
|
| - /**
|
| - * Schedules a microtask callback if one has not been scheduled already.
|
| - */
|
| - void maybeSchedule() {
|
| - if (this._nextMicrotaskFrameScheduled) {
|
| - return;
|
| - }
|
| - this._nextMicrotaskFrameScheduled = true;
|
| - this._schedule();
|
| - }
|
| -
|
| - /**
|
| - * Does the actual scheduling of the callback.
|
| - */
|
| - void _schedule();
|
| -
|
| - /**
|
| - * Handles the microtask callback and forwards it if necessary.
|
| - */
|
| - void _onCallback() {
|
| - // Ignore spurious messages.
|
| - if (!_nextMicrotaskFrameScheduled) {
|
| - return;
|
| - }
|
| - _nextMicrotaskFrameScheduled = false;
|
| - this._callback();
|
| - }
|
| -}
|
| -
|
| -/**
|
| - * Scheduler which uses window.postMessage to schedule events.
|
| - */
|
| -class _PostMessageScheduler extends _MicrotaskScheduler {
|
| - final _MICROTASK_MESSAGE = "DART-MICROTASK";
|
| -
|
| - _PostMessageScheduler(_MicrotaskCallback callback): super(callback) {
|
| - // Messages from other windows do not cause a security risk as
|
| - // all we care about is that _handleMessage is called
|
| - // after the current event loop is unwound and calling the function is
|
| - // a noop when zero requests are pending.
|
| - window.onMessage.listen(this._handleMessage);
|
| - }
|
| -
|
| - void _schedule() {
|
| - window.postMessage(_MICROTASK_MESSAGE, "*");
|
| - }
|
| -
|
| - void _handleMessage(e) {
|
| - this._onCallback();
|
| - }
|
| -}
|
| -
|
| -/**
|
| - * Scheduler which uses a MutationObserver to schedule events.
|
| - */
|
| -class _MutationObserverScheduler extends _MicrotaskScheduler {
|
| - MutationObserver _observer;
|
| - Element _dummy;
|
| -
|
| - _MutationObserverScheduler(_MicrotaskCallback callback): super(callback) {
|
| - // Mutation events get fired as soon as the current event stack is unwound
|
| - // so we just make a dummy event and listen for that.
|
| - _observer = new MutationObserver(this._handleMutation);
|
| - _dummy = new DivElement();
|
| - _observer.observe(_dummy, attributes: true);
|
| - }
|
| -
|
| - void _schedule() {
|
| - // Toggle it to trigger the mutation event.
|
| - _dummy.hidden = !_dummy.hidden;
|
| - }
|
| -
|
| - _handleMutation(List<MutationRecord> mutations, MutationObserver observer) {
|
| - this._onCallback();
|
| - }
|
| -}
|
| -
|
| -/**
|
| - * Scheduler which uses window.setImmediate to schedule events.
|
| - */
|
| -class _SetImmediateScheduler extends _MicrotaskScheduler {
|
| - _SetImmediateScheduler(_MicrotaskCallback callback): super(callback);
|
| -
|
| - void _schedule() {
|
| - window._setImmediate(_handleImmediate);
|
| - }
|
| -
|
| - void _handleImmediate() {
|
| - this._onCallback();
|
| - }
|
| -}
|
| -
|
| -List<TimeoutHandler> _pendingMicrotasks;
|
| -_MicrotaskScheduler _microtaskScheduler = null;
|
| -
|
| -void _maybeScheduleMicrotaskFrame() {
|
| - if (_microtaskScheduler == null) {
|
| - _microtaskScheduler =
|
| - new _MicrotaskScheduler.best(_completeMicrotasks);
|
| - }
|
| - _microtaskScheduler.maybeSchedule();
|
| -}
|
| -
|
| -/**
|
| - * Registers a [callback] which is called after the current execution stack
|
| - * unwinds.
|
| - */
|
| -void _addMicrotaskCallback(TimeoutHandler callback) {
|
| - if (_pendingMicrotasks == null) {
|
| - _pendingMicrotasks = <TimeoutHandler>[];
|
| - _maybeScheduleMicrotaskFrame();
|
| - }
|
| - _pendingMicrotasks.add(callback);
|
| -}
|
| -
|
| -
|
| -/**
|
| - * Complete all pending microtasks.
|
| - */
|
| -void _completeMicrotasks() {
|
| - var callbacks = _pendingMicrotasks;
|
| - _pendingMicrotasks = null;
|
| - for (var callback in callbacks) {
|
| - callback();
|
| - }
|
| -}
|
| // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
| // for details. All rights reserved. Use of this source code is governed by a
|
| // BSD-style license that can be found in the LICENSE file.
|
|
|