OLD | NEW |
1 // Copyright (c) 2012, 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 // DO NOT EDIT | 5 // DO NOT EDIT |
6 // Auto-generated dart:html library. | 6 // Auto-generated dart:html library. |
7 | 7 |
8 /** | 8 /** |
9 * HTML elements and other resources for web-based applications that need to | 9 * HTML elements and other resources for web-based applications that need to |
10 * interact with the browser and the DOM (Document Object Model). | 10 * interact with the browser and the DOM (Document Object Model). |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 * Root node for all content in a web page. | 112 * Root node for all content in a web page. |
113 */ | 113 */ |
114 HtmlDocument get document { | 114 HtmlDocument get document { |
115 if (_document != null) { | 115 if (_document != null) { |
116 return _document; | 116 return _document; |
117 } | 117 } |
118 _document = window.document; | 118 _document = window.document; |
119 return _document; | 119 return _document; |
120 } | 120 } |
121 | 121 |
| 122 /** |
| 123 * Alias for [querySelector]. Note this function is deprecated because its |
| 124 * semantics will be changing in the future. |
| 125 */ |
| 126 @deprecated |
| 127 @Experimental() |
| 128 Element query(String relativeSelectors) => document.query(relativeSelectors); |
| 129 /** |
| 130 * Alias for [querySelectorAll]. Note this function is deprecated because its |
| 131 * semantics will be changing in the future. |
| 132 */ |
| 133 @deprecated |
| 134 @Experimental() |
| 135 ElementList queryAll(String relativeSelectors) => document.queryAll(relativeSele
ctors); |
122 | 136 |
123 Element query(String selector) => document.query(selector); | 137 Element querySelector(String selector) => document.querySelector(selector); |
124 ElementList queryAll(String selector) => document.queryAll(selector); | 138 ElementList querySelectorAll(String selector) => document.querySelectorAll(selec
tor); |
125 | 139 |
126 int _getNewIsolateId() => _Utils._getNewIsolateId(); | 140 int _getNewIsolateId() => _Utils._getNewIsolateId(); |
127 | 141 |
128 bool _callPortInitialized = false; | 142 bool _callPortInitialized = false; |
129 var _callPortLastResult = null; | 143 var _callPortLastResult = null; |
130 | 144 |
131 _callPortSync(num id, var message) { | 145 _callPortSync(num id, var message) { |
132 if (!_callPortInitialized) { | 146 if (!_callPortInitialized) { |
133 window.on['js-result'].listen((event) { | 147 window.on['js-result'].listen((event) { |
134 _callPortLastResult = JSON.decode(_getPortSyncEventData(event)); | 148 _callPortLastResult = JSON.decode(_getPortSyncEventData(event)); |
135 }); | 149 }); |
136 _callPortInitialized = true; | 150 _callPortInitialized = true; |
137 } | 151 } |
138 assert(_callPortLastResult == null); | 152 assert(_callPortLastResult == null); |
139 _dispatchEvent('js-sync-message', {'id': id, 'message': message}); | 153 _dispatchEvent('js-sync-message', {'id': id, 'message': message}); |
140 var result = _callPortLastResult; | 154 var result = _callPortLastResult; |
141 _callPortLastResult = null; | 155 _callPortLastResult = null; |
142 return result; | 156 return result; |
143 } | 157 } |
OLD | NEW |