| Index: tools/dom/templates/html/dartium/html_dartium.darttemplate
|
| diff --git a/tools/dom/templates/html/dartium/html_dartium.darttemplate b/tools/dom/templates/html/dartium/html_dartium.darttemplate
|
| index 9bd24f0b78f54de6e6ea1ec344a701fb2b2698b2..2d157eab2139761fc4c650918f88da1636251fd0 100644
|
| --- a/tools/dom/templates/html/dartium/html_dartium.darttemplate
|
| +++ b/tools/dom/templates/html/dartium/html_dartium.darttemplate
|
| @@ -353,13 +353,30 @@ Function _getSvgFunction(String key) {
|
| ******************************************************************************/
|
|
|
| // List of known tagName to DartClass for custom elements, used for upgrade.
|
| -var _knownCustomElements = new Map<String, Type>();
|
| +var _knownCustomElements = new Map<String, Map<Type, String>>();
|
|
|
| -void _addCustomElementType(String tagName, Type dartClass) {
|
| - _knownCustomElements[tagName] = dartClass;
|
| +void _addCustomElementType(String tagName, Type dartClass, [String extendTag]) {
|
| + _knownCustomElements[tagName] =
|
| + {'type': dartClass, 'extends': extendTag != null ? extendTag : "" };
|
| }
|
|
|
| -Type _getCustomElementType(object) => _knownCustomElements[_getCustomElementName(object)];
|
| +Type _getCustomElementType(object) {
|
| + var entry = _knownCustomElements[_getCustomElementName(object)];
|
| + if (entry != null) {
|
| + return entry['type'];
|
| + }
|
| + return null;
|
| +}
|
| +
|
| +String _getCustomElementExtends(object) {
|
| + var entry = _knownCustomElements[_getCustomElementName(object)];
|
| + if (entry != null) {
|
| + return entry['extends'];
|
| + }
|
| + return null;
|
| +}
|
| +
|
| +_getCustomElement(object) => _knownCustomElements[_getCustomElementName(object)];
|
|
|
| // Return the tag name or is attribute of the custom element or data binding.
|
| String _getCustomElementName(element) {
|
| @@ -488,9 +505,15 @@ wrap_jso(jsObject) {
|
| // make sure it's upgraded.
|
| dartClass_instance = _upgradeHtmlElement(jsObject['dart_class']);
|
| } else {
|
| - var customElementClass = _getCustomElementType(jsObject);
|
| + var customElementClass = null;
|
| + var extendsTag = "";
|
| + var custom = _getCustomElement(jsObject);
|
| + if (custom != null) {
|
| + customElementClass = custom['type'];
|
| + extendsTag = custom['extends'];
|
| + }
|
| // Custom Element to upgrade.
|
| - if (jsTypeName == 'HTMLElement' && customElementClass != null) {
|
| + if (jsTypeName == 'HTMLElement' && customElementClass != null && extendsTag == "") {
|
| try {
|
| dartClass_instance = _blink.Blink_Utils.constructElement(customElementClass, jsObject);
|
| } finally {
|
|
|