| OLD | NEW |
| 1 // Copyright (c) 2012 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'); |
| 11 | 11 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 /** @domName title */ | 75 /** @domName title */ |
| 76 void set title(String value) { _documentPtr.title = value; } | 76 void set title(String value) { _documentPtr.title = value; } |
| 77 | 77 |
| 78 /** @domName webkitHidden */ | 78 /** @domName webkitHidden */ |
| 79 bool get webkitHidden() => _documentPtr.webkitHidden; | 79 bool get webkitHidden() => _documentPtr.webkitHidden; |
| 80 | 80 |
| 81 /** @domName webkitVisibilityState */ | 81 /** @domName webkitVisibilityState */ |
| 82 String get webkitVisibilityState() => _documentPtr.webkitVisibilityState; | 82 String get webkitVisibilityState() => _documentPtr.webkitVisibilityState; |
| 83 | 83 |
| 84 /** @domName caretRangeFromPoint */ | 84 /** @domName caretRangeFromPoint */ |
| 85 Range caretRangeFromPoint([int x = null, int y = null]) { | 85 Future<Range> caretRangeFromPoint([int x = null, int y = null]) { |
| 86 assert(_inMeasurementFrame); | 86 return _createMeasurementFuture( |
| 87 return LevelDom.wrapRange(_documentPtr.caretRangeFromPoint(x, y)); | 87 () => LevelDom.wrapRange(_documentPtr.caretRangeFromPoint(x, y)), |
| 88 new Completer<Range>()); |
| 88 } | 89 } |
| 89 | 90 |
| 90 /** @domName createEvent */ | 91 /** @domName createEvent */ |
| 91 Event createEvent(String eventType) { | 92 Event createEvent(String eventType) { |
| 92 return LevelDom.wrapEvent(_documentPtr.createEvent(eventType)); | 93 return LevelDom.wrapEvent(_documentPtr.createEvent(eventType)); |
| 93 } | 94 } |
| 94 | 95 |
| 95 /** @domName elementFromPoint */ | 96 /** @domName elementFromPoint */ |
| 96 Element elementFromPoint([int x = null, int y = null]) { | 97 Future<Element> elementFromPoint([int x = null, int y = null]) { |
| 97 assert(_inMeasurementFrame); | 98 return _createMeasurementFuture( |
| 98 return LevelDom.wrapElement(_documentPtr.elementFromPoint(x, y)); | 99 () => LevelDom.wrapElement(_documentPtr.elementFromPoint(x, y)), |
| 100 new Completer<Element>()); |
| 99 } | 101 } |
| 100 | 102 |
| 101 /** @domName execCommand */ | 103 /** @domName execCommand */ |
| 102 bool execCommand([String command = null, bool userInterface = null, String val
ue = null]) { | 104 bool execCommand([String command = null, bool userInterface = null, String val
ue = null]) { |
| 103 assert(!_inMeasurementFrame); | |
| 104 return _documentPtr.execCommand(command, userInterface, value); | 105 return _documentPtr.execCommand(command, userInterface, value); |
| 105 } | 106 } |
| 106 | 107 |
| 107 /** @domName getCSSCanvasContext */ | 108 /** @domName getCSSCanvasContext */ |
| 108 CanvasRenderingContext getCSSCanvasContext(String contextId, String name, | 109 CanvasRenderingContext getCSSCanvasContext(String contextId, String name, |
| 109 int width, int height) { | 110 int width, int height) { |
| 110 return LevelDom.wrapCanvasRenderingContext(_documentPtr.getCSSCanvasContext(
contextId, name, width, height)); | 111 return LevelDom.wrapCanvasRenderingContext(_documentPtr.getCSSCanvasContext(
contextId, name, width, height)); |
| 111 } | 112 } |
| 112 | 113 |
| 113 /** @domName queryCommandEnabled */ | 114 /** @domName queryCommandEnabled */ |
| (...skipping 18 matching lines...) Expand all Loading... |
| 132 | 133 |
| 133 /** @domName queryCommandValue */ | 134 /** @domName queryCommandValue */ |
| 134 String queryCommandValue([String command = null]) { | 135 String queryCommandValue([String command = null]) { |
| 135 return _documentPtr.queryCommandValue(command); | 136 return _documentPtr.queryCommandValue(command); |
| 136 } | 137 } |
| 137 | 138 |
| 138 /** @domName HTMLHtmlElement.manifest */ | 139 /** @domName HTMLHtmlElement.manifest */ |
| 139 String get manifest() => _ptr.manifest; | 140 String get manifest() => _ptr.manifest; |
| 140 | 141 |
| 141 /** @domName HTMLHtmlElement.manifest */ | 142 /** @domName HTMLHtmlElement.manifest */ |
| 142 void set manifest(String value) { | 143 void set manifest(String value) { _ptr.manifest = value; } |
| 143 assert(!_inMeasurementFrame); | |
| 144 _ptr.manifest = value; | |
| 145 } | |
| 146 | 144 |
| 147 DocumentEvents get on() { | 145 DocumentEvents get on() { |
| 148 if (_on === null) { | 146 if (_on === null) { |
| 149 _on = new DocumentEventsImplementation._wrap(_documentPtr); | 147 _on = new DocumentEventsImplementation._wrap(_documentPtr); |
| 150 } | 148 } |
| 151 return _on; | 149 return _on; |
| 152 } | 150 } |
| 153 } | 151 } |
| OLD | NEW |