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

Side by Side Diff: pkg/third_party/html5lib/lib/dom_parsing.dart

Issue 157983005: pkg/third_party/html5lib: lots of cleanup (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: const 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/third_party/html5lib/lib/dom.dart ('k') | pkg/third_party/html5lib/lib/parser.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /** 1 /**
2 * This library contains extra APIs that aren't in the DOM, but are useful 2 * This library contains extra APIs that aren't in the DOM, but are useful
3 * when interacting with the parse tree. 3 * when interacting with the parse tree.
4 */ 4 */
5 library dom_parsing; 5 library dom_parsing;
6 6
7 import 'dart:math';
8 import 'package:utf/utf.dart' show codepointsToString;
9 import 'dom.dart'; 7 import 'dom.dart';
10 8
11 /** A simple tree visitor for the DOM nodes. */ 9 /** A simple tree visitor for the DOM nodes. */
12 class TreeVisitor { 10 class TreeVisitor {
13 visit(Node node) { 11 visit(Node node) {
14 switch (node.nodeType) { 12 switch (node.nodeType) {
15 case Node.ELEMENT_NODE: return visitElement(node); 13 case Node.ELEMENT_NODE: return visitElement(node);
16 case Node.TEXT_NODE: return visitText(node); 14 case Node.TEXT_NODE: return visitText(node);
17 case Node.COMMENT_NODE: return visitComment(node); 15 case Node.COMMENT_NODE: return visitComment(node);
18 case Node.DOCUMENT_FRAGMENT_NODE: return visitDocumentFragment(node); 16 case Node.DOCUMENT_FRAGMENT_NODE: return visitDocumentFragment(node);
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 bool isVoidElement(String tagName) { 165 bool isVoidElement(String tagName) {
168 switch (tagName) { 166 switch (tagName) {
169 case "area": case "base": case "br": case "col": case "command": 167 case "area": case "base": case "br": case "col": case "command":
170 case "embed": case "hr": case "img": case "input": case "keygen": 168 case "embed": case "hr": case "img": case "input": case "keygen":
171 case "link": case "meta": case "param": case "source": case "track": 169 case "link": case "meta": case "param": case "source": case "track":
172 case "wbr": 170 case "wbr":
173 return true; 171 return true;
174 } 172 }
175 return false; 173 return false;
176 } 174 }
OLDNEW
« no previous file with comments | « pkg/third_party/html5lib/lib/dom.dart ('k') | pkg/third_party/html5lib/lib/parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698