diff --git a/js/accessibility/AccessiblePeer.js b/js/accessibility/AccessiblePeer.js index 77b57ec9f..71a181e2a 100644 --- a/js/accessibility/AccessiblePeer.js +++ b/js/accessibility/AccessiblePeer.js @@ -137,7 +137,11 @@ define( function( require ) { // NOTE: ResizeObserver is a superior alternative to MutationObserver for this purpose because // it will only monitor changes we care about and prevent infinite callback loops if size is changed in // the callback function (we get around this now by not observing attribute changes). But it is not yet widely - // supported, see https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver + // supported, see https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver. + // + // TODO: Should we be watching "model" changes from Accessibility.js instead of using MutationObserver? + // See https://github.com/phetsims/scenery/issues/852. This would be less fragile, and also less + // memory intensive because we don't need an instance of MutationObserver on every AccessibleInstance. this.mutationObserver = this.mutationObserver || new MutationObserver( this.invalidateCSSPositioning.bind( this ) ); // @private {function} - must be removed on disposal