Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Side by Side Diff: client/html/src/DocumentWrappingImplementation.dart

Issue 8835006: New version of dart:html (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix typos Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « client/html/src/Document.dart ('k') | client/html/src/ElementWrappingImplementation.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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');
11 11
12 EventListenerList get selectionChange() => _get('selectionchange'); 12 EventListenerList get selectionChange() => _get('selectionchange');
13 13
14 EventListenerList get contentLoaded() => _get('DOMContentLoaded'); 14 EventListenerList get contentLoaded() => _get('DOMContentLoaded');
15 } 15 }
16 16
17 class DocumentWrappingImplementation extends ElementWrappingImplementation imple ments Document { 17 class DocumentWrappingImplementation extends ElementWrappingImplementation imple ments Document {
18 18
19 final _documentPtr; 19 final dom.Document _documentPtr;
20 20
21 DocumentWrappingImplementation._wrap(this._documentPtr, ptr) : super._wrap(ptr ) { 21 DocumentWrappingImplementation._wrap(this._documentPtr, ptr) : super._wrap(ptr ) {
22 // We have to set the back ptr on the document as well as the documentElemen t 22 // We have to set the back ptr on the document as well as the documentElemen t
23 // so that it is always simple to detect when an existing wrapper exists. 23 // so that it is always simple to detect when an existing wrapper exists.
24 _documentPtr.dartObjectLocalStorage = this; 24 _documentPtr.dynamic.dartObjectLocalStorage = this;
25 } 25 }
26 26
27 /** @domName HTMLDocument.activeElement */ 27 /** @domName HTMLDocument.activeElement */
28 Element get activeElement() => LevelDom.wrapElement(_documentPtr.activeElement ); 28 Element get activeElement() => LevelDom.wrapElement(_documentPtr.dynamic.activ eElement);
29 29
30 Node get parent() => null; 30 Node get parent() => null;
31 31
32 /** @domName Document.body */ 32 /** @domName Document.body */
33 Element get body() => LevelDom.wrapElement(_documentPtr.body); 33 Element get body() => LevelDom.wrapElement(_documentPtr.body);
34 34
35 /** @domName Document.body */ 35 /** @domName Document.body */
36 void set body(Element value) { _documentPtr.body = LevelDom.unwrap(value); } 36 void set body(Element value) { _documentPtr.body = LevelDom.unwrap(value); }
37 37
38 /** @domName Document.charset */ 38 /** @domName Document.charset */
39 String get charset() => _documentPtr.charset; 39 String get charset() => _documentPtr.charset;
40 40
41 /** @domName Document.charset */ 41 /** @domName Document.charset */
42 void set charset(String value) { _documentPtr.charset = value; } 42 void set charset(String value) { _documentPtr.charset = value; }
43 43
44 /** @domName Document.cookie */ 44 /** @domName Document.cookie */
45 String get cookie() => _documentPtr.cookie; 45 String get cookie() => _documentPtr.cookie;
46 46
47 /** @domName Document.cookie */ 47 /** @domName Document.cookie */
48 void set cookie(String value) { _documentPtr.cookie = value; } 48 void set cookie(String value) { _documentPtr.cookie = value; }
49 49
50 /** @domName Document.defaultView */ 50 /** @domName Document.defaultView */
51 Window get window() => LevelDom.wrapWindow(_documentPtr.defaultView); 51 Window get window() => LevelDom.wrapWindow(_documentPtr.defaultView);
52 52
53 /** @domName HTMLDocument.designMode */ 53 /** @domName HTMLDocument.designMode */
54 void set designMode(String value) { _documentPtr.designMode = value; } 54 void set designMode(String value) { _documentPtr.dynamic.designMode = value; }
55 55
56 /** @domName Document.domain */ 56 /** @domName Document.domain */
57 String get domain() => _documentPtr.domain; 57 String get domain() => _documentPtr.domain;
58 58
59 /** @domName Document.head */ 59 /** @domName Document.head */
60 HeadElement get head() => LevelDom.wrapHeadElement(_documentPtr.head); 60 HeadElement get head() => LevelDom.wrapHeadElement(_documentPtr.head);
61 61
62 /** @domName Document.lastModified */ 62 /** @domName Document.lastModified */
63 String get lastModified() => _documentPtr.lastModified; 63 String get lastModified() => _documentPtr.lastModified;
64 64
(...skipping 18 matching lines...) Expand all
83 /** @domName Document.webkitVisibilityState */ 83 /** @domName Document.webkitVisibilityState */
84 String get webkitVisibilityState() => _documentPtr.webkitVisibilityState; 84 String get webkitVisibilityState() => _documentPtr.webkitVisibilityState;
85 85
86 /** @domName Document.caretRangeFromPoint */ 86 /** @domName Document.caretRangeFromPoint */
87 Future<Range> caretRangeFromPoint([int x = null, int y = null]) { 87 Future<Range> caretRangeFromPoint([int x = null, int y = null]) {
88 return _createMeasurementFuture( 88 return _createMeasurementFuture(
89 () => LevelDom.wrapRange(_documentPtr.caretRangeFromPoint(x, y)), 89 () => LevelDom.wrapRange(_documentPtr.caretRangeFromPoint(x, y)),
90 new Completer<Range>()); 90 new Completer<Range>());
91 } 91 }
92 92
93 /** @domName Document.createElement */
94 Element createElement([String tagName = null]) {
95 return LevelDom.wrapElement(_documentPtr.createElement(tagName));
96 }
97
98 /** @domName Document.createEvent */ 93 /** @domName Document.createEvent */
99 Event createEvent([String eventType = null]) { 94 Event createEvent(String eventType) {
100 return LevelDom.wrapEvent(_documentPtr.createEvent(eventType)); 95 return LevelDom.wrapEvent(_documentPtr.createEvent(eventType));
101 } 96 }
102 97
103 /** @domName Document.elementFromPoint */ 98 /** @domName Document.elementFromPoint */
104 Future<Element> elementFromPoint([int x = null, int y = null]) { 99 Future<Element> elementFromPoint([int x = null, int y = null]) {
105 return _createMeasurementFuture( 100 return _createMeasurementFuture(
106 () => LevelDom.wrapElement(_documentPtr.elementFromPoint(x, y)), 101 () => LevelDom.wrapElement(_documentPtr.elementFromPoint(x, y)),
107 new Completer<Element>()); 102 new Completer<Element>());
108 } 103 }
109 104
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 142
148 void set manifest(String value) { _ptr.manifest = value; } 143 void set manifest(String value) { _ptr.manifest = value; }
149 144
150 DocumentEvents get on() { 145 DocumentEvents get on() {
151 if (_on === null) { 146 if (_on === null) {
152 _on = new DocumentEventsImplementation._wrap(_ptr); 147 _on = new DocumentEventsImplementation._wrap(_ptr);
153 } 148 }
154 return _on; 149 return _on;
155 } 150 }
156 } 151 }
OLDNEW
« no previous file with comments | « client/html/src/Document.dart ('k') | client/html/src/ElementWrappingImplementation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698