diff --git a/src/lib/dom-module.html b/src/lib/dom-module.html
index 7fae6b64c4..b3b438a789 100644
--- a/src/lib/dom-module.html
+++ b/src/lib/dom-module.html
@@ -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;
}
@@ -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);
}
}
}