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