Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2658)

Unified Diff: sdk/lib/html/dartium/html_dartium.dart

Issue 54913005: Fixing the BeforeUnloadEvent (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
Download patch
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | tools/dom/dom.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 302dad684f31a437f8132f26f2b5f713bf372957..5681bb058bd90458876dbd9ef938cf28a649ee0c 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -753,11 +753,18 @@ class BeforeLoadEvent extends Event {
@DocsEditable()
@DomName('BeforeUnloadEvent')
-@Experimental() // untriaged
class BeforeUnloadEvent extends Event {
// To suppress missing implicit constructor warnings.
factory BeforeUnloadEvent._() { throw new UnsupportedError("Not supported"); }
+ @DomName('BeforeUnloadEvent.returnValue')
+ @DocsEditable()
+ String get returnValue native "BeforeUnloadEvent_returnValue_Getter";
+
+ @DomName('BeforeUnloadEvent.returnValue')
+ @DocsEditable()
+ void set returnValue(String value) native "BeforeUnloadEvent_returnValue_Setter";
+
}
// 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
@@ -25605,13 +25612,13 @@ class Url extends NativeFieldWrapperClass2 {
if ((blob_OR_source_OR_stream is Blob || blob_OR_source_OR_stream == null)) {
return _createObjectURL_1(blob_OR_source_OR_stream);
}
- if ((blob_OR_source_OR_stream is MediaSource || blob_OR_source_OR_stream == null)) {
+ if ((blob_OR_source_OR_stream is MediaStream || blob_OR_source_OR_stream == null)) {
return _createObjectURL_2(blob_OR_source_OR_stream);
}
- if ((blob_OR_source_OR_stream is _WebKitMediaSource || blob_OR_source_OR_stream == null)) {
+ if ((blob_OR_source_OR_stream is MediaSource || blob_OR_source_OR_stream == null)) {
return _createObjectURL_3(blob_OR_source_OR_stream);
}
- if ((blob_OR_source_OR_stream is MediaStream || blob_OR_source_OR_stream == null)) {
+ if ((blob_OR_source_OR_stream is _WebKitMediaSource || blob_OR_source_OR_stream == null)) {
return _createObjectURL_4(blob_OR_source_OR_stream);
}
throw new ArgumentError("Incorrect number or type of arguments");
@@ -27028,17 +27035,6 @@ class Window extends EventTarget implements WindowBase, _WindowTimers, WindowBas
}
-class _BeforeUnloadEvent extends _WrappedEvent implements BeforeUnloadEvent {
- String _returnValue;
-
- _BeforeUnloadEvent(Event base): super(base);
-
- String get returnValue => _returnValue;
-
- void set returnValue(String value) {
- _returnValue = value;
- }
-}
class _BeforeUnloadEventStreamProvider implements
EventStreamProvider<BeforeUnloadEvent> {
@@ -27047,15 +27043,8 @@ class _BeforeUnloadEventStreamProvider implements
const _BeforeUnloadEventStreamProvider(this._eventType);
Stream<BeforeUnloadEvent> forTarget(EventTarget e, {bool useCapture: false}) {
- var controller = new StreamController(sync: true);
var stream = new _EventStream(e, _eventType, useCapture);
- stream.listen((event) {
- var wrapped = new _BeforeUnloadEvent(event);
- controller.add(wrapped);
- return wrapped.returnValue;
- });
-
- return controller.stream;
+ return stream;
}
String getEventType(EventTarget target) {
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | tools/dom/dom.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698