gecko vbuf backend: When an accessible is moved, do not reuse that node or its descendants #10776
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Link to issue number:
None.
Summary of the issue:
In Firefox, when loading Mastodon with the advanced web interface enabled (Preferences -> Appearance), The whole container that contains the timeline is not rendered in browse mode. When you press NVDA+f5, it appears.
This occurs because the accessible containing the timeline articles gets moved (re-parented) at the same time as the articles are inserted. See https://bugzilla.mozilla.org/show_bug.cgi?id=1592518 for further details.
Description of how this pull request fixes the issue:
vbufBase: Allow alwaysRerenderDescendants to be set on a node after it is rendered to indicate that we must not reuse descendants in future.
Previously, alwaysRerenderDescendants could be set on a node during rendering and that would prevent any reuse while rendering the subtree. However, if alwaysRerenderDescendants was set on a node after rendering, it had no effect on future reuse. Now, it does.
gecko vbuf backend: When an accessible is moved, do not reuse that node or its descendants.
When an accessible is moved, events are fired as if the accessible were removed and then inserted. The insertion events are fired as if it were a new subtree; i.e. only one insertion for the root of the subtree. This means that if new descendants are inserted at the same time as the root is moved, we don't get specific events for those insertions. Because of that, we mustn't reuse the subtree. Otherwise, we wouldn't walk inside it and thus wouldn't know about the new descendants.
To achieve this, we set alwaysRerenderDescendants on any node which gets a hide event. If the node is being removed instead of moved (no subsequent insertion event), this is cheap and simply has no effect.
Testing performed:
Known issues with pull request:
This means that moved subtrees are never reused. In practice, I don't think this occurs often (at least not with large subtrees) and thus shouldn't have any practical impact.
Alternatives
Change log entry:
Bug fixes:
- In Firefox, when loading Mastodon with the advanced web interface enabled, all timelines now render correctly in browse mode.