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

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

Issue 23987002: Fixing visibilityState APIs in Dart (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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
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 5418dfc68d7e8e92072ecf79f9f5d65976b18386..222c8552202d1d6346c22655af186b763acce79b 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -13268,9 +13268,10 @@ class HtmlDocument extends Document {
Element get pointerLockElement =>
_webkitPointerLockElement;
- @DomName('Document.webkitVisibilityState')
+ @DomName('Document.visibilityState')
@SupportedBrowser(SupportedBrowser.CHROME)
- @SupportedBrowser(SupportedBrowser.SAFARI)
+ @SupportedBrowser(SupportedBrowser.FIREFOX)
+ @SupportedBrowser(SupportedBrowser.IE, '10')
@Experimental()
String get visibilityState => _webkitVisibilityState;
@@ -13281,6 +13282,26 @@ class HtmlDocument extends Document {
// Note: used to polyfill <template>
Document _templateContentsOwner;
+
+ @DomName('Document.visibilityChange')
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.FIREFOX)
+ @SupportedBrowser(SupportedBrowser.IE, '10')
+ @Experimental()
+ static const EventStreamProvider<Event> visibilityChangeEvent =
+ const _CustomEventStreamProvider<Event>(
+ _determineVisibilityChangeEventType);
+
+ static String _determineVisibilityChangeEventType(EventTarget e) {
+ return 'webkitvisibilitychange';
+ }
+
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.FIREFOX)
+ @SupportedBrowser(SupportedBrowser.IE, '10')
+ @Experimental()
+ Stream<Event> get onVisibilityChange =>
+ visibilityChangeEvent.forTarget(this);
}
// 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
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | tools/dom/templates/html/impl/impl_HTMLDocument.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698