Skip to content
Browse files

don-module no longer needs to eagerly upgrade custom elements since t…

…he web components polyfills do this automatically.
  • Loading branch information...
1 parent 720f2c0 commit 051e1bffc3c2dd8104a4a48a53211027d41aa1ed @sorvell sorvell committed
Showing with 7 additions and 9 deletions.
  1. +7 −9 src/lib/dom-module.html
View
16 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);
}
}
}

0 comments on commit 051e1bf

Please sign in to comment.
Something went wrong with that request. Please try again.