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

Unified Diff: client/html/src/DocumentFragmentWrappingImplementation.dart

Issue 9148015: Example showing alternate async measurement solution (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Final version Created 8 years, 11 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:
View side-by-side diff with in-line comments
Download patch
Index: client/html/src/DocumentFragmentWrappingImplementation.dart
diff --git a/client/html/src/DocumentFragmentWrappingImplementation.dart b/client/html/src/DocumentFragmentWrappingImplementation.dart
index 612c3f1a9a953a7b362d7ca7c2626473388dc904..41bb7d184e4a24564916ea4dc20afcde8d9a7ee9 100644
--- a/client/html/src/DocumentFragmentWrappingImplementation.dart
+++ b/client/html/src/DocumentFragmentWrappingImplementation.dart
@@ -1,4 +1,4 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// 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.
@@ -132,11 +132,6 @@ class EmptyStyleDeclaration extends CSSStyleDeclarationWrappingImplementation {
}
}
-Future<CSSStyleDeclaration> _emptyStyleFuture() {
- return _createMeasurementFuture(() => new EmptyStyleDeclaration(),
- new Completer<CSSStyleDeclaration>());
-}
-
class EmptyElementRect implements ElementRect {
final ClientRect client = const SimpleClientRect(0, 0, 0, 0);
final ClientRect offset = const SimpleClientRect(0, 0, 0, 0);
@@ -234,9 +229,10 @@ class DocumentFragmentWrappingImplementation extends NodeWrappingImplementation
return _on;
}
- Future<ElementRect> get rect() {
- return _createMeasurementFuture(() => const EmptyElementRect(),
- new Completer<ElementRect>());
+ ElementRect get rect() {
+ // A document fragment can never be attached to a Document so it always
+ // safe to measure.
+ return const EmptyElementRect();
}
Element query(String selectors) =>
@@ -269,10 +265,9 @@ class DocumentFragmentWrappingImplementation extends NodeWrappingImplementation
Set<String> get classes() => new Set<String>();
Map<String, String> get dataAttributes() => const {};
CSSStyleDeclaration get style() => new EmptyStyleDeclaration();
- Future<CSSStyleDeclaration> get computedStyle() =>
- _emptyStyleFuture();
- Future<CSSStyleDeclaration> getComputedStyle(String pseudoElement) =>
- _emptyStyleFuture();
+ CSSStyleDeclaration get computedStyle() => new EmptyStyleDeclaration();
+ CSSStyleDeclaration getComputedStyle(String pseudoElement) =>
+ new EmptyStyleDeclaration();
bool matchesSelector([String selectors]) => false;
// Imperative Element methods are made into no-ops, as they are on parentless

Powered by Google App Engine
This is Rietveld 408576698