From 051e1bffc3c2dd8104a4a48a53211027d41aa1ed Mon Sep 17 00:00:00 2001 From: Steven Orvell Date: Mon, 27 Jul 2015 17:28:09 -0700 Subject: [PATCH] don-module no longer needs to eagerly upgrade custom elements since the web components polyfills do this automatically. --- src/lib/dom-module.html | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) 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); } } }