diff --git a/lib/legacy/legacy-element-mixin.js b/lib/legacy/legacy-element-mixin.js index d84a5eb4a2..8939ecbf79 100644 --- a/lib/legacy/legacy-element-mixin.js +++ b/lib/legacy/legacy-element-mixin.js @@ -23,6 +23,7 @@ import { wrap } from '../utils/wrap.js'; import { scopeSubtree } from '../utils/scope-subtree.js'; import { legacyOptimizations, legacyNoObservedAttributes } from '../utils/settings.js'; import { findObservedAttributesGetter } from '../mixins/disable-upgrade-mixin.js'; +import { register } from '../utils/telemetry.js'; const DISABLED_ATTR = 'disable-upgrade'; @@ -165,8 +166,16 @@ export const LegacyElementMixin = dedupingMixin((base) => { // NOTE: Inlined for perf from version of DisableUpgradeMixin. static get observedAttributes() { - return legacyNoObservedAttributes ? [] : - observedAttributesGetter.call(this).concat(DISABLED_ATTR); + if (legacyNoObservedAttributes) { + // Ensure this element is property registered with the telemetry system. + if (!this.hasOwnProperty(JSCompiler_renameProperty('__observedAttributes', this))) { + this.__observedAttributes = []; + register(this.prototype); + } + return this.__observedAttributes; + } else { + return observedAttributesGetter.call(this).concat(DISABLED_ATTR); + } } // NOTE: Inlined for perf from version of DisableUpgradeMixin. diff --git a/test/unit/legacy-noattributes.html b/test/unit/legacy-noattributes.html index 66799153a0..6e5399f1cc 100644 --- a/test/unit/legacy-noattributes.html +++ b/test/unit/legacy-noattributes.html @@ -92,6 +92,7 @@