Bug 1963996: Clear the selection if IAccessibleTextSelectionContainer::setSelections is called with nSelections set to 0. r=eeejay

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.

Differential Revision: https://phabricator.services.mozilla.com/D247875
This commit is contained in:
James Teh
2025-05-08 06:33:47 +00:00
committed by jteh@mozilla.com
parent cbb0e08325
commit 7932ffe32b
4 changed files with 20 additions and 2 deletions

View File

@@ -110,5 +110,13 @@ addAccessibleTask(
[p, 0, p, 1],
[link, 0, link, 1],
]);
info("Clearing selection");
selected = waitForEvent(EVENT_TEXT_SELECTION_CHANGED, docAcc);
await runPython(`
docSel.setSelections(0, byref(IA2TextSelection()))
`);
await selected;
checkSelection(docAcc, []);
}
);