Aha! Finally worked out what's going on here. A scrolling event is received after the DocAccessibleParent is shut down, which can happen if the BrowserParent is in the process of being destroyed (probably the tab closed) but there are still events in the IPC queue. Most Recv*Event methods in BrowserParent check mShutdown, but a few don't, including RecvScrollingEvent. This event is for the document, so we successfully get and cache an xpcAccessibleDocument for it. However, that xpcAccessibleDocument will never be removed from the cache because it's already shut down, so NotifyOfRemoteDocShutdown (which would normally remove it from the XPC cache) won't get called.
Bug 1630208 Comment 41 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
Aha! Finally worked out what's going on here. (Try run: https://treeherder.mozilla.org/#/jobs?repo=try&selectedTaskRun=ZGjE9oWKShG8Wd5b5FaPaA.0&revision=654685996f7c4c63a843f592288ff063a3caf026 ) A scrolling event is received after the DocAccessibleParent is shut down, which can happen if the BrowserParent is in the process of being destroyed (probably the tab closed) but there are still events in the IPC queue. Most Recv*Event methods in BrowserParent check mShutdown, but a few don't, including RecvScrollingEvent. This event is for the document, so we successfully get and cache an xpcAccessibleDocument for it. However, that xpcAccessibleDocument will never be removed from the cache because it's already shut down, so NotifyOfRemoteDocShutdown (which would normally remove it from the XPC cache) won't get called.