Permalink
Browse files
don-module no longer needs to eagerly upgrade custom elements since t…
…he web components polyfills do this automatically.
- Loading branch information...
Showing
with
7 additions
and 9 deletions.
-
+7
−9
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