| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 class DocumentEventsImplementation extends ElementEventsImplementation | |
| 6 implements DocumentEvents { | |
| 7 | |
| 8 DocumentEventsImplementation._wrap(_ptr) : super._wrap(_ptr); | |
| 9 | |
| 10 EventListenerList get readyStateChange() => _get('readystatechange'); | |
| 11 | |
| 12 EventListenerList get selectionChange() => _get('selectionchange'); | |
| 13 | |
| 14 EventListenerList get contentLoaded() => _get('DOMContentLoaded'); | |
| 15 } | |
| 16 | |
| 17 /** @domName Document, HTMLDocument */ | |
| 18 class DocumentWrappingImplementation extends ElementWrappingImplementation imple
ments Document { | |
| 19 | |
| 20 final _documentPtr; | |
| 21 | |
| 22 DocumentWrappingImplementation._wrap(this._documentPtr, ptr) : super._wrap(ptr
) { | |
| 23 // We have to set the back ptr on the document as well as the documentElemen
t | |
| 24 // so that it is always simple to detect when an existing wrapper exists. | |
| 25 _documentPtr.dynamic.dartObjectLocalStorage = this; | |
| 26 } | |
| 27 | |
| 28 /** @domName activeElement */ | |
| 29 Element get activeElement() => LevelDom.wrapElement(_documentPtr.dynamic.activ
eElement); | |
| 30 | |
| 31 Node get parent() => null; | |
| 32 | |
| 33 /** @domName body */ | |
| 34 Element get body() => LevelDom.wrapElement(_documentPtr.body); | |
| 35 | |
| 36 /** @domName body */ | |
| 37 void set body(Element value) { _documentPtr.body = LevelDom.unwrap(value); } | |
| 38 | |
| 39 /** @domName charset */ | |
| 40 String get charset() => _documentPtr.charset; | |
| 41 | |
| 42 /** @domName charset */ | |
| 43 void set charset(String value) { _documentPtr.charset = value; } | |
| 44 | |
| 45 /** @domName cookie */ | |
| 46 String get cookie() => _documentPtr.cookie; | |
| 47 | |
| 48 /** @domName cookie */ | |
| 49 void set cookie(String value) { _documentPtr.cookie = value; } | |
| 50 | |
| 51 /** @domName defaultView */ | |
| 52 Window get window() => LevelDom.wrapWindow(_documentPtr.defaultView); | |
| 53 | |
| 54 /** @domName domain */ | |
| 55 String get domain() => _documentPtr.domain; | |
| 56 | |
| 57 /** @domName head */ | |
| 58 HeadElement get head() => LevelDom.wrapHeadElement(_documentPtr.head); | |
| 59 | |
| 60 /** @domName lastModified */ | |
| 61 String get lastModified() => _documentPtr.lastModified; | |
| 62 | |
| 63 /** @domName readyState */ | |
| 64 String get readyState() => _documentPtr.readyState; | |
| 65 | |
| 66 /** @domName referrer */ | |
| 67 String get referrer() => _documentPtr.referrer; | |
| 68 | |
| 69 /** @domName styleSheets */ | |
| 70 StyleSheetList get styleSheets() => LevelDom.wrapStyleSheetList(_documentPtr.s
tyleSheets); | |
| 71 | |
| 72 /** @domName title */ | |
| 73 String get title() => _documentPtr.title; | |
| 74 | |
| 75 /** @domName title */ | |
| 76 void set title(String value) { _documentPtr.title = value; } | |
| 77 | |
| 78 /** @domName webkitHidden */ | |
| 79 bool get webkitHidden() => _documentPtr.webkitHidden; | |
| 80 | |
| 81 /** @domName webkitVisibilityState */ | |
| 82 String get webkitVisibilityState() => _documentPtr.webkitVisibilityState; | |
| 83 | |
| 84 /** @domName caretRangeFromPoint */ | |
| 85 Future<Range> caretRangeFromPoint([int x = null, int y = null]) { | |
| 86 return _createMeasurementFuture( | |
| 87 () => LevelDom.wrapRange(_documentPtr.caretRangeFromPoint(x, y)), | |
| 88 new Completer<Range>()); | |
| 89 } | |
| 90 | |
| 91 /** @domName createEvent */ | |
| 92 Event createEvent(String eventType) { | |
| 93 return LevelDom.wrapEvent(_documentPtr.createEvent(eventType)); | |
| 94 } | |
| 95 | |
| 96 /** @domName elementFromPoint */ | |
| 97 Future<Element> elementFromPoint([int x = null, int y = null]) { | |
| 98 return _createMeasurementFuture( | |
| 99 () => LevelDom.wrapElement(_documentPtr.elementFromPoint(x, y)), | |
| 100 new Completer<Element>()); | |
| 101 } | |
| 102 | |
| 103 /** @domName execCommand */ | |
| 104 bool execCommand([String command = null, bool userInterface = null, String val
ue = null]) { | |
| 105 return _documentPtr.execCommand(command, userInterface, value); | |
| 106 } | |
| 107 | |
| 108 /** @domName getCSSCanvasContext */ | |
| 109 CanvasRenderingContext getCSSCanvasContext(String contextId, String name, | |
| 110 int width, int height) { | |
| 111 return LevelDom.wrapCanvasRenderingContext(_documentPtr.getCSSCanvasContext(
contextId, name, width, height)); | |
| 112 } | |
| 113 | |
| 114 /** @domName queryCommandEnabled */ | |
| 115 bool queryCommandEnabled([String command = null]) { | |
| 116 return _documentPtr.queryCommandEnabled(command); | |
| 117 } | |
| 118 | |
| 119 /** @domName queryCommandIndeterm */ | |
| 120 bool queryCommandIndeterm([String command = null]) { | |
| 121 return _documentPtr.queryCommandIndeterm(command); | |
| 122 } | |
| 123 | |
| 124 /** @domName queryCommandState */ | |
| 125 bool queryCommandState([String command = null]) { | |
| 126 return _documentPtr.queryCommandState(command); | |
| 127 } | |
| 128 | |
| 129 /** @domName queryCommandSupported */ | |
| 130 bool queryCommandSupported([String command = null]) { | |
| 131 return _documentPtr.queryCommandSupported(command); | |
| 132 } | |
| 133 | |
| 134 /** @domName queryCommandValue */ | |
| 135 String queryCommandValue([String command = null]) { | |
| 136 return _documentPtr.queryCommandValue(command); | |
| 137 } | |
| 138 | |
| 139 /** @domName HTMLHtmlElement.manifest */ | |
| 140 String get manifest() => _ptr.manifest; | |
| 141 | |
| 142 /** @domName HTMLHtmlElement.manifest */ | |
| 143 void set manifest(String value) { _ptr.manifest = value; } | |
| 144 | |
| 145 DocumentEvents get on() { | |
| 146 if (_on === null) { | |
| 147 _on = new DocumentEventsImplementation._wrap(_documentPtr); | |
| 148 } | |
| 149 return _on; | |
| 150 } | |
| 151 } | |
| OLD | NEW |