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

Unified Diff: lib/html/dartium/html_dartium.dart

Side-by-side diff isn't available for this file because of its large size.
Issue 10447091: Cleanup NodeSelectors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
Index: lib/html/dartium/html_dartium.dart
diff --git a/lib/html/dartium/html_dartium.dart b/lib/html/dartium/html_dartium.dart
index 9c4168f653c37c1f7489a22eb25cc7580a7dbf6a..0e2ea316397606d6cd71e361ba638dac35edbaeb 100644
--- a/lib/html/dartium/html_dartium.dart
+++ b/lib/html/dartium/html_dartium.dart
@@ -6924,6 +6924,8 @@ class _DocumentFragmentImpl extends _NodeImpl implements DocumentFragment {
elements.addAll(copy);
}
+ _ElementImpl query(String selectors) => $dom_querySelector(selectors);
+
ElementList queryAll(String selectors) =>
new _FrozenElementList._wrap($dom_querySelectorAll(selectors));
@@ -7125,7 +7127,7 @@ class _DocumentFragmentImpl extends _NodeImpl implements DocumentFragment {
return _on;
}
- Element query(String selectors) {
+ Element $dom_querySelector(String selectors) {
return _querySelector(selectors);
}
@@ -7194,9 +7196,8 @@ class _DocumentEventsImpl extends _EventsImpl implements DocumentEvents {
// 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
+{
_DocumentEventsImpl get on() {
@@ -7387,6 +7388,10 @@ class _DocumentImpl extends _NodeImpl
String _queryCommandValue(command) native "Document_queryCommandValue_Callback";
+ Element $dom_querySelector(String selectors) {
+ return _querySelector(selectors);
+ }
+
Element _querySelector(selectors) native "Document_querySelector_Callback";
NodeList $dom_querySelectorAll(String selectors) {
@@ -7426,9 +7431,6 @@ class _DocumentImpl extends _NodeImpl
return $dom_querySelector(selectors);
}
-// TODO(jacobr): autogenerate this method.
- _ElementImpl $dom_querySelector(String selectors) native "Document_querySelector_Callback";
-
ElementList queryAll(String selectors) {
if (const RegExp("""^\\[name=["'][^'"]+['"]\\]\$""").hasMatch(selectors)) {
final mutableMatches = $dom_getElementsByName(
@@ -8237,6 +8239,8 @@ class _ElementImpl extends _NodeImpl implements 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));
@@ -8379,7 +8383,7 @@ class _ElementImpl extends _NodeImpl implements Element {
bool _hasAttribute(name) native "Element_hasAttribute_Callback";
- Element query(String selectors) {
+ Element $dom_querySelector(String selectors) {
return _querySelector(selectors);
}
@@ -30746,7 +30750,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);
@@ -30884,7 +30888,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);
@@ -30996,10 +31000,19 @@ interface ElementRect {
List<ClientRect> get clientRects();
}
+interface NodeSelector {
+ /** @domName Element.querySelector */
+ Element query(String selectors);
+
+ /**
+ * @domName querySelectorAll, getElementsByClassName, getElementsByTagName,
+ * getElementsByTagNameNS
+ */
+ ElementList queryAll(String selectors);
+}
+
/// @domName Element
interface Element extends Node, NodeSelector default _ElementFactoryProvider {
-// TODO(jacobr): switch back to:
-// interface Element extends Node, NodeSelector, ElementTraversal default _ElementImpl {
Element.html(String html);
Element.tag(String tag);
@@ -31007,12 +31020,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
*/
@@ -31204,7 +31211,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);
@@ -35076,26 +35083,6 @@ interface NodeList extends List<Node> {
final int length;
}
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
-// 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.
-
-// WARNING: Do not edit - generated code.
-
-/// @domName NodeSelector
-interface NodeSelector {
-
- // TODO(nweiz): add this back once DocumentFragment is ported.
- // ElementList queryAll(String selectors);
-
-
- /** @domName NodeSelector.querySelector */
- Element query(String selectors);
-
- /** @domName NodeSelector.querySelectorAll */
- NodeList $dom_querySelectorAll(String selectors);
-
-}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// 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.

Powered by Google App Engine
This is Rietveld 408576698