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

Side by Side Diff: tools/dom/templates/html/dart2js/html_dart2js.darttemplate

Issue 27223003: Deprecate query and queryAll, also add back querySelector and querySelectorAll. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 months 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
OLDNEW
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 - unless you are editing documentation as per: 5 // DO NOT EDIT - unless you are editing documentation as per:
6 // https://code.google.com/p/dart/wiki/ContributingHTMLDocumentation 6 // https://code.google.com/p/dart/wiki/ContributingHTMLDocumentation
7 // Auto-generated dart:html library. 7 // Auto-generated dart:html library.
8 8
9 /** 9 /**
10 * HTML elements and other resources for web-based applications that need to 10 * HTML elements and other resources for web-based applications that need to
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 * 107 *
108 * * [Window](https://developer.mozilla.org/en-US/docs/Web/API/window) from MD N. 108 * * [Window](https://developer.mozilla.org/en-US/docs/Web/API/window) from MD N.
109 */ 109 */
110 Window get window => JS('Window', 'window'); 110 Window get window => JS('Window', 'window');
111 111
112 /** 112 /**
113 * Root node for all content in a web page. 113 * Root node for all content in a web page.
114 */ 114 */
115 HtmlDocument get document => JS('HtmlDocument', 'document'); 115 HtmlDocument get document => JS('HtmlDocument', 'document');
116 116
117 Element query(String selector) => document.query(selector); 117 /**
118 ElementList queryAll(String selector) => document.queryAll(selector); 118 * Alias for [querySelector]. Note this function is deprecated because its
119 * semantics will be changing in the future.
120 */
121 @deprecated
122 @Experimental()
123 Element query(String relativeSelector) => document.query(relativeSelector);
124 /**
125 * Alias for [querySelectorAll]. Note this function is deprecated because its
126 * semantics will be changing in the future.
127 */
128 @deprecated
129 @Experimental()
130 ElementList queryAll(String relativeSelector) => document.queryAll(relativeSelec tor);
131 Element querySelector(String selector) => document.querySelector(selector);
132 ElementList querySelectorAll(String selector) => document.querySelectorAll(selec tor);
119 133
120 // Workaround for tags like <cite> that lack their own Element subclass -- 134 // Workaround for tags like <cite> that lack their own Element subclass --
121 // Dart issue 1990. 135 // Dart issue 1990.
122 class HtmlElement extends Element native "HTMLElement" { 136 class HtmlElement extends Element native "HTMLElement" {
123 factory HtmlElement() { throw new UnsupportedError("Not supported"); } 137 factory HtmlElement() { throw new UnsupportedError("Not supported"); }
124 138
125 /** 139 /**
126 * Constructor instantiated by the DOM when a custom element has been created. 140 * Constructor instantiated by the DOM when a custom element has been created.
127 * 141 *
128 * This can only be called by subclasses from their created constructor. 142 * This can only be called by subclasses from their created constructor.
(...skipping 11 matching lines...) Expand all
140 if (JS('bool', r'!window.$dart$isolate$counter')) { 154 if (JS('bool', r'!window.$dart$isolate$counter')) {
141 JS('void', r'window.$dart$isolate$counter = 1'); 155 JS('void', r'window.$dart$isolate$counter = 1');
142 } 156 }
143 return JS('int', r'window.$dart$isolate$counter++'); 157 return JS('int', r'window.$dart$isolate$counter++');
144 } 158 }
145 159
146 // Fast path to invoke JS send port. 160 // Fast path to invoke JS send port.
147 _callPortSync(int id, message) { 161 _callPortSync(int id, message) {
148 return JS('var', r'ReceivePortSync.dispatchCall(#, #)', id, message); 162 return JS('var', r'ReceivePortSync.dispatchCall(#, #)', id, message);
149 } 163 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698