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

Unified Diff: pkg/third_party/html5lib/lib/dom.dart

Issue 158083002: introduce web_components pkg for consolidated polyfills (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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: pkg/third_party/html5lib/lib/dom.dart
diff --git a/pkg/third_party/html5lib/lib/dom.dart b/pkg/third_party/html5lib/lib/dom.dart
index 1c0b6de94f425389507abd621afe3ad619b20cd6..9f70694c137ca7e3b4970293fbb01feacf0d47ec 100644
--- a/pkg/third_party/html5lib/lib/dom.dart
+++ b/pkg/third_party/html5lib/lib/dom.dart
@@ -11,7 +11,6 @@ import 'src/constants.dart';
import 'src/list_proxy.dart';
import 'src/token.dart';
import 'src/tokenizer.dart';
-import 'src/treebuilder.dart';
import 'src/utils.dart';
import 'dom_parsing.dart';
import 'parser.dart';
@@ -241,19 +240,29 @@ abstract class Node {
nodes.clear();
}
+ /** *Deprecated* use [querySelector] instead. */
+ @deprecated
+ Element query(String selectors) => querySelector(selectors);
+
+ /** *Deprecated* use [querySelectorAll] instead. */
+ @deprecated
+ List<Element> queryAll(String selectors) => querySelectorAll(selectors);
+
/**
* Seaches for the first descendant node matching the given selectors, using a
* preorder traversal. NOTE: right now, this supports only a single type
* selectors, e.g. `node.query('div')`.
*/
- Element query(String selectors) => _queryType(_typeSelector(selectors));
+
+ Element querySelector(String selectors) =>
Jennifer Messerly 2014/02/08 01:13:29 I used the new names accidentally, so I figured I'
+ _queryType(_typeSelector(selectors));
/**
* Returns all descendant nodes matching the given selectors, using a
* preorder traversal. NOTE: right now, this supports only a single type
* selectors, e.g. `node.queryAll('div')`.
*/
- List<Element> queryAll(String selectors) {
+ List<Element> querySelectorAll(String selectors) {
var results = new List<Element>();
_queryAllType(_typeSelector(selectors), results);
return results;
@@ -367,8 +376,9 @@ class Document extends Node {
int get nodeType => Node.DOCUMENT_NODE;
// TODO(jmesserly): optmize this if needed
- Element get head => query('html').query('head');
- Element get body => query('html').query('body');
+ Element get documentElement => querySelector('html');
+ Element get head => documentElement.querySelector('head');
+ Element get body => documentElement.querySelector('body');
String toString() => "#document";

Powered by Google App Engine
This is Rietveld 408576698