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

Unified Diff: lib/html/frog/html_frog.dart

Issue 10447091: Cleanup NodeSelectors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years, 6 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:
Download patch
« no previous file with comments | « lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/html/frog/html_frog.dart
diff --git a/lib/html/frog/html_frog.dart b/lib/html/frog/html_frog.dart
index 755a1ed2d4b33080e4cc91e5d4a76464a877b596..c541ab10935e5c2e471f592f07b09afae90c16fe 100644
--- a/lib/html/frog/html_frog.dart
+++ b/lib/html/frog/html_frog.dart
@@ -4713,10 +4713,9 @@ class _DivElementImpl extends _ElementImpl implements DivElement native "*HTMLDi
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-class _DocumentImpl extends _NodeImpl
- implements Document
+class _DocumentImpl extends _NodeImpl implements Document
native "*HTMLDocument"
- {
+{
_DocumentEventsImpl get on() =>
@@ -4810,6 +4809,8 @@ class _DocumentImpl extends _NodeImpl
String queryCommandValue(String command) native;
+ _ElementImpl $dom_querySelector(String selectors) native "querySelector";
+
_NodeListImpl $dom_querySelectorAll(String selectors) native "querySelectorAll";
void webkitCancelFullScreen() native;
@@ -4829,9 +4830,6 @@ class _DocumentImpl extends _NodeImpl
return $dom_querySelector(selectors);
}
-// TODO(jacobr): autogenerate this method.
- _ElementImpl $dom_querySelector(String selectors) native "return this.querySelector(selectors);";
-
ElementList queryAll(String selectors) {
if (const RegExp("""^\\[name=["'][^'"]+['"]\\]\$""").hasMatch(selectors)) {
final mutableMatches = $dom_getElementsByName(
@@ -5100,6 +5098,8 @@ class _DocumentFragmentImpl extends _NodeImpl implements DocumentFragment native
elements.addAll(copy);
}
+ _ElementImpl query(String selectors) => $dom_querySelector(selectors);
+
ElementList queryAll(String selectors) =>
new _FrozenElementList._wrap($dom_querySelectorAll(selectors));
@@ -5299,7 +5299,7 @@ class _DocumentFragmentImpl extends _NodeImpl implements DocumentFragment native
_ElementEventsImpl get on() =>
new _ElementEventsImpl(this);
- _ElementImpl query(String selectors) native "querySelector";
+ _ElementImpl $dom_querySelector(String selectors) native "querySelector";
_NodeListImpl $dom_querySelectorAll(String selectors) native "querySelectorAll";
@@ -6022,6 +6022,8 @@ class _ElementImpl extends _NodeImpl implements Element native "*Element" {
ElementList get elements() => new _ChildrenElementList._wrap(this);
+ _ElementImpl query(String selectors) => $dom_querySelector(selectors);
+
ElementList queryAll(String selectors) =>
new _FrozenElementList._wrap($dom_querySelectorAll(selectors));
@@ -6172,7 +6174,7 @@ class _ElementImpl extends _NodeImpl implements Element native "*Element" {
void insertAdjacentText(String where, String text) native;
- _ElementImpl query(String selectors) native "querySelector";
+ _ElementImpl $dom_querySelector(String selectors) native "querySelector";
_NodeListImpl $dom_querySelectorAll(String selectors) native "querySelectorAll";
@@ -22565,7 +22567,7 @@ interface Document extends HtmlElement {
String queryCommandValue(String command);
/** @domName Document.querySelector */
- Element query(String selectors);
+ Element $dom_querySelector(String selectors);
/** @domName Document.querySelectorAll */
NodeList $dom_querySelectorAll(String selectors);
@@ -22703,7 +22705,7 @@ interface DocumentFragment extends Element default _DocumentFragmentFactoryProvi
ElementEvents get on();
/** @domName DocumentFragment.querySelector */
- Element query(String selectors);
+ Element $dom_querySelector(String selectors);
/** @domName DocumentFragment.querySelectorAll */
NodeList $dom_querySelectorAll(String selectors);
@@ -22826,12 +22828,6 @@ interface Element extends Node, NodeSelector default _ElementFactoryProvider {
void set attributes(Map<String, String> value);
/**
- * @domName querySelectorAll, getElementsByClassName, getElementsByTagName,
- * getElementsByTagNameNS
- */
- ElementList queryAll(String selectors);
-
- /**
* @domName childElementCount, firstElementChild, lastElementChild,
* children, Node.nodes.add
*/
@@ -23023,7 +23019,7 @@ interface Element extends Node, NodeSelector default _ElementFactoryProvider {
void insertAdjacentText(String where, String text);
/** @domName Element.querySelector */
- Element query(String selectors);
+ Element $dom_querySelector(String selectors);
/** @domName Element.querySelectorAll */
NodeList $dom_querySelectorAll(String selectors);
@@ -26921,10 +26917,10 @@ interface NodeSelector {
/** @domName NodeSelector.querySelector */
- Element query(String selectors);
+ Element querySelector(String selectors);
/** @domName NodeSelector.querySelectorAll */
- NodeList $dom_querySelectorAll(String selectors);
+ NodeList querySelectorAll(String selectors);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
« no previous file with comments | « lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698