Skip to content

MS Word with UIA: correctly fetch formatting in blank table cells and at the end of the document#13477

Merged
michaelDCurran merged 5 commits into
betafrom
i13458
Mar 15, 2022
Merged

MS Word with UIA: correctly fetch formatting in blank table cells and at the end of the document#13477
michaelDCurran merged 5 commits into
betafrom
i13458

Conversation

@michaelDCurran

@michaelDCurran michaelDCurran commented Mar 15, 2022

Copy link
Copy Markdown
Member

Link to issue number:

Fixes #13458
fixes #13459
Partial fix for #13462

Summary of the issue:

In MS word via UIA:
When at the end of a document and arrowing left or up into existing content, or when on a blank table cell and arrowing, tabbing or NVDA table cell navigating back into a cell with content, NVDA reports all formatting set for automatic reporting, even if the formatting between the blank position and the existing content does not differ.
For example, when on a blank table cell and pressing control+alt+leftArrow and moving to a cell with existing content, NVDA will report "section 1, page 1" before reporting the content of the cell. If the user has enabled automatic reporting of font color, then the font color will also be included.
This is due to the fact that NVDA fails to fetch formatting for blank table cells, and the insertion point at the end of the document. But still clears the formatting cache. Thus when fetching valid formatting after this, all the formatting is treated as changed.
Related somewhat to this, is the fact that new list items are not announced when being inserted at the end of the document.

Description of how this pull request fixes the issue:

  • UIAHandler.utils.iterUIARangeByUnit: when at the end of the document, it is impossible to move by unit at all. Thus if we cannot walk at all, then just yield the original range. This ensures that we do actually fetch text and fields for the insertion point at the end of the document.
  • UIATextInfo's _getTextWithFields_text: don't refuse to yield a formatField before an empty text string. This is true on empty table cells and at the end of the document.

Testing strategy:

In MS Word via UIA:

  • Created a 2 by 2 table in a new document.
  • Filled in r1c1 with content.
  • Moved to r1c2 with control+alt+rightArrow. NVDA annonced "column 2"
  • Moved back to r1c1. NVDA announced "column 1" and did not inappropriately announce "section 1" or any other unchanged formatting.
  • Move to the end of the document.
  • Typed "1. Fish" and pressed enter.
  • Read the current line with NVDA+upArrow (dekstop) / NVDA+l (laptop). NVDA correctly announced "2.".

Known issues with pull request:

Automatic announcement of new list items numbers/bullets when pressing enter still does not work, probably due to some strangeness with comparing the start of UIA textRanges. further investigation is required on #13462 however at least reading the line manually does announce the new number / bullet.

Change log entries:

New features
Changes
Bug fixes

Code Review Checklist:

  • Pull Request description:
    • description is up to date
    • change log entries
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • API is compatible with existing add-ons.
  • Documentation:
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English

…d unit at all (I.e. move returns 0 suggesting no more units left), at very least return the original text range.
@michaelDCurran michaelDCurran added this to the 2022.1 milestone Mar 15, 2022
@michaelDCurran michaelDCurran requested a review from a team as a code owner March 15, 2022 01:50
@michaelDCurran michaelDCurran requested review from seanbudd and removed request for a team March 15, 2022 01:50
seanbudd
seanbudd previously approved these changes Mar 15, 2022
@codeofdusk

codeofdusk commented Mar 15, 2022

Copy link
Copy Markdown
Contributor

In Microsoft word with UIA: page/section number

Reporting of section number is new to 2022.1 via custom patterns, so doesn't represent a regression in UIA support. Maybe just "page number and other formatting"?

@michaelDCurran michaelDCurran merged commit d40a6d8 into beta Mar 15, 2022
@michaelDCurran michaelDCurran deleted the i13458 branch March 15, 2022 08:09
@codeofdusk

Copy link
Copy Markdown
Contributor

This PR appears to introuce #13503. I'm going to go ahead and report upstream, because an accessibility call should never cause a provider to crash, but NVDA needs to work around this.

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