| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 /** @domName cookie */ | 45 /** @domName cookie */ |
| 46 String get cookie() => _documentPtr.cookie; | 46 String get cookie() => _documentPtr.cookie; |
| 47 | 47 |
| 48 /** @domName cookie */ | 48 /** @domName cookie */ |
| 49 void set cookie(String value) { _documentPtr.cookie = value; } | 49 void set cookie(String value) { _documentPtr.cookie = value; } |
| 50 | 50 |
| 51 /** @domName defaultView */ | 51 /** @domName defaultView */ |
| 52 Window get window() => LevelDom.wrapWindow(_documentPtr.defaultView); | 52 Window get window() => LevelDom.wrapWindow(_documentPtr.defaultView); |
| 53 | 53 |
| 54 /** @domName designMode */ | 54 /** @domName designMode */ |
| 55 void set designMode(String value) { _documentPtr.dynamic.designMode = value; } | 55 void set designMode(String value) { |
| 56 assert(!_inMeasurementFrame); |
| 57 _documentPtr.dynamic.designMode = value; |
| 58 } |
| 56 | 59 |
| 57 /** @domName domain */ | 60 /** @domName domain */ |
| 58 String get domain() => _documentPtr.domain; | 61 String get domain() => _documentPtr.domain; |
| 59 | 62 |
| 60 /** @domName head */ | 63 /** @domName head */ |
| 61 HeadElement get head() => LevelDom.wrapHeadElement(_documentPtr.head); | 64 HeadElement get head() => LevelDom.wrapHeadElement(_documentPtr.head); |
| 62 | 65 |
| 63 /** @domName lastModified */ | 66 /** @domName lastModified */ |
| 64 String get lastModified() => _documentPtr.lastModified; | 67 String get lastModified() => _documentPtr.lastModified; |
| 65 | 68 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 78 /** @domName title */ | 81 /** @domName title */ |
| 79 void set title(String value) { _documentPtr.title = value; } | 82 void set title(String value) { _documentPtr.title = value; } |
| 80 | 83 |
| 81 /** @domName webkitHidden */ | 84 /** @domName webkitHidden */ |
| 82 bool get webkitHidden() => _documentPtr.webkitHidden; | 85 bool get webkitHidden() => _documentPtr.webkitHidden; |
| 83 | 86 |
| 84 /** @domName webkitVisibilityState */ | 87 /** @domName webkitVisibilityState */ |
| 85 String get webkitVisibilityState() => _documentPtr.webkitVisibilityState; | 88 String get webkitVisibilityState() => _documentPtr.webkitVisibilityState; |
| 86 | 89 |
| 87 /** @domName caretRangeFromPoint */ | 90 /** @domName caretRangeFromPoint */ |
| 88 Future<Range> caretRangeFromPoint([int x = null, int y = null]) { | 91 Range caretRangeFromPoint([int x = null, int y = null]) { |
| 89 return _createMeasurementFuture( | 92 assert(_inMeasurementFrame); |
| 90 () => LevelDom.wrapRange(_documentPtr.caretRangeFromPoint(x, y)), | 93 return LevelDom.wrapRange(_documentPtr.caretRangeFromPoint(x, y)); |
| 91 new Completer<Range>()); | |
| 92 } | 94 } |
| 93 | 95 |
| 94 /** @domName createEvent */ | 96 /** @domName createEvent */ |
| 95 Event createEvent(String eventType) { | 97 Event createEvent(String eventType) { |
| 96 return LevelDom.wrapEvent(_documentPtr.createEvent(eventType)); | 98 return LevelDom.wrapEvent(_documentPtr.createEvent(eventType)); |
| 97 } | 99 } |
| 98 | 100 |
| 99 /** @domName elementFromPoint */ | 101 /** @domName elementFromPoint */ |
| 100 Future<Element> elementFromPoint([int x = null, int y = null]) { | 102 Element elementFromPoint([int x = null, int y = null]) { |
| 101 return _createMeasurementFuture( | 103 assert(_inMeasurementFrame); |
| 102 () => LevelDom.wrapElement(_documentPtr.elementFromPoint(x, y)), | 104 return LevelDom.wrapElement(_documentPtr.elementFromPoint(x, y)); |
| 103 new Completer<Element>()); | |
| 104 } | 105 } |
| 105 | 106 |
| 106 /** @domName execCommand */ | 107 /** @domName execCommand */ |
| 107 bool execCommand([String command = null, bool userInterface = null, String val
ue = null]) { | 108 bool execCommand([String command = null, bool userInterface = null, String val
ue = null]) { |
| 109 assert(!_inMeasurementFrame); |
| 108 return _documentPtr.execCommand(command, userInterface, value); | 110 return _documentPtr.execCommand(command, userInterface, value); |
| 109 } | 111 } |
| 110 | 112 |
| 111 /** @domName getCSSCanvasContext */ | 113 /** @domName getCSSCanvasContext */ |
| 112 CanvasRenderingContext getCSSCanvasContext(String contextId, String name, | 114 CanvasRenderingContext getCSSCanvasContext(String contextId, String name, |
| 113 int width, int height) { | 115 int width, int height) { |
| 114 return LevelDom.wrapCanvasRenderingContext(_documentPtr.getCSSCanvasContext(
contextId, name, width, height)); | 116 return LevelDom.wrapCanvasRenderingContext(_documentPtr.getCSSCanvasContext(
contextId, name, width, height)); |
| 115 } | 117 } |
| 116 | 118 |
| 117 /** @domName queryCommandEnabled */ | 119 /** @domName queryCommandEnabled */ |
| (...skipping 18 matching lines...) Expand all Loading... |
| 136 | 138 |
| 137 /** @domName queryCommandValue */ | 139 /** @domName queryCommandValue */ |
| 138 String queryCommandValue([String command = null]) { | 140 String queryCommandValue([String command = null]) { |
| 139 return _documentPtr.queryCommandValue(command); | 141 return _documentPtr.queryCommandValue(command); |
| 140 } | 142 } |
| 141 | 143 |
| 142 /** @domName HTMLHtmlElement.manifest */ | 144 /** @domName HTMLHtmlElement.manifest */ |
| 143 String get manifest() => _ptr.manifest; | 145 String get manifest() => _ptr.manifest; |
| 144 | 146 |
| 145 /** @domName HTMLHtmlElement.manifest */ | 147 /** @domName HTMLHtmlElement.manifest */ |
| 146 void set manifest(String value) { _ptr.manifest = value; } | 148 void set manifest(String value) { |
| 149 assert(!_inMeasurementFrame); |
| 150 _ptr.manifest = value; |
| 151 } |
| 147 | 152 |
| 148 DocumentEvents get on() { | 153 DocumentEvents get on() { |
| 149 if (_on === null) { | 154 if (_on === null) { |
| 150 _on = new DocumentEventsImplementation._wrap(_ptr); | 155 _on = new DocumentEventsImplementation._wrap(_ptr); |
| 151 } | 156 } |
| 152 return _on; | 157 return _on; |
| 153 } | 158 } |
| 154 } | 159 } |
| OLD | NEW |