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

Side by Side Diff: pkg/third_party/html5lib/test/support.dart

Issue 268623002: [html5lib] implement querySelector/querySelectorAll (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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
« no previous file with comments | « pkg/third_party/html5lib/test/selectors/selectors.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /// Support code for the tests in this directory. 1 /// Support code for the tests in this directory.
2 library support; 2 library support;
3 3
4 import 'dart:io'; 4 import 'dart:io';
5 import 'dart:collection'; 5 import 'dart:collection';
6 import 'package:path/path.dart' as path; 6 import 'package:path/path.dart' as path;
7 import 'package:html5lib/src/treebuilder.dart'; 7 import 'package:html5lib/src/treebuilder.dart';
8 import 'package:html5lib/dom.dart'; 8 import 'package:html5lib/dom.dart';
9 import 'package:html5lib/dom_parsing.dart'; 9 import 'package:html5lib/dom_parsing.dart';
10 10
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 for (var child in node.nodes) visit(child); 133 for (var child in node.nodes) visit(child);
134 indent -= 2; 134 indent -= 2;
135 } 135 }
136 136
137 visitDocument(Document node) { 137 visitDocument(Document node) {
138 indent += 1; 138 indent += 1;
139 for (var child in node.nodes) visit(child); 139 for (var child in node.nodes) visit(child);
140 indent -= 1; 140 indent -= 1;
141 } 141 }
142 142
143 visitDocumentFragment(DocumentFragment node) => visitDocument(node);
144
143 visitElement(Element node) { 145 visitElement(Element node) {
144 _newline(); 146 _newline();
145 _str.write(node); 147 _str.write(node);
146 if (node.attributes.length > 0) { 148 if (node.attributes.length > 0) {
147 indent += 2; 149 indent += 2;
148 var keys = new List.from(node.attributes.keys); 150 var keys = new List.from(node.attributes.keys);
149 keys.sort((x, y) => x.compareTo(y)); 151 keys.sort((x, y) => x.compareTo(y));
150 for (var key in keys) { 152 for (var key in keys) {
151 var v = node.attributes[key]; 153 var v = node.attributes[key];
152 if (key is AttributeName) { 154 if (key is AttributeName) {
153 AttributeName attr = key; 155 AttributeName attr = key;
154 key = "${attr.prefix} ${attr.name}"; 156 key = "${attr.prefix} ${attr.name}";
155 } 157 }
156 _newline(); 158 _newline();
157 _str.write('$key="$v"'); 159 _str.write('$key="$v"');
158 } 160 }
159 indent -= 2; 161 indent -= 2;
160 } 162 }
161 visitChildren(node); 163 visitChildren(node);
162 } 164 }
163 } 165 }
OLDNEW
« no previous file with comments | « pkg/third_party/html5lib/test/selectors/selectors.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698