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

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

Issue 9145004: Revert "Example showing alternate async measurement solution" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
« no previous file with comments | « client/html/src/Document.dart ('k') | client/html/src/DocumentWrappingImplementation.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/html/src/DocumentFragmentWrappingImplementation.dart
diff --git a/client/html/src/DocumentFragmentWrappingImplementation.dart b/client/html/src/DocumentFragmentWrappingImplementation.dart
index 41bb7d184e4a24564916ea4dc20afcde8d9a7ee9..612c3f1a9a953a7b362d7ca7c2626473388dc904 100644
--- a/client/html/src/DocumentFragmentWrappingImplementation.dart
+++ b/client/html/src/DocumentFragmentWrappingImplementation.dart
@@ -1,4 +1,4 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2011, 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,6 +132,11 @@ 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);
@@ -229,10 +234,9 @@ class DocumentFragmentWrappingImplementation extends NodeWrappingImplementation
return _on;
}
- ElementRect get rect() {
- // A document fragment can never be attached to a Document so it always
- // safe to measure.
- return const EmptyElementRect();
+ Future<ElementRect> get rect() {
+ return _createMeasurementFuture(() => const EmptyElementRect(),
+ new Completer<ElementRect>());
}
Element query(String selectors) =>
@@ -265,9 +269,10 @@ class DocumentFragmentWrappingImplementation extends NodeWrappingImplementation
Set<String> get classes() => new Set<String>();
Map<String, String> get dataAttributes() => const {};
CSSStyleDeclaration get style() => new EmptyStyleDeclaration();
- CSSStyleDeclaration get computedStyle() => new EmptyStyleDeclaration();
- CSSStyleDeclaration getComputedStyle(String pseudoElement) =>
- new EmptyStyleDeclaration();
+ Future<CSSStyleDeclaration> get computedStyle() =>
+ _emptyStyleFuture();
+ Future<CSSStyleDeclaration> getComputedStyle(String pseudoElement) =>
+ _emptyStyleFuture();
bool matchesSelector([String selectors]) => false;
// Imperative Element methods are made into no-ops, as they are on parentless
« no previous file with comments | « client/html/src/Document.dart ('k') | client/html/src/DocumentWrappingImplementation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698