Index: pkg/polymer/lib/src/build/common.dart |
diff --git a/pkg/polymer/lib/src/build/common.dart b/pkg/polymer/lib/src/build/common.dart |
index 2510742a3aeb6f859ead651e16fca4ed6f5eac56..dee92ac7f395700c3bd7c650a9afd3b4f1f9ecc9 100644 |
--- a/pkg/polymer/lib/src/build/common.dart |
+++ b/pkg/polymer/lib/src/build/common.dart |
@@ -188,3 +188,23 @@ class _ErrorCollector extends AnalysisErrorListener { |
final errors = <AnalysisError>[]; |
onError(error) => errors.add(error); |
} |
+ |
+// These names have meaning in SVG or MathML, so they aren't allowed as custom |
blois
2014/03/26 16:02:33
Is this list from somewhere?
Siggi Cherem (dart-lang)
2014/03/26 17:56:34
yeah, that's what the link below in [isCustomTagNa
|
+// tags. |
+var invalidTagNames = const { |
+ 'annotation-xml': '', |
+ 'color-profile': '', |
+ 'font-face': '', |
+ 'font-face-src': '', |
+ 'font-face-uri': '', |
+ 'font-face-format': '', |
+ 'font-face-name': '', |
+ 'missing-glyph': '', |
+}; |
+ |
+/// Returns true if this is a valid custom element name. See: |
+/// <https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/custom/index.html#dfn-custom-element-name> |
+bool isCustomTagName(String name) { |
+ if (name == null || !name.contains('-')) return false; |
+ return !invalidTagNames.containsKey(name); |
+} |