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

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

Issue 278693002: [html5lib] fix another type annotation (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 | « no previous file | 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 data.forEach((key, value) { 83 data.forEach((key, value) {
84 if (value.endsWith("\n")) { 84 if (value.endsWith("\n")) {
85 data[key] = value.substring(0, value.length - 1); 85 data[key] = value.substring(0, value.length - 1);
86 } 86 }
87 }); 87 });
88 return data; 88 return data;
89 } 89 }
90 } 90 }
91 91
92 /// Serialize the [document] into the html5 test data format. 92 /// Serialize the [document] into the html5 test data format.
93 testSerializer(Document document) { 93 testSerializer(document) {
94 return (new TestSerializer()..visit(document)).toString(); 94 return (new TestSerializer()..visit(document)).toString();
95 } 95 }
96 96
97 /// Serializes the DOM into test format. See [testSerializer]. 97 /// Serializes the DOM into test format. See [testSerializer].
98 class TestSerializer extends TreeVisitor { 98 class TestSerializer extends TreeVisitor {
99 final StringBuffer _str; 99 final StringBuffer _str;
100 int _indent = 0; 100 int _indent = 0;
101 String _spaces = ''; 101 String _spaces = '';
102 102
103 TestSerializer() : _str = new StringBuffer(); 103 TestSerializer() : _str = new StringBuffer();
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 key = "${attr.prefix} ${attr.name}"; 156 key = "${attr.prefix} ${attr.name}";
157 } 157 }
158 _newline(); 158 _newline();
159 _str.write('$key="$v"'); 159 _str.write('$key="$v"');
160 } 160 }
161 indent -= 2; 161 indent -= 2;
162 } 162 }
163 visitChildren(node); 163 visitChildren(node);
164 } 164 }
165 } 165 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698