BrowseMode: don't refuse to report focus changes for cases such as replaced controls and focusing ancestors #8868
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Link to issue number:
Closes #6606
Closes #8341
Summary of the issue:
NVDA sometimes fails to report focus in browseMode documents, as it is trying to filter out redundant focus events caused by moving the caret.
Particular cases:
Focus replacement
Custom checkboxes and expandable controls that draw a checkmark or + symbol using the content css property on the element's ::before selector, can cause CSS reframing in Firefox, meaning that the accessible reporesenting the focus dies and is replaced with a new accessible. NVDA refuses in this case to announce the state change, and also the new focus. At very least, NVDA should announce the new focus.
A similar case (but this time deliberate on the part of the web author) is where the current focus is removed from the DOM completely, and a new element is inserted in its place and then focused. An example of this is the Edit title button on Github pull requests. When pressing the button, the Title edit field appears in its place, and NVDA reports nothing.
Focus moves to an ancestor
Sometimes web authors want to focus an ancestor of the previous focus. this is quite common for single-page web apps. In this case, NVDA reports nothing.
Current implementation
Currently, NVDA chooses to ignore any focus in browseMode that overlaps with the browseMode caret. This is so that any focus event that resalts from moving the caret is not reported as this would be redundant. However, this rule is clearly too limiting as it stops the above examples from working.
Description of how this pull request fixes the issue:
This PR changes browseMode so that:
Testing performed:
Tested all cases in #6606 and #8341
Known issues with pull request:
None known. Note though this does not address the underlying issue in #2039.
Change log entry:
Bug fixes:
NVDA no longer refuses to report the focus on web pages where the new focus replaces a control that no longer exists. (#6606, #8341)