Closed Bug 1743064 Opened 3 years ago Closed 3 years ago

With cache enabled, opening a Gmail message renders incorrectly in NVDA buffer

Categories

(Core :: Disability Access APIs, task)

Desktop
Windows
task

Tracking

()

RESOLVED FIXED
96 Branch
Tracking Status
firefox96 --- fixed

People

(Reporter: Jamie, Assigned: Jamie)

References

Details

Attachments

(1 file)

STR:

  1. Ensure accessibility.cache.enabled is true and NVDA is running.
  2. Open Gmail.
  3. Open a message from the message list.
  4. Try to read the message in NVDA browse mode.
    • Expected: You should not see content from the message list and you should be able to read the message.
    • Actual: The message is often missing and you see content from the message list which is no longer really in the document.

I think this is due to MSAA ids being reused too quickly. NVDA processes mutations asynchronously, so I think it sees mutations on ids that haven't been removed from the buffer yet and things get very confused. If I prevent ids from being released by tweaking MsaaAccessible's destructor, the problem goes away.

I guess this is a problem because we process all RemoteAccessible removals before we process any shows. Normally, within the same tick, removed accessibles exist at least until the newly added ones are shown.

I think my "limbo set" idea from bug 1739050 would fix this. That is, we don't destroy Accessibles until all mutations are done.

(In reply to James Teh [:Jamie] from comment #0)

I think my "limbo set" idea from bug 1739050 would fix this. That is, we don't destroy Accessibles until all mutations are done.

I implemented this and it didn't fully fix the problem. I guess the relevant mutations must be happening across different ticks. That's certainly quite possible, but what I don't understand is why this doesn't cause problems with the cache disabled. I guess the COM runtime must be holding onto references for a short while or something.

I guess the only real way to fix this is to have a short delay before MSAA ids are released. That needs to be longer than a tick, but not so long that we leak too much. Maybe an idle callback or something? Yuck.

This is necessary to fix problems with Gmail and NVDA caused by reusing ids too quickly.

Assignee: nobody → jteh
Status: NEW → ASSIGNED
Pushed by jteh@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3baa364e3c78
When the cache is enabled, release MSAA ids after a short delay. r=morgan
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 96 Branch
Flags: qe-verify+

Hello James,
I made the settings from description, installed the NVDA and followed the steps from description on Win10x64 using build 96.0a1(20211125214104), but I was not able to reproduce the issue. Can you please confirm that issue is fixed on your side?
Thank you so much.

Flags: needinfo?(jteh)

The issue is definitely fixed for me. It was always a little unpredictable, but i haven't seen this since the patch landed.

Flags: needinfo?(jteh)

(In reply to James Teh [:Jamie] from comment #1)

what I don't understand is why this doesn't cause problems with the cache disabled.

I forgot that we don't release the MsaAccessible (and thus its id) until the AccessibleWrap is destroyed. In contrast, the MsaaAccessible for a RemoteAccessible is deleted as soon as the RemoteAccessible is shut down (since RemoteAccessibles aren't ref counted). Combined with the difference in how mutations are handled between local and remote as described in comment 0, this must provide for sufficient time before ids are reused when the cache is disabled.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: