| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 class DocumentEventsImplementation extends ElementEventsImplementation | 5 class DocumentEventsImplementation extends ElementEventsImplementation |
| 6 implements DocumentEvents { | 6 implements DocumentEvents { |
| 7 | 7 |
| 8 DocumentEventsImplementation._wrap(_ptr) : super._wrap(_ptr); | 8 DocumentEventsImplementation._wrap(_ptr) : super._wrap(_ptr); |
| 9 | 9 |
| 10 EventListenerList get readyStateChange() => _get('readystatechange'); | 10 EventListenerList get readyStateChange() => _get('readystatechange'); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 StyleSheetList get styleSheets() => LevelDom.wrapStyleSheetList(_documentPtr.s
tyleSheets); | 57 StyleSheetList get styleSheets() => LevelDom.wrapStyleSheetList(_documentPtr.s
tyleSheets); |
| 58 | 58 |
| 59 String get title() => _documentPtr.title; | 59 String get title() => _documentPtr.title; |
| 60 | 60 |
| 61 void set title(String value) { _documentPtr.title = value; } | 61 void set title(String value) { _documentPtr.title = value; } |
| 62 | 62 |
| 63 bool get webkitHidden() => _documentPtr.webkitHidden; | 63 bool get webkitHidden() => _documentPtr.webkitHidden; |
| 64 | 64 |
| 65 String get webkitVisibilityState() => _documentPtr.webkitVisibilityState; | 65 String get webkitVisibilityState() => _documentPtr.webkitVisibilityState; |
| 66 | 66 |
| 67 Promise<Range> caretRangeFromPoint([int x = null, int y = null]) { | 67 Future<Range> caretRangeFromPoint([int x = null, int y = null]) { |
| 68 throw 'TODO(jacobr): impl promise.'; | 68 return _createMeasurementFuture( |
| 69 // return LevelDom.wrapRange(_documentPtr.caretRangeFromPoint(x, y)); | 69 () => LevelDom.wrapRange(_documentPtr.caretRangeFromPoint(x, y)), |
| 70 new Completer<Range>()); |
| 70 } | 71 } |
| 71 | 72 |
| 72 Element createElement([String tagName = null]) { | 73 Element createElement([String tagName = null]) { |
| 73 return LevelDom.wrapElement(_documentPtr.createElement(tagName)); | 74 return LevelDom.wrapElement(_documentPtr.createElement(tagName)); |
| 74 } | 75 } |
| 75 | 76 |
| 76 Event createEvent([String eventType = null]) { | 77 Event createEvent([String eventType = null]) { |
| 77 return LevelDom.wrapEvent(_documentPtr.createEvent(eventType)); | 78 return LevelDom.wrapEvent(_documentPtr.createEvent(eventType)); |
| 78 } | 79 } |
| 79 | 80 |
| 80 Promise<Element> elementFromPoint([int x = null, int y = null]) { | 81 Future<Element> elementFromPoint([int x = null, int y = null]) { |
| 81 throw 'TODO(jacobr): impl using promise'; | 82 return _createMeasurementFuture( |
| 82 // return LevelDom.wrapElement(_documentPtr.elementFromPoint(x, y)); | 83 () => LevelDom.wrapElement(_documentPtr.elementFromPoint(x, y)), |
| 84 new Completer<Element>()); |
| 83 } | 85 } |
| 84 | 86 |
| 85 bool execCommand([String command = null, bool userInterface = null, String val
ue = null]) { | 87 bool execCommand([String command = null, bool userInterface = null, String val
ue = null]) { |
| 86 return _documentPtr.execCommand(command, userInterface, value); | 88 return _documentPtr.execCommand(command, userInterface, value); |
| 87 } | 89 } |
| 88 | 90 |
| 89 CanvasRenderingContext getCSSCanvasContext(String contextId, String name, | 91 CanvasRenderingContext getCSSCanvasContext(String contextId, String name, |
| 90 int width, int height) { | 92 int width, int height) { |
| 91 return LevelDom.wrapCanvasRenderingContext(_documentPtr.getCSSCanvasContext(
contextId, name, width, height)); | 93 return LevelDom.wrapCanvasRenderingContext(_documentPtr.getCSSCanvasContext(
contextId, name, width, height)); |
| 92 } | 94 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 115 | 117 |
| 116 void set manifest(String value) { _ptr.manifest = value; } | 118 void set manifest(String value) { _ptr.manifest = value; } |
| 117 | 119 |
| 118 DocumentEvents get on() { | 120 DocumentEvents get on() { |
| 119 if (_on === null) { | 121 if (_on === null) { |
| 120 _on = new DocumentEventsImplementation._wrap(_ptr); | 122 _on = new DocumentEventsImplementation._wrap(_ptr); |
| 121 } | 123 } |
| 122 return _on; | 124 return _on; |
| 123 } | 125 } |
| 124 } | 126 } |
| OLD | NEW |