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

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: Ready for review 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 91b77e1ff0a633c6043df7ab141ee507b5efe7c1..b0f30aab52a0291fac6b28006efb805f18a355b4 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.
@@ -52,7 +52,10 @@ class DocumentWrappingImplementation extends ElementWrappingImplementation imple
Window get window() => LevelDom.wrapWindow(_documentPtr.defaultView);
/** @domName designMode */
- void set designMode(String value) { _documentPtr.dynamic.designMode = value; }
+ void set designMode(String value) {
+ assert(!_inMeasurementFrame);
+ _documentPtr.dynamic.designMode = value;
+ }
/** @domName domain */
String get domain() => _documentPtr.domain;
@@ -85,10 +88,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 */
@@ -97,14 +99,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);
}
@@ -143,7 +145,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