Skip to content

Don't use IA2TextTextInfo on the web#20132

Closed
jcsteh wants to merge 4 commits into
nvaccess:masterfrom
jcsteh:ia2WebNvdaObjTi
Closed

Don't use IA2TextTextInfo on the web#20132
jcsteh wants to merge 4 commits into
nvaccess:masterfrom
jcsteh:ia2WebNvdaObjTi

Conversation

@jcsteh
Copy link
Copy Markdown
Contributor

@jcsteh jcsteh commented May 14, 2026

Link to issue number:

Follow-up to #20096, which was a fix for #15159.

Summary of the issue:

As noted in #20096 (comment), 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.

Description of user facing changes:

  1. In web browsers, the review cursor now reviews the correct content after tabbing in focus mode or using the review top/bottom line commands. This doesn't need a change log entry because this bug was never in a release.
  2. In Mozilla Firefox, reporting annotation details now works correctly in focus mode on controls which are not editable text.

Description of development approach:

I reverted the functional changes in #20096, opting for a different approach. Rather than altering how read line and review fetch the TextInfo using an attribute, Ia2Web.TextInfo is now directly set to NVDAObjectTextInfo, ensuring that makeTextInfo will always use that for Ia2Web objects.

I didn't do this initially because by itself, it breaks script_reportDetailsSummary. However, it turns out that script_reportDetailsSummary had some incorrect assumptions and contained code that was intended to execute but never did. It assumed that browsers always set the caret even for non-editable controls, but that isn't always true, especially in Firefox. Even though it had code to fall back to using the focus, it returned early before that was ever executed. I fixed those problems, which actually fixes script_reportDetailsSummary in Firefox in focus mode on non-editable controls.

I also discovered that MozillaCompoundTextInfo explicitly checked for cases where an embedded object's TextInfo was NVDAObjectTextInfo. However, this only applied to images, etc. which don't support IAccessibleText, as per the IAccessible.TextInfo implementation. So, I simply made this check more explicit: it now checks for IAccessibleText and uses IA2TextTextInfo in that case, NVDAObjectTextInfo otherwise.

Testing strategy:

All the tests described for #20096, plus, in both Firefox and Edge, with this test case:

data:text/html,<button aria-label="1"></button><button aria-label="2"></button><button aria-details="d">3</button><p id="d">d</p><div contenteditable role="textbox">a<span aria-details="d">b</span></div>

  1. Switched to focus mode.
  2. Tabbed to the "2" button.
  3. Pressed numpad8 to review the current line. Result: 2
  4. Pressed shift+numpad7 to move review to top line. Result: 2
  5. Tabbed to the "3" button.
  6. Pressed shift+d to report details. Result: d
  7. Tabbed to the text box.
  8. Pressed home to move to start of line.
  9. Pressed NVDA+d to report details. Result: no additional details
  10. Pressed right arrow to move to "b".
  11. Pressed NVDA+d to report details. Result: d
  12. Switched to browse mode.
  13. Pressed control+home, then b repeatedly to move to the "3" button.
  14. Pressed NVDA+d to report details. Result: d

Known issues with pull request:

I looked for other non-obvious instances where we rely on the previous behaviour internally like script_reportDetailsSummary or MozillaCompoundTextInfo, but didn't find any. However, I can't be certain that I didn't miss anything else.

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 added 2 commits May 14, 2026 20:12
…w and read line. (nvaccess#20096)"

This reverts most of commit 3ad497a.
It does not revert the type annotation fixes in review.py or the fix entry in changes.md.
@jcsteh
Copy link
Copy Markdown
Contributor Author

jcsteh commented May 14, 2026

This currently completely breaks text editing in web browsers. Drafting until I figure that out.

@jcsteh jcsteh marked this pull request as ready for review May 14, 2026 11:40
@jcsteh jcsteh requested a review from a team as a code owner May 14, 2026 11:40
@jcsteh jcsteh requested a review from SaschaCowley May 14, 2026 11:40
@jcsteh
Copy link
Copy Markdown
Contributor Author

jcsteh commented May 14, 2026

Ah Zarq, I just realised we're now in 2026.3, but #20096 was in 2026.2. So I guess this needs to be rebased against beta.

@jcsteh
Copy link
Copy Markdown
Contributor Author

jcsteh commented May 14, 2026

Actually, I think it might be better to revert #20096 from beta and let this whole thing wait until 2026.3.

@jcsteh
Copy link
Copy Markdown
Contributor Author

jcsteh commented May 14, 2026

Arrrrgh! Changing the TextInfo like this breaks mouse tracking. Mouse tracking's handling of embedded objects is all kinds of broken and probably shouldn't use IA2TextTextInfo the way it does, but that's a much bigger lift to fix, so we're going to need yet another alternative here.

@jcsteh jcsteh marked this pull request as draft May 14, 2026 13:20
@jcsteh
Copy link
Copy Markdown
Contributor Author

jcsteh commented May 14, 2026

Honestly out of ideas and there are just way too many obscure edge cases here. Let's just revert this per #20134 and I guess #15159 will just need to languish for a few more years.

@jcsteh jcsteh closed this May 14, 2026
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

Development

Successfully merging this pull request may close these issues.

1 participant