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

Unified Diff: tools/dom/src/dartium_CustomElementSupport.dart

Issue 1403623002: Fixed upgrading and data binding (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Merged Created 5 years, 2 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
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tools/dom/templates/html/dartium/html_dartium.darttemplate » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/src/dartium_CustomElementSupport.dart
diff --git a/tools/dom/src/dartium_CustomElementSupport.dart b/tools/dom/src/dartium_CustomElementSupport.dart
index edcaec85c42e512d4f664eb9a0dce6bcbe975c9e..b80c1df4f4d253822b14432eba6b1a0089210bb8 100644
--- a/tools/dom/src/dartium_CustomElementSupport.dart
+++ b/tools/dom/src/dartium_CustomElementSupport.dart
@@ -28,20 +28,18 @@ class _VMElementUpgrader implements ElementUpgrader {
Element upgrade(element) {
var jsObject;
- var tag;
- if (element.runtimeType == HtmlElement) {
+ var tag = _getCustomElementName(element);
+ if (element.runtimeType == HtmlElement || element.runtimeType == TemplateElement) {
jsObject = unwrap_jso(element);
- tag = element.localName;
} else if (element.runtimeType == js.JsObjectImpl) {
// It's a Polymer core element (written in JS).
jsObject = element;
- tag = element['localName'];
} else {
throw new UnsupportedError('Element is incorrect type. Got ${element.runtimeType}, expected HtmlElement/JsObjectImpl.');
}
// Remember Dart class to tagName for any upgrading done in wrap_jso.
- _knownCustomeElements[tag] = _type;
+ _knownCustomElements[tag] = _type;
return createCustomUpgrader(_nativeType, jsObject);
}
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tools/dom/templates/html/dartium/html_dartium.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698