Index: pkg/template_binding/lib/template_binding.dart |
diff --git a/pkg/template_binding/lib/template_binding.dart b/pkg/template_binding/lib/template_binding.dart |
index 61ec19d2570d1113d151105ed107c8b79ff33ce9..512b1e2151a070013579b8a49a92ba99a2d8f29f 100644 |
--- a/pkg/template_binding/lib/template_binding.dart |
+++ b/pkg/template_binding/lib/template_binding.dart |
@@ -25,10 +25,8 @@ import 'dart:svg' show SvgSvgElement; |
import 'package:observe/observe.dart'; |
import 'src/binding_delegate.dart'; |
-import 'src/node_binding.dart'; |
export 'src/binding_delegate.dart'; |
-export 'src/node_binding.dart' show NodeBinding; |
part 'src/element.dart'; |
part 'src/input_bindings.dart'; |
@@ -136,6 +134,12 @@ NodeBindExtension nodeBindFallback(Node node) { |
bool _isAttributeTemplate(Element n) => n.attributes.containsKey('template') && |
_SEMANTIC_TEMPLATE_TAGS.containsKey(n.localName); |
+bool _isSvgTemplate(Element el) => el.tagName == 'template' && |
+ el.namespaceUri == 'http://www.w3.org/2000/svg'; |
+ |
+bool _isHtmlTemplate(Element el) => el.tagName == 'TEMPLATE' && |
+ el.namespaceUri == 'http://www.w3.org/1999/xhtml'; |
+ |
/** |
* Returns true if this node is semantically a template. |
* |
@@ -146,7 +150,7 @@ bool _isAttributeTemplate(Element n) => n.attributes.containsKey('template') && |
* and COL), OPTION, and OPTGROUP. |
*/ |
bool isSemanticTemplate(Node n) => n is Element && |
- (n.localName == 'template' || _isAttributeTemplate(n)); |
+ (_isHtmlTemplate(n) || _isAttributeTemplate(n) || _isSvgTemplate(n)); |
// TODO(jmesserly): const set would be better |
const _SEMANTIC_TEMPLATE_TAGS = const { |