diff --git a/lib/legacy/class.html b/lib/legacy/class.html
index 377146df72..026fa98eef 100644
--- a/lib/legacy/class.html
+++ b/lib/legacy/class.html
@@ -350,11 +350,6 @@
Polymer.LegacyElementMixin(HTMLElement));
// decorate klass with registration info
klass.is = info.is;
- // if user provided template on info, make sure the static _template
- // is set so the static template getter uses it
- if (info._template !== undefined) {
- klass._template = info._template;
- }
return klass;
};
diff --git a/lib/mixins/element-mixin.html b/lib/mixins/element-mixin.html
index d17a151342..b2082f292a 100644
--- a/lib/mixins/element-mixin.html
+++ b/lib/mixins/element-mixin.html
@@ -408,14 +408,14 @@
static get template() {
if (!this.hasOwnProperty(JSCompiler_renameProperty('_template', this))) {
this._template =
+ // Take any template set on the prototype, including null (for legacy
+ // support, setting in registered callback, etc.)
+ this.prototype._template !== undefined ? this.prototype._template :
// Look in dom-module associated with this element's is
getTemplateFromDomModule(/** @type {PolymerElementConstructor}*/ (this).is) ||
// Next look for superclass template (call the super impl this
// way so that `this` points to the superclass)
- Object.getPrototypeOf(/** @type {PolymerElementConstructor}*/ (this).prototype).constructor.template ||
- // Finally, fall back to any _template set on prototype, e.g.
- // via registered callback
- this.prototype._template;
+ Object.getPrototypeOf(/** @type {PolymerElementConstructor}*/ (this).prototype).constructor.template;
}
return this._template;
}
diff --git a/test/unit/behaviors.html b/test/unit/behaviors.html
index 34d94097eb..30c4804eeb 100644
--- a/test/unit/behaviors.html
+++ b/test/unit/behaviors.html
@@ -22,6 +22,12 @@
+
+
+ should not be used
+
+
+
@@ -309,6 +360,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+