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

Side by Side Diff: tools/dom/src/Validators.dart

Issue 1151903004: Fix typo in sanitizer (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Regenerate HTML libs" Created 5 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
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.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 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart.dom.html; 5 part of dart.dom.html;
6 6
7 7
8 /** 8 /**
9 * Interface used to validate that only accepted elements and attributes are 9 * Interface used to validate that only accepted elements and attributes are
10 * allowed while parsing HTML strings into DOM nodes. 10 * allowed while parsing HTML strings into DOM nodes.
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 // embed tag. The only thing that will let it through is a null 182 // embed tag. The only thing that will let it through is a null
183 // sanitizer that doesn't traverse the tree at all. But sanitizing while 183 // sanitizer that doesn't traverse the tree at all. But sanitizing while
184 // allowing embeds seems quite unlikely. 184 // allowing embeds seems quite unlikely.
185 var corrupted = true; 185 var corrupted = true;
186 var attrs; 186 var attrs;
187 var isAttr; 187 var isAttr;
188 try { 188 try {
189 // If getting/indexing attributes throws, count that as corrupt. 189 // If getting/indexing attributes throws, count that as corrupt.
190 attrs = element.attributes; 190 attrs = element.attributes;
191 isAttr = attrs['is']; 191 isAttr = attrs['is'];
192 corrupted = Element.hasCorruptedAttributes(element); 192 corrupted = Element._hasCorruptedAttributes(element);
193 } catch(e) {} 193 } catch(e) {}
194 var elementText = 'element unprintable'; 194 var elementText = 'element unprintable';
195 try { 195 try {
196 elementText = element.toString(); 196 elementText = element.toString();
197 } catch(e) {} 197 } catch(e) {}
198 var elementTagName = 'element tag unavailable'; 198 var elementTagName = 'element tag unavailable';
199 try { 199 try {
200 elementTagName = element.tagName; 200 elementTagName = element.tagName;
201 } catch(e) {} 201 } catch(e) {}
202 _sanitizeElement(element, parent, corrupted, elementText, elementTagName, 202 _sanitizeElement(element, parent, corrupted, elementText, elementTagName,
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 case Node.COMMENT_NODE: 258 case Node.COMMENT_NODE:
259 case Node.DOCUMENT_FRAGMENT_NODE: 259 case Node.DOCUMENT_FRAGMENT_NODE:
260 case Node.TEXT_NODE: 260 case Node.TEXT_NODE:
261 case Node.CDATA_SECTION_NODE: 261 case Node.CDATA_SECTION_NODE:
262 break; 262 break;
263 default: 263 default:
264 _removeNode(node, parent); 264 _removeNode(node, parent);
265 } 265 }
266 } 266 }
267 } 267 }
OLDNEW
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698