Skip to content

Commit

Permalink
don-module no longer needs to eagerly upgrade custom elements since t…
Browse files Browse the repository at this point in the history
…he web components polyfills do this automatically.
  • Loading branch information
Steven Orvell committed Jul 28, 2015
1 parent 720f2c0 commit 051e1bf
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/lib/dom-module.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
this.getAttribute('name') || this.getAttribute('is');
if (id) {
this.id = id;
// store id separate from lowercased id so that
// in all cases mixedCase id will stored distinctly
// and lowercase version is a fallback
modules[id] = this;
lcModules[id.toLowerCase()] = this;
}
Expand Down Expand Up @@ -87,20 +90,15 @@
// loaded by this point. In addition the HTMLImports polyfill should be
// changed to upgrade elements prior to running any scripts.)
var cePolyfill = window.CustomElements && !CustomElements.useNative;
if (cePolyfill) {
var ready = CustomElements.ready;
CustomElements.ready = true;
}
document.registerElement('dom-module', DomModule);
if (cePolyfill) {
CustomElements.ready = ready;
}

function forceDocumentUpgrade() {
if (cePolyfill) {
var script = document._currentScript || document.currentScript;
if (script) {
CustomElements.upgradeAll(script.ownerDocument);
var doc = script && script.ownerDocument;
if (doc && !doc.__customElementsForceUpgraded) {
doc.__customElementsForceUpgraded = true;
CustomElements.upgradeAll(doc);
}
}
}
Expand Down

0 comments on commit 051e1bf

Please sign in to comment.