Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix templatizer under the template polyfill. forceDocumentUpgrade #2707

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions src/lib/dom-module.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,16 @@
document.registerElement('dom-module', DomModule);

function forceDocumentUpgrade() {
var script = document._currentScript || document.currentScript;
var doc = script && script.ownerDocument || document;
if (!doc) {
return;
}
if (HTMLTemplateElement && HTMLTemplateElement.bootstrap) {
HTMLTemplateElement.bootstrap(doc);
}
if (cePolyfill) {
var script = document._currentScript || document.currentScript;
var doc = script && script.ownerDocument || document;
if (doc) {
CustomElements.upgradeAll(doc);
}
CustomElements.upgradeAll(doc);
}
}

Expand Down
6 changes: 0 additions & 6 deletions src/mini/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@
'must not be a type-extension, found', this._template,
'Move inside simple <template>.'));
}
// bootstrap the template if it has not already been
if (this._template && !this._template.content && HTMLTemplateElement.bootstrap) {
HTMLTemplateElement.decorate(this._template);
// recurse if necessary
HTMLTemplateElement.bootstrap(this._template.content);
}
},

_stampTemplate: function() {
Expand Down