Skip to content

Still report the new focus in browse mode if fetching the states from the old focus causes an exception when checking for defunct #12528

Merged
michaelDCurran merged 1 commit into
betafrom
i12527
Jun 8, 2021
Merged

Still report the new focus in browse mode if fetching the states from the old focus causes an exception when checking for defunct #12528
michaelDCurran merged 1 commit into
betafrom
i12527

Conversation

@michaelDCurran

@michaelDCurran michaelDCurran commented Jun 8, 2021

Copy link
Copy Markdown
Member

Link to issue number:

Fixes #12527

Summary of the issue:

In UI Automation browse mode implementations, sometimes the new focus is not announced if the old focus is removed from the DOM as the focus changes. This is true even in focus mode.
PR #12252 introduced a check for STATE_DEFUNCT on the old focus's states property. Although this works fine in Firefox / Chrome (they leave dead objects around with a defunct state), some UI Automation elements become completely unusable, and therefore an exception is raised when trying to fetch the states property.
As reported in issue #12527 The newly focused tweet in the Twitter app is no longer announced when pressing j / keys. And If using Edge/Chromium with UIA, some focus changes in Microsoft Word 365 Online are not announced.

Description of how this pull request fixes the issue:

In BrowseMode document's event_gainFocus method, Catch all exceptions when fetching states to check for defunct, and if an exception is raised, log the error and treat the object as being defunct.

Testing strategy:

Performed the testcase in the Twitter app, reported in issue #12527. Confirmed that the new focus is again reported, even though an exception is logged at debugWarning.

Known issues with pull request:

None known.

Change log entries:

New features
Changes
Bug fixes
For Developers

Code Review Checklist:

  • Pull Request description is up to date.
  • Unit tests.
  • System (end to end) tests.
  • Manual testing.
  • User Documentation.
  • Change log entry.
  • Context sensitive help for GUI changes.
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers

…ates when checking if an object is defunct (dead), treat the object as defunct anyway. This ensures that the new focus will still be reported.
@michaelDCurran michaelDCurran requested a review from a team as a code owner June 8, 2021 06:29
@michaelDCurran michaelDCurran requested review from seanbudd and removed request for a team June 8, 2021 06:29
@michaelDCurran michaelDCurran merged commit cb0de01 into beta Jun 8, 2021
@michaelDCurran michaelDCurran deleted the i12527 branch June 8, 2021 07:01
@nvaccessAuto nvaccessAuto added this to the 2021.2 milestone Jun 8, 2021
@michaelDCurran michaelDCurran modified the milestones: 2021.2, 2021.1 Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants