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

Unified Diff: lib/src/html5_utils.dart

Issue 11315020: Add attribute information table so we generate correct setters. (Closed) Base URL: https://github.com/dart-lang/dart-web-components.git@master
Patch Set: Created 8 years, 1 month 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: lib/src/html5_utils.dart
diff --git a/lib/src/html5_utils.dart b/lib/src/html5_utils.dart
index bb8903e90557418662381ea891a56c4218c07b78..a465bfd489d710f68451d3304efcb7d73676c009 100644
--- a/lib/src/html5_utils.dart
+++ b/lib/src/html5_utils.dart
@@ -7,6 +7,18 @@
library html5_utils;
+
+/**
+ * Maps an HTML tag to a dart:html type. This uses [htmlElementNames] but it
+ * will return UnknownElement if the tag is unknown.
+ */
+String typeForHtmlTag(String tag) {
+ var type = htmlElementNames[tag];
+ // Note: this will eventually be the component's class name if it is a
+ // known x-tag.
+ return type == null ? 'UnknownElement' : type;
+}
+
/**
* HTML element to DOM type mapping. Source:
* <http://dev.w3.org/html5/spec/section-index.html#element-interfaces>

Powered by Google App Engine
This is Rietveld 408576698