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

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

Issue 8363040: Implement measurement using futures (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: take2 Created 9 years, 2 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 a05364dc5d51cf21f8d54321bfa5435ab14ad71b..e5c69c075735fd34c3ea076b167c2fec06043b41 100644
--- a/client/html/src/DocumentWrappingImplementation.dart
+++ b/client/html/src/DocumentWrappingImplementation.dart
@@ -64,9 +64,10 @@ class DocumentWrappingImplementation extends ElementWrappingImplementation imple
String get webkitVisibilityState() => _documentPtr.webkitVisibilityState;
- Promise<Range> caretRangeFromPoint([int x = null, int y = null]) {
- throw 'TODO(jacobr): impl promise.';
- // return LevelDom.wrapRange(_documentPtr.caretRangeFromPoint(x, y));
+ Future<Range> caretRangeFromPoint([int x = null, int y = null]) {
+ return _createMeasurementFuture(
+ () => LevelDom.wrapRange(_documentPtr.caretRangeFromPoint(x, y)),
+ new Completer<Range>());
}
Element createElement([String tagName = null]) {
@@ -77,9 +78,10 @@ class DocumentWrappingImplementation extends ElementWrappingImplementation imple
return LevelDom.wrapEvent(_documentPtr.createEvent(eventType));
}
- Promise<Element> elementFromPoint([int x = null, int y = null]) {
- throw 'TODO(jacobr): impl using promise';
- // return LevelDom.wrapElement(_documentPtr.elementFromPoint(x, y));
+ Future<Element> elementFromPoint([int x = null, int y = null]) {
+ return _createMeasurementFuture(
+ () => LevelDom.wrapElement(_documentPtr.elementFromPoint(x, y)),
+ new Completer<Element>());
}
bool execCommand([String command = null, bool userInterface = null, String value = null]) {

Powered by Google App Engine
This is Rietveld 408576698