Closed Bug 1963996 Opened 5 months ago Closed 4 months ago

IAccessibleTextSelectionContainer::setSelections needs to support 0 selections

Categories

(Core :: Disability Access APIs, defect)

Desktop
Windows
defect

Tracking

()

VERIFIED FIXED
140 Branch
Tracking Status
firefox-esr128 --- unaffected
firefox138 + wontfix
firefox139 + verified
firefox140 + verified

People

(Reporter: Jamie, Assigned: Jamie)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(2 files)

In bug 1951573, I removed support for IAccessibleTextSelectionContainer::setSelections with nSelections set to 0. This complies with the IA2 spec, which says (emphasis mine):

makes 1 or more selections within this subtree

Unfortunately, contrary to the spec, NVDA depends on being able to clear selections by setting nSelections to 0. This was always true to some extent, but it became a hard requirement in NVDA PR #17838. I didn't realise because I worked on bug 1951573 around the same time this NVDA PR landed, so I didn't hit this problem. :(

Because of this, native app selection is currently completely broken with NVDA + Firefox. Chromium already supports this.

Set release status flags based on info from the regressing bug 1951573

I removed this behaviour in bug 1951573.
Unfortunately, it turns out that contrary to the spec (which says "1 or more selections"), NVDA depends on this behaviour.
Reinstate this by supporting kRemoveAllExistingSelectedRanges in HyperTextAccessibleBase::RemoveFromSelection and using that.

[Accidental duplicate comment.]

[Tracking Requested - why for this release]: Completely breaks selection and copying of formatted text on web pages in Firefox for NVDA screen reader users, even though this works in other browsers.

Pushed by jteh@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c4661f93b3cc Clear the selection if IAccessibleTextSelectionContainer::setSelections is called with nSelections set to 0. r=eeejay
Status: NEW → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 140 Branch

The patch landed in nightly and beta is affected.
:Jamie, is this bug important enough to require an uplift?

For more information, please visit BugBot documentation.

Flags: needinfo?(jteh)

I removed this behaviour in bug 1951573.
Unfortunately, it turns out that contrary to the spec (which says "1 or more selections"), NVDA depends on this behaviour.
Reinstate this by supporting kRemoveAllExistingSelectedRanges in HyperTextAccessibleBase::RemoveFromSelection and using that.

Original Revision: https://phabricator.services.mozilla.com/D247875

Attachment #9486491 - Flags: approval-mozilla-beta?

firefox-beta Uplift Approval Request

  • User impact if declined: Completely breaks selection and copying of formatted text on web pages in Firefox for NVDA screen reader users, even though this works in other browsers.
  • Code covered by automated testing: no
  • Fix verified in Nightly: yes
  • Needs manual QE test: yes
  • Steps to reproduce for manual QE testing: With the NVDA screen reader: 1. Open https://example.com/ . 2. 2. press control+home to move to the top of the document. 3. Press NVDA+shift+f10. NVDA should say: "native app selection mode enabled". 4. Press shift+rightArrow. The letter "E" in example should be visibly selected.
  • Risk associated with taking this patch: low
  • Explanation of risk level: Completely breaks selection and copying of formatted text on web pages in Firefox for NVDA screen reader users, even though this works in other browsers.
  • String changes made/needed: none
  • Is Android affected?: no
Flags: qe-verify+
Flags: needinfo?(jteh)
QA Whiteboard: [uplift] [qa-ver-needed-c140/b139]
Attachment #9486491 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
QA Contact: mboldan

I've tried to reproduce the issue on Firefox 139.0b1 and on Firefox 140.0a1 (2025-05-02) (64-bit), under Windows 11x64 without any luck. It seems that the issue is not reproducible on my end, by using the steps from Comment 9. Please let me know if there are some steps missing from that comment, or if I should try something else in order to reproduce the issue.

Thanks. Are you able to reproduce it using the latest NVDA beta? This impacts the current release version of NVDA as well, but the beta (and thus the upcoming release) is more strict, so it might be easier to reproduce there.

Flags: needinfo?(mboldan)

I've managed to install the Beta NVDA build on my work station, and now, when I try to enable the native app selection mode, I'm announced that 'native app selection mode unsupported in this document'. Should I do some extra steps while using the Beta NVDA build?

Flags: needinfo?(mboldan) → needinfo?(jteh)

If you haven't already, can you please try restarting your system and trying this again with NVDA beta? That error is very strange and really shouldn't be happening, but I'm not sure what's going on.

Flags: needinfo?(jteh)

The same message is displayed after restart too. FYI - I've installed the 2025.1beta5 (2025.1.36402) NVDA version. Please let me know if I should try something else!

To clarify, do you get this message - "native app selection mode unsupported in this document" - with builds of Firefox before the fix or after the fix? Before the fix, this is expected. After the fix, you should get the expected results I outlined in comment 9.

Flags: needinfo?(mboldan)

Thanks for the clarification, James!
It seems that only on affected build I get that message. On fixed builds the steps are working without any issues.
Managed to verify the issue on Firefox 139.0b8 and on Firefox 140.0a1 (2025-05-11) under Windows 11.
Based on this, I will mark the issue as Verified Fixed,

Status: RESOLVED → VERIFIED
QA Whiteboard: [uplift] [qa-ver-needed-c140/b139] → [uplift] [qa-ver-done-c140/b139]
Flags: qe-verify+
Flags: needinfo?(mboldan)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: