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

Unified Diff: sdk/lib/html/dart2js/html_dart2js.dart

Issue 11647044: Adding annotation for partial browser support and example implementation for MutationObservers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added experimental annotation to MutationObserver. Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 43b50e90b050427a51bd400d26809979b3513f92..24c3367eec70f9285f2975c7c82c5c08a9105f58 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -13265,6 +13265,10 @@ class MutationEvent extends Event native "*MutationEvent" {
/// @domName MutationObserver
+@SupportedBrowser(SupportedBrowser.CHROME)
+@SupportedBrowser(SupportedBrowser.FIREFOX)
+@SupportedBrowser(SupportedBrowser.SAFARI)
+@Experimental()
class MutationObserver native "*MutationObserver" {
///@docsEditable true
@@ -13285,6 +13289,15 @@ class MutationObserver native "*MutationObserver" {
/// @domName MutationObserver.takeRecords; @docsEditable true
List<MutationRecord> takeRecords() native;
+ /**
+ * Checks to see if the mutation observer API is supported on the current
+ * platform.
+ */
+ static bool get supported {
+ return JS('bool',
+ '!!(window.MutationObserver || window.WebKitMutationObserver)');
+ }
+
void observe(Node target,
{Map options,
bool childList,
@@ -24680,7 +24693,6 @@ class _MeasurementRequest<T> {
typedef void _MeasurementCallback();
-
/**
* This class attempts to invoke a callback as soon as the current event stack
* unwinds, but before the browser repaints.
@@ -24695,7 +24707,7 @@ abstract class _MeasurementScheduler {
* Creates the best possible measurement scheduler for the current platform.
*/
factory _MeasurementScheduler.best(_MeasurementCallback callback) {
- if (_isMutationObserverSupported()) {
+ if (MutationObserver.supported) {
return new _MutationObserverScheduler(callback);
}
return new _PostMessageScheduler(callback);
@@ -25524,17 +25536,6 @@ class _LocationWrapper implements Location {
// BSD-style license that can be found in the LICENSE file.
-/**
- * Checks to see if the mutation observer API is supported on the current
- * platform.
- */
-bool _isMutationObserverSupported() =>
- JS('bool', '!!(window.MutationObserver || window.WebKitMutationObserver)');
-// 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.
-
-
class _TypedArrayFactoryProvider {
static Float32Array createFloat32Array(int length) => _F32(length);
« no previous file with comments | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698