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

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

Issue 23661002: Fix for IE9 html/htmlcollection test with Safe HTML (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 | « 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 element.remove(); 175 element.remove();
176 break; 176 break;
177 } 177 }
178 } 178 }
179 179
180 // TODO(blois): Need to be able to get all attributes, irrespective of 180 // TODO(blois): Need to be able to get all attributes, irrespective of
181 // XMLNS. 181 // XMLNS.
182 var keys = attrs.keys.toList(); 182 var keys = attrs.keys.toList();
183 for (var i = attrs.length - 1; i >= 0; --i) { 183 for (var i = attrs.length - 1; i >= 0; --i) {
184 var name = keys[i]; 184 var name = keys[i];
185 if (!validator.allowsAttribute(element, name, attrs[name])) { 185 if (!validator.allowsAttribute(element, name.toLowerCase(),
186 attrs[name])) {
186 attrs.remove(name); 187 attrs.remove(name);
187 } 188 }
188 } 189 }
189 190
190 if (element is TemplateElement) { 191 if (element is TemplateElement) {
191 TemplateElement template = element; 192 TemplateElement template = element;
192 sanitizeTree(template.content); 193 sanitizeTree(template.content);
193 } 194 }
194 break; 195 break;
195 case Node.COMMENT_NODE: 196 case Node.COMMENT_NODE:
196 case Node.DOCUMENT_FRAGMENT_NODE: 197 case Node.DOCUMENT_FRAGMENT_NODE:
197 case Node.TEXT_NODE: 198 case Node.TEXT_NODE:
198 case Node.CDATA_SECTION_NODE: 199 case Node.CDATA_SECTION_NODE:
199 break; 200 break;
200 default: 201 default:
201 node.remove(); 202 node.remove();
202 } 203 }
203 } 204 }
204 } 205 }
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