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

Unified Diff: tools/dom/templates/html/impl/impl_Document.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 side-by-side diff with in-line comments
Download patch
Index: tools/dom/templates/html/impl/impl_Document.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_Document.darttemplate b/tools/dom/templates/html/impl/impl_Document.darttemplate
index 3e66c9c264a95bbe68625eb49183d37d580efe6e..47867a863aed2f8374be1aa5613a4055d1d9abda 100644
--- a/tools/dom/templates/html/impl/impl_Document.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Document.darttemplate
@@ -13,20 +13,40 @@ $!MEMBERS
* Finds all descendant elements of this document that match the specified
* group of selectors.
*
- * Unless your webpage contains multiple documents, the top-level queryAll
+ * Unless your webpage contains multiple documents, the top-level
+ * [querySelectorAll]
* method behaves the same as this method, so you should use it instead to
* save typing a few characters.
*
* [selectors] should be a string using CSS selector syntax.
- * var items = document.queryAll('.itemClassName');
+ * var items = document.querySelectorAll('.itemClassName');
*
* For details about CSS selector syntax, see the
* [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
*/
- ElementList queryAll(String selectors) {
+ ElementList querySelectorAll(String selectors) {
return new _FrozenElementList._wrap(_querySelectorAll(selectors));
}
+ /**
+ * Alias for [querySelector]. Note this function is deprecated because its
+ * semantics will be changing in the future.
+ */
+ @deprecated
+ @Experimental()
+ @DomName('Document.querySelector')
+ Element query(String relativeSelectors) => querySelector(relativeSelectors);
+
+ /**
+ * Alias for [querySelectorAll]. Note this function is deprecated because its
+ * semantics will be changing in the future.
+ */
+ @deprecated
+ @Experimental()
+ @DomName('Document.querySelectorAll')
+ ElementList queryAll(String relativeSelectors) =>
+ querySelectorAll(relativeSelectors);
+
/// Checks if [register] is supported on the current platform.
bool get supportsRegister {
$if DART2JS

Powered by Google App Engine
This is Rietveld 408576698