nvda
dca497fc - Still report / read loaded virtualBuffer after too early focus event in Chromium 100 (#13589)

Commit
4 years ago
Still report / read loaded virtualBuffer after too early focus event in Chromium 100 (#13589) Fixes #13571 Fixes #13570 Summary of the issue: Google Chrome 100, and presumably MS Edge 100 which hasn't been released at the time of this issue creation, has broken some aspects of NVDA's browsing capabilities and features, resulting in the suppression of the announcement of the page title upon load, and malfunctioning of the Automatic SayAll on Page Load feature. This also tampers with the capabilities of some add-ons -- namely BrowserNav. It seems that in Chromium 100 there is a definite change to the events we receive when a page loads. It looks like the following happens: 1. the user causes a page to load by pressing enter in the location bar or activating a link 2. A new document accessible is created with no name, no value, and states of focused, focusable and readonly. 3. a focus event is fired on this document. 3.1. NVDA receives the focus event, and tries to load a virtualBuffer for the document, but it is blank (no content) and NVDA cannot get its URL (documentConstantIdentifier) as the document's accValue is empty still. 4. Content starts to load, and the name, value, and descendants are added. 5. A documentLoadComplete event is fired on the document. 6.1. Currently NVDA does not pay attention to this event, as it expects that the first or another focus event would happen when most if not all of the document was loaded. Previously, focus was not fired on the document until the name, value, and at least some of the descendants were loaded. And therefore, NVDA was able to load a virtualBuffer with at least some content. Description of how this pull request fixes the issue: * Added an implementation of event_documentLoadComplete to the gecko_ia2 virtualBuffer class, which performs the initial reporting / sayAll on virtualBuffer load, if this has not yet occurred. Chromium fires a documentLoadComplete event once the page is fully loaded. Thus by then all the content will be rendered in our virtualBuffer. * The gecko_ia2 vbufBackend now forces any pending updates to the buffer to run straight away if a documentLoadComplete event is received. This is similar to focus and alert events. This is necessary as NVDA expects that the buffer is fully up to date on these events, as it may try to start a sayAll or restore the caret position etc now. * BrowseModeDocumentTreeInterceptor's documentConstantIdentifier property is no longer forcefully overridden with its value at class initialization time. Instead, its value is cached on a new _lastCachedDocumentConstantIdentifier instance variable at class initialization, and also every time the caret moves. And code to save / restore the caret uses this instance variable. In short this ensures that the documentConstantIdentifier value is dynamically updated for SPA (single page apps) but also ensure it is available on termination for saving, when the document is already dead.
Parents
Loading