Fix ChromeVox panel
The panel runs in a separate page context than the background page, so some js objects like UserAnnotationHandler or ChromeVoxState, which are initialized by the Background class, are never initialized. This leads to indirect bugs from directly required classes such as Output which directly depend on ChromeVoxState or UserAnnotationHandler. For a fix, this change initializes these singletons. Note the divergent styles in which they do so due to the way they were initially written. For reference, not doing this initialization causes errors like: TypeError: Cannot read property 'enabled' of undefined at Function.getAnnotationForNode (chrome-extension://mndnfokpggljbaajbnioimlmbfngpief/chromeVoxPanelScript.js:1113:101) at Output.<anonymous> (chrome-extension://mndnfokpggljbaajbnioimlmbfngpief/chromeVoxPanelScript.js:1190:489) at Array.forEach (<anonymous>) at Output.format_ (chrome-extension://mndnfokpggljbaajbnioimlmbfngpief/chromeVoxPanelScript.js:1182:8) at Output.node_ (chrome-extension://mndnfokpggljbaajbnioimlmbfngpief/chromeVoxPanelScript.js:1263:30) at Output.<anonymous> (chrome-extension://mndnfokpggljbaajbnioimlmbfngpief/chromeVoxPanelScript.js:1243:6) at Output.range_ (chrome-extension://mndnfokpggljbaajbnioimlmbfngpief/chromeVoxPanelScript.js:1247:228) at Output.render_ (chrome-extension://mndnfokpggljbaajbnioimlmbfngpief/chromeVoxPanelScript.js:1179:83) at Output.withSpeech (chrome-extension://mndnfokpggljbaajbnioimlmbfngpief/chromeVoxPanelScript.js:1140:104) at PanelNodeMenu.findMoreNodes_ (chrome-extension://mndnfokpggljbaajbnioimlmbfngpief/chromeVoxPanelScript.js:1436:118) Change-Id: Id867f585dededc77a56f0332aba8ea1bd4ebb06a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2055415 Commit-Queue: David Tseng <dtseng@chromium.org> Reviewed-by:Akihiro Ota <akihiroota@chromium.org> Cr-Commit-Position: refs/heads/master@{#741608}
Showing
Please register or sign in to comment