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 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 } |
OLD | NEW |