Text node updates inside of an aria-live are partially or redundantly announced on Firefox
On Firefox, text node updates (e.g. via textNode.textContent) are partially or redundantly announced (depending on whether aria-atomic is "true").
Steps to reproduce:
- Open this demo
- Click the different buttons, which do the following:
- Change
div.textContentwheredivhasaria-liveset - Change
textNode.textContentwheretextNodeis a child ofdivthat hasaria-liveset - Change
textNode.textContentwheretextNodeis a child ofdivthat hasaria-liveandaria-atomicset
- Change
Actual behavior:
- Announces "Foo X Bar Y Baz Z"
- Announces "X Y Z"
- Announces "Foo X Bar Y Baz Z Foo X Bar Y Baz Z Foo X Bar Y Baz Z" ("Foo X Bar Y Baz Z" repeated three times)
Expected behavior:
- Announces "Foo X Bar Y Baz Z"
- Announces "Foo X Bar Y Baz Z"
- Announces "Foo X Bar Y Baz Z"
System configuration
NVDA installed/portable/running from source:
portable
NVDA version:
2021.3.5
Windows version:
Version 10.0.19042 Build 19042
Name and version of other software in use when reproducing the issue:
Firefox 91.10.0esr (64-bit)
Other information about your system:
Other questions
Does the issue still occur after restarting your computer?
Yes
Have you tried any other versions of NVDA? If so, please report their behaviors.
2021.2 (same behavior)
If NVDA add-ons are disabled, is your problem still occurring?
No add-ons installed
Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?
Yes
cc @jcsteh
2. Announces "X Y Z"
Since this is the same text node (not a new one), Firefox calculates a diff between the old text and the new text. This allows only the text that actually changed to be reported.
Strictly speaking, there is no bug here; live regions should only report changed content. That said, I guess it's confusing that changing element.textContent vs textNode.text yields a different result. We should look into making these consistent in Firefox.
3. Announces "Foo X Bar Y Baz Z Foo X Bar Y Baz Z Foo X Bar Y Baz Z" ("Foo X Bar Y Baz Z" repeated three times)
I'm not sure what's causing this yet. It's definitely a bug. I'm just not sure whether it's in Firefox or NVDA. It suggests multiple events are being fired, which is sometimes reasonable, but I don't know why in this case.
Filed https://bugzilla.mozilla.org/show_bug.cgi?id=1776416.
I realised that the triple speaking with aria-atomic probably occurs because there are three separate insertion events when diffing, one for each number.
Commenting here to say that the bug that Jamie filed in Firefox has been fixed! Now, the behaviors of the given test cases match the "Expected behavior" section in the original post, as tested by me on the latest Firefox Nightly. Thanks for the report :)