-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is invalidateAccessibleContent the best way to update the PDOM? #814
Comments
Here is the issue devoted to supporting Property types in a11y api setters, #796 |
If we can just recreate the specific DOM elements when we need to that would be a better for performance, and really reduce the size/complexity of invalidateAccessibleContent. So i like option 1. There will still be times where we need to redraw everything, so maybe we coculd keep |
Removing my assignment until we discuss next meeting. |
Figuring out what can be permanent, what can be mutated, and what needs to be recreated sounds nice for performance and memory/GC. Scenery's usual approach would be to have a poolable wrapper around the mutable objects needed, and objects would get created/unpooled/mutated/pooled as needed. If desired, let me know, as it would be good to discuss via audio. |
Super rough notes:
|
Most of the above notes actually have more to do with #795 than this issue, so I will attempt to consolidate the above notes into work for this issue: The work needed to be done can be outlines in the following ordered list (ordered on when to implement). More and more we are thinking of
|
Today, with help from @jonathanolson, I managed to trace a large bug with the current implementation. We were treating |
I spoke to @jessegreenberg recently, and he said that we could potentially get away with removing |
After the above commit, the showing of modal dialogs will not toggle the display of other view content in the PDOM, but the scenery code is working as expected and can now be simplified greatly. I will hold off on implementing a solution for the dialogs until I have a better understanding of the final picture of AccessiblePeer, AccessibleInstance, and Accessibility. |
Today I focused on getting aria-labelledby working within the new model/view separation. It was very tiresome to do, and posed a lot of difficulty for me because of the pointers that nodes have to other nodes, we need to make sure that we update other nodes association objects correctly when a node changes (added/removed/or moved around). I haven't done aria-describedby at all, but will work on that next. |
Now describedby is working as well. From here I want to work on removing the dialog usage of |
…blePeer should use getters for node properties, see #814
In cdd68f4 I deleted invalidateAccessibleContent and all mentions of it. In the above commit I did many minor things needed to clean up Accessibility.js and AccessiblePeer.js From here the only a11y methods that cause the peer to be completely redrawn are as follows:
This list seems reasonable for now. It is mostly methods that have to do with the elements themselves, and their order. As we need more performance heavy subsystems later on, we can look into converting these triggers into mutable pieces of the AccessiblePeer. Using #814 (comment) as a guide, it looks like I completed most of number 2, and some of number 3 (electing to not go for updating the mutability of the above functions). I think that enough work has been done in this issue to begin work back on #795. I am going to merge this branch back into master, because I have tested well and don't think it will mess up anything big. It will be better to hash out bugs now rather than later. @jonathanolson can you review? I'm not sure how best to go through this. Almost all the changes are in Accessibility and AccessiblePeer. I would especially like help on the TODO at the end of |
I forgot about #832, unassigning. |
Looks like #832 covered this review. Closing |
As implementing "higher level" abstractions ontop of the current a11y api in #795, I am wondering if our current approach in optimal.
@jessegreenberg and I have long talked about the inefficiencies of needing to call invalidateAccessibleContent whenever any small piece of the PDOM needs to be redrawn, so I thought it deserved an issue.
My main concern, it is a bummer that the entire
invalidateAccessibleContent
needs to be redrawn if, for example, you want to change the description sibling from a<p>
to a<span>
. Currently that change involves recreating the entire Peer, so all of its siblings.We have gone with this logic for so long because it is quite a bit easier than trying to figure out exactly what we need to redraw in the peer from changes in the Node.
Here is the added complexity this is bringing up in regards to #795 and the abstractions:
invalidateAccessibleContent
needs a way tosetHelpText
, when it redraws the peer. This is to support multiple option order. So there needs a be an "implementation" function in the a11y mixin that the es5 setter andinvalidateAccessibleContent
can both call. We need this "implementation' function because we want the es5 setter to validate as if it is only called from the client. This is similar to the approach we took in #800.This problem is complicated further (at least in my head) as we start to support
{Property|string}
for things likehelpText
. Although not yet implemented, it seems like if helpText is of typeProperty
, then it will need to register listeners insetHelpTextImplementation
. Right now, invalidateAccessibleContent would call thesetHelpTextImplementation
every time the peer is redrawn, such that we addProperty
(de)registration to the list of inefficiencies that would occur potentially every frame.Steps I would like to see in this issue:
invalidateAccessibleContent
and move to an improved, more efficient, and more intelligent system.{Property}
values.Tagging @mbarlow12 @jonathanolson @jessegreenberg for discussion. Sorry this is a long one, but it seems like this summer is the time to do this; otherwise it probably won't get done until it is really in the way and a pain in the butt.
The text was updated successfully, but these errors were encountered: