diff --git a/src/lib/custom-style.html b/src/lib/custom-style.html
index de7f039039..4c78e526d9 100644
--- a/src/lib/custom-style.html
+++ b/src/lib/custom-style.html
@@ -82,6 +82,7 @@
is: 'custom-style',
extends: 'style',
+ _template: null,
properties: {
// include is a property so that it deserializes
diff --git a/src/lib/template/array-selector.html b/src/lib/template/array-selector.html
index f728e3fd33..1f1a696634 100644
--- a/src/lib/template/array-selector.html
+++ b/src/lib/template/array-selector.html
@@ -66,6 +66,7 @@
Polymer({
is: 'array-selector',
+ _template: null,
properties: {
diff --git a/src/lib/template/dom-bind.html b/src/lib/template/dom-bind.html
index 1cbfb4879e..8b0aeb81d1 100644
--- a/src/lib/template/dom-bind.html
+++ b/src/lib/template/dom-bind.html
@@ -62,6 +62,7 @@
is: 'dom-bind',
extends: 'template',
+ _template: null,
created: function() {
// Ensure dom-bind doesn't stamp until all possible dependencies
diff --git a/src/lib/template/dom-if.html b/src/lib/template/dom-if.html
index cca4ad0d76..a9d45eb705 100644
--- a/src/lib/template/dom-if.html
+++ b/src/lib/template/dom-if.html
@@ -28,6 +28,7 @@
is: 'dom-if',
extends: 'template',
+ _template: null,
/**
* Fired whenever DOM is added or removed/hidden by this template (by
diff --git a/src/lib/template/dom-repeat.html b/src/lib/template/dom-repeat.html
index 17383b5ac6..8082469384 100644
--- a/src/lib/template/dom-repeat.html
+++ b/src/lib/template/dom-repeat.html
@@ -107,6 +107,7 @@
is: 'dom-repeat',
extends: 'template',
+ _template: null,
/**
* Fired whenever DOM is added or removed by this template (by
diff --git a/src/lib/template/dom-template.html b/src/lib/template/dom-template.html
index e726f6d065..6931bd29f5 100644
--- a/src/lib/template/dom-template.html
+++ b/src/lib/template/dom-template.html
@@ -25,6 +25,7 @@
is: 'dom-template',
extends: 'template',
+ _template: null,
behaviors: [
Polymer.Templatizer
diff --git a/src/mini/template.html b/src/mini/template.html
index 9f652bc387..d36686884a 100644
--- a/src/mini/template.html
+++ b/src/mini/template.html
@@ -25,8 +25,9 @@
_prepTemplate: function() {
// locate template using dom-module
- this._template =
- this._template || Polymer.DomModule.import(this.is, 'template');
+ if (this._template === undefined) {
+ this._template = Polymer.DomModule.import(this.is, 'template');
+ }
// stick finger in footgun
if (this._template && this._template.hasAttribute('is')) {
this._warn(this._logf('_prepTemplate', 'top-level Polymer template ' +
diff --git a/src/standard/styling.html b/src/standard/styling.html
index 438efc212f..f4fa704dbe 100644
--- a/src/standard/styling.html
+++ b/src/standard/styling.html
@@ -40,16 +40,20 @@
this._encapsulateStyle = !nativeShadow &&
Boolean(this._template);
}
- this._styles = this._collectStyles();
- var cssText = styleTransformer.elementStyles(this);
- if (cssText && this._template) {
- var style = styleUtil.applyCss(cssText, this.is,
- nativeShadow ? this._template.content : null);
- // keep track of style when in document scope (polyfill) so we can
- // attach property styles after it.
- if (!nativeShadow) {
- this._scopeStyle = style;
+ if (this._template) {
+ this._styles = this._collectStyles();
+ var cssText = styleTransformer.elementStyles(this);
+ if (cssText) {
+ var style = styleUtil.applyCss(cssText, this.is,
+ nativeShadow ? this._template.content : null);
+ // keep track of style when in document scope (polyfill) so we can
+ // attach property styles after it.
+ if (!nativeShadow) {
+ this._scopeStyle = style;
+ }
}
+ } else {
+ this._styles = [];
}
},