Skip to content

Don't use IA2TextTextInfo on the web for object review and read line.#20096

Merged
seanbudd merged 1 commit into
nvaccess:masterfrom
jcsteh:noIa2Ti
May 11, 2026
Merged

Don't use IA2TextTextInfo on the web for object review and read line.#20096
seanbudd merged 1 commit into
nvaccess:masterfrom
jcsteh:noIa2Ti

Conversation

@jcsteh
Copy link
Copy Markdown
Contributor

@jcsteh jcsteh commented May 10, 2026

Link to issue number:

Fixes #15159.

Summary of the issue:

In focus mode in web browsers, when a control specifies a label using aria-label or aria-labelledby, it is impossible to review or spell that label; e.g. using read current line or the review cursor. This is particularly annoying and detrimental to efficiency when using web apps such as Gmail and Slack, among others, where you have to switch to browse mode to work around this even though it might be more efficient to use focus mode for navigation.

Description of user facing changes:

In focus mode in web browsers, it is now possible to review and spell the labels of controls when those labels are specifically provided for accessibility; e.g. via aria-label or aria-labelledby.

Description of development approach:

When in focus mode, for non-editable controls, both speech and braille report the name, description, value, etc. of the control; they don't use the TextInfo. However, previously, the review cursor and the read line command always used the TextInfo. Since IA2TextTextInfo is used for all objects supporting IAccessibleText, this meant that if the content wasn't a flat piece of text equal to the label, the review cursor and read line command would report something different, often nothing at all.

To fix this, for IA2Web objects that aren't editors, use NVDAObjectTextInfo instead of the object's TextInfo for object review and the read line command. I first attempted to do this generically in #18271 using _hasNavigableText, but this caused problems elsewhere. Instead, the scope of this change is very specific, introducing a new _shouldUseTextInfoForReview NVDAObject attribute which is only set to False for Ia2Web objects.

Testing strategy:

In both Firefox and Edge:

  1. Followed and verified the steps to reproduce in Can't review/spell text of accessible names applied with aria-label/labelledby in focus mode #15159 (comment).
  2. Also tested with the review cursor in the Gmail message list, where previously, the review cursor couldn't read the message details. With this change, it can. Same for read current line.
  3. Verified that braille remains the same as before (the expected behaviour) in all of these scenarios.
  4. Also tested this test case:
    data:text/html,<textarea>ab
    Verified that in focus mode, formatting info is still reported for the review cursor, indicating that the correct TextInfo is being used. Also verified that the review cursor tracks the caret.
  5. With a multi line message in Gmail, verified that read current line reports the correct line when on the second or subsequent lines.
  6. I wasn't able to reproduce NVDA+Up fails to read or spell many controls and lines in Google Chrome #11285 myself. However, @amirsol81 verified that this change fixes that too.

Known issues with pull request:

The narrow scoping here means that this probably doesn't fix #11285 in the Chrome UI. I was never able to reproduce it, so I can't verify that. Regardless, I think that should be addressed separately, though the new property should make that much simpler.

Similarly, this may mean we can revert VS Code specific changes such as #17573 and #16248. However, I'm not willing to risk that at this stage, given the churn this caused last time and the fact that I don't use VS Code myself and am unwilling to test it. There is no conflict here and it can easily be addressed in a follow-up if this proves to be feasible.

Code Review Checklist:

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

@jcsteh jcsteh requested a review from a team as a code owner May 10, 2026 10:56
@jcsteh jcsteh requested a review from seanbudd May 10, 2026 10:56
Copy link
Copy Markdown
Member

@seanbudd seanbudd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jcsteh

@seanbudd seanbudd merged commit 3ad497a into nvaccess:master May 11, 2026
32 of 37 checks passed
@github-actions github-actions Bot added this to the 2026.2 milestone May 11, 2026
@Emil-18
Copy link
Copy Markdown
Contributor

Emil-18 commented May 12, 2026

@jcsteh I still have a few issues with this.

Implementation.

Why customize parts of NVDA to use the NVDAObject textInfo in places where it previously used the IA2TextTextInfo? Why can't we just make IAccessible._get_TextInfo return NVDAObjectTextInfo where it previously returned IA2TextTextInfo, and go over each case where IA2TextTextInfo is needed, and make those explicitly use it? Features such as move navigator object to focus, and move the review cursor to the beginning/end of the navigator object will now still use IA2TextTextInfo, unless those gets customized as well

Usefulness of reading the visual text.

There are times where being able to read the visual text makes the difference between being able to use a website and not. A few days ago, I was in such a situation. There were two buttons, witch according to the Accessibility information was both called "Change password", but when I read the visual text with the review cursor reading commands, I found out that one was called next and the other cancel. Could we please make a setting to toggle if NVDA should use IA2TextTextInfo or not?

@jcsteh
Copy link
Copy Markdown
Contributor Author

jcsteh commented May 12, 2026

Why customize parts of NVDA to use the NVDAObject textInfo in places where it previously used the IA2TextTextInfo? Why can't we just make IAccessible._get_TextInfo return NVDAObjectTextInfo where it previously returned IA2TextTextInfo, and go over each case where IA2TextTextInfo is needed, and make those explicitly use it?

  1. It is a lot riskier. I didn't even know about the details annotation case last time I tried that, so it's likely there is more usage which is also only likely to be spotted after the fact, potentially in add-ons as well.
  2. TextInfo was never guaranteed to be purely for user consumption.

Features such as move navigator object to focus, and move the review cursor to the beginning/end of the navigator object will now still use IA2TextTextInfo, unless those gets customized as well

I'll look into this.

There are times where being able to read the visual text makes the difference between being able to use a website and not. A few days ago, I was in such a situation. There were two buttons, witch according to the Accessibility information was both called "Change password", but when I read the visual text with the review cursor reading commands, I found out that one was called next and the other cancel.

That's fair, but there are a greater number of cases where the reverse is true. Most users are not going to understand that distinction, especially because it's inconsistent with what gets reported in both browse mode and object reporting in focus mode.

Could we please make a setting to toggle if NVDA should use IA2TextTextInfo or not?

The vast majority of users are not going to understand what the setting means, nor does it make any sense in the presence of embedded objects. So unless the core team insists on this, I'm not willing to do it.

@Emil-18
Copy link
Copy Markdown
Contributor

Emil-18 commented May 12, 2026 via email

@Emil-18
Copy link
Copy Markdown
Contributor

Emil-18 commented May 13, 2026

@jcsteh Here is yet another bug. In firefox, when tabbing through controls, the review cursor still uses the IA2WebTextTextInfo, as a TextInfo is returned when calling makeTextInfo(TextInfos.POSITION_CARET). For whatever reason, when landing on an object in firefox when the navigator object was previously outside the document, when using object navigation, when switching from document to object review, or when manualy activating focus mode, it works as intended

seanbudd pushed a commit that referenced this pull request May 15, 2026
#20134)

### Reverts PR
Reverts #20096.

### Issues fixed
Fixes
#20096 (comment) and
#20096 (comment).

### Issues reopened
Reopens #15159.

### Reason for revert
The implementation in #20096 still reviewed the wrong content if you
focused a control by pressing tab in focus mode or if you used the
review top/bottom line commands. I submitted #20132, but given the
proximity to beta, it seems safer to wait for 2026.3 instead.

### Can this PR be reimplemented? If so, what is required for the next
attempt
See #20132.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants