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

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

Issue 1063213002: Make SVGValidator reject foreignobject tags, not just their contents. Fixes Firefox inconsistency (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Removed status file entry Created 5 years, 8 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 | « tests/html/node_validator_test.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 * Class which helps construct standard node validation policies. 9 * Class which helps construct standard node validation policies.
10 * 10 *
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 return false; 446 return false;
447 } 447 }
448 } 448 }
449 449
450 450
451 class _SvgNodeValidator implements NodeValidator { 451 class _SvgNodeValidator implements NodeValidator {
452 bool allowsElement(Element element) { 452 bool allowsElement(Element element) {
453 if (element is svg.ScriptElement) { 453 if (element is svg.ScriptElement) {
454 return false; 454 return false;
455 } 455 }
456 // Firefox 37 has issues with creating foreign elements inside a
457 // foreignobject tag as SvgElement. We don't want foreignobject contents
458 // anyway, so just remove the whole tree outright.
459 if (element is svg.ForeignObjectElement) {
460 return false;
461 }
456 if (element is svg.SvgElement) { 462 if (element is svg.SvgElement) {
457 return true; 463 return true;
458 } 464 }
459 return false; 465 return false;
460 } 466 }
461 467
462 bool allowsAttribute(Element element, String attributeName, String value) { 468 bool allowsAttribute(Element element, String attributeName, String value) {
463 if (attributeName == 'is' || attributeName.startsWith('on')) { 469 if (attributeName == 'is' || attributeName.startsWith('on')) {
464 return false; 470 return false;
465 } 471 }
466 return allowsElement(element); 472 return allowsElement(element);
467 } 473 }
468 } 474 }
OLDNEW
« no previous file with comments | « tests/html/node_validator_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698