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); |
} |