OLD | NEW |
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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 | 456 // Firefox 37 has issues with creating foreign elements inside a |
457 // foreignobject tag as SvgElement. We don't want foreignobject contents | 457 // foreignobject tag as SvgElement. We don't want foreignobject contents |
458 // anyway, so just remove the whole tree outright. And we can't rely | 458 // anyway, so just remove the whole tree outright. |
459 // on IE recognizing the SvgForeignObject type, so go by tagName. Bug 23144 | 459 if (element is svg.ForeignObjectElement) { |
460 if (element is svg.SvgElement && element.tagName == 'foreignObject') { | |
461 return false; | 460 return false; |
462 } | 461 } |
463 if (element is svg.SvgElement) { | 462 if (element is svg.SvgElement) { |
464 return true; | 463 return true; |
465 } | 464 } |
466 return false; | 465 return false; |
467 } | 466 } |
468 | 467 |
469 bool allowsAttribute(Element element, String attributeName, String value) { | 468 bool allowsAttribute(Element element, String attributeName, String value) { |
470 if (attributeName == 'is' || attributeName.startsWith('on')) { | 469 if (attributeName == 'is' || attributeName.startsWith('on')) { |
471 return false; | 470 return false; |
472 } | 471 } |
473 return allowsElement(element); | 472 return allowsElement(element); |
474 } | 473 } |
475 } | 474 } |
OLD | NEW |