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

Unified Diff: pkg/template_binding/lib/template_binding.dart

Issue 132403010: big update to observe, template_binding, polymer (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
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 {

Powered by Google App Engine
This is Rietveld 408576698