| Index: sdk/lib/html/dart2js/html_dart2js.dart
|
| diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
|
| index 02d902ea3ba8e75cc9d0ea7719b99c74edd458f4..f1199d07ee0e547c598b4b55d8219c374c04b211 100644
|
| --- a/sdk/lib/html/dart2js/html_dart2js.dart
|
| +++ b/sdk/lib/html/dart2js/html_dart2js.dart
|
| @@ -7170,7 +7170,6 @@ class Document extends Node native "Document"
|
| DocumentFragment createDocumentFragment() native;
|
|
|
| @JSName('createElement')
|
| - /// Deprecated: use new Element.tag(tagName) instead.
|
| @DomName('Document.createElement')
|
| @DocsEditable()
|
| Element _createElement(String localName_OR_tagName, [String typeExtension]) native;
|
| @@ -28644,11 +28643,17 @@ class _EventStreamSubscription<T extends Event> extends StreamSubscription<T> {
|
| var _onData;
|
| final bool _useCapture;
|
|
|
| - _EventStreamSubscription(this._target, this._eventType, this._onData,
|
| - this._useCapture) {
|
| + _EventStreamSubscription(this._target, this._eventType, onData,
|
| + this._useCapture) : _onData = _wrapZone(onData) {
|
| _tryResume();
|
| }
|
|
|
| + static _wrapZone(callback) {
|
| + // For performance reasons avoid wrapping if we are in the root zone.
|
| + if (Zone.current == Zone.ROOT) return callback;
|
| + return Zone.current.bindUnaryCallback(callback, runGuarded: true);
|
| + }
|
| +
|
| void cancel() {
|
| if (_canceled) return;
|
|
|
| @@ -28667,7 +28672,7 @@ class _EventStreamSubscription<T extends Event> extends StreamSubscription<T> {
|
| // Remove current event listener.
|
| _unlisten();
|
|
|
| - _onData = handleData;
|
| + _onData = _wrapZone(handleData);
|
| _tryResume();
|
| }
|
|
|
|
|