diff --git a/lib/legacy/legacy-element-mixin.js b/lib/legacy/legacy-element-mixin.js index 53a4c18d59..a6c0575c3a 100644 --- a/lib/legacy/legacy-element-mixin.js +++ b/lib/legacy/legacy-element-mixin.js @@ -21,7 +21,7 @@ import { timeOut, microTask } from '../utils/async.js'; import { get } from '../utils/path.js'; import { wrap } from '../utils/wrap.js'; import { scopeSubtree } from '../utils/scope-subtree.js'; -import { legacyNoObservedAttributes } from '../utils/settings.js'; +import { legacyOptimizations, legacyNoObservedAttributes } from '../utils/settings.js'; import { findObservedAttributesGetter } from '../mixins/disable-upgrade-mixin.js'; const DISABLED_ATTR = 'disable-upgrade'; @@ -297,7 +297,8 @@ export const LegacyElementMixin = dedupingMixin((base) => { */ _initializeProperties() { // NOTE: Inlined for perf from version of DisableUpgradeMixin. - if (this.hasAttribute(DISABLED_ATTR)) { + // Only auto-use disable-upgrade if legacyOptimizations is set. + if (legacyOptimizations && this.hasAttribute(DISABLED_ATTR)) { this.__isUpgradeDisabled = true; } else { let proto = Object.getPrototypeOf(this);