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

Unified Diff: client/html/src/DocumentWrappingImplementation.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/DocumentWrappingImplementation.dart
diff --git a/client/html/src/DocumentWrappingImplementation.dart b/client/html/src/DocumentWrappingImplementation.dart
index 8db883f8b49694e1091e7478cf6acf8e77b39f92..0ff1802cde909bef23db141c8f3c05c1b8c35a18 100644
--- a/client/html/src/DocumentWrappingImplementation.dart
+++ b/client/html/src/DocumentWrappingImplementation.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.
@@ -82,10 +82,9 @@ class DocumentWrappingImplementation extends ElementWrappingImplementation imple
String get webkitVisibilityState() => _documentPtr.webkitVisibilityState;
/** @domName caretRangeFromPoint */
- Future<Range> caretRangeFromPoint([int x = null, int y = null]) {
- return _createMeasurementFuture(
- () => LevelDom.wrapRange(_documentPtr.caretRangeFromPoint(x, y)),
- new Completer<Range>());
+ Range caretRangeFromPoint([int x = null, int y = null]) {
+ assert(_inMeasurementFrame);
+ return LevelDom.wrapRange(_documentPtr.caretRangeFromPoint(x, y));
}
/** @domName createEvent */
@@ -94,14 +93,14 @@ class DocumentWrappingImplementation extends ElementWrappingImplementation imple
}
/** @domName elementFromPoint */
- Future<Element> elementFromPoint([int x = null, int y = null]) {
- return _createMeasurementFuture(
- () => LevelDom.wrapElement(_documentPtr.elementFromPoint(x, y)),
- new Completer<Element>());
+ Element elementFromPoint([int x = null, int y = null]) {
+ assert(_inMeasurementFrame);
+ return LevelDom.wrapElement(_documentPtr.elementFromPoint(x, y));
}
/** @domName execCommand */
bool execCommand([String command = null, bool userInterface = null, String value = null]) {
+ assert(!_inMeasurementFrame);
return _documentPtr.execCommand(command, userInterface, value);
}
@@ -140,7 +139,10 @@ class DocumentWrappingImplementation extends ElementWrappingImplementation imple
String get manifest() => _ptr.manifest;
/** @domName HTMLHtmlElement.manifest */
- void set manifest(String value) { _ptr.manifest = value; }
+ void set manifest(String value) {
+ assert(!_inMeasurementFrame);
+ _ptr.manifest = value;
+ }
DocumentEvents get on() {
if (_on === null) {

Powered by Google App Engine
This is Rietveld 408576698