nvda icon indicating copy to clipboard operation
nvda copied to clipboard

Text node updates inside of an aria-live are partially or redundantly announced on Firefox

Open tjhsstgeek opened this issue 3 years ago • 3 comments

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:

  1. Open this demo
  2. Click the different buttons, which do the following:
    1. Change div.textContent where div has aria-live set
    2. Change textNode.textContent where textNode is a child of div that has aria-live set
    3. Change textNode.textContent where textNode is a child of div that has aria-live and aria-atomic set

Actual behavior:

  1. Announces "Foo X Bar Y Baz Z"
  2. Announces "X Y Z"
  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)

Expected behavior:

  1. Announces "Foo X Bar Y Baz Z"
  2. Announces "Foo X Bar Y Baz Z"
  3. 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

tjhsstgeek avatar Jun 22 '22 18:06 tjhsstgeek

cc @jcsteh

lukaszgo1 avatar Jun 23 '22 09:06 lukaszgo1

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.

jcsteh avatar Jun 24 '22 00:06 jcsteh

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.

jcsteh avatar Jun 24 '22 12:06 jcsteh

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 :)

nmlapre avatar Oct 13 '22 18:10 nmlapre