-
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
removeChild isn't calling invalidateAccessibleContent sometimes #816
Comments
Right now in the tests I'm working around things, by manually calling // Moving this node around the scene graph should not change it's aria labelled by associations.
checkOnYourOwnAriaLabelledByAssociations( j );
rootNode.addChild( new Node( { children: [ j ] } ) );
checkOnYourOwnAriaLabelledByAssociations( j );
rootNode.removeChild( j );
// TODO: remove this manual call once bug is fixed in removeChild, see https://github.com/phetsims/scenery/issues/816
j.invalidateAccessibleContent();
checkOnYourOwnAriaLabelledByAssociations( j ); |
I am not sure I understand this test, do we expect the correct attributes when we remove a child from the scene graph? The node's accessible content is no longer in the PDOM at that point, right? Does this work? // Moving this node around the scene graph should not change it's aria labelled by associations.
checkOnYourOwnAriaLabelledByAssociations( j );
rootNode.addChild( new Node( { children: [ j ] } ) );
checkOnYourOwnAriaLabelledByAssociations( j );
rootNode.removeChild( j );
rootNode.addChild( j );
checkOnYourOwnAriaLabelledByAssociations( j ); |
Yes @jessegreenberg, your above code snippet does work, because the aria-labelledby attribute values aren't being updated on removeChild, but then you add back the child, it will update the values (and the element ids will all be the same because the trail is the same for j). Basically think about it this way (this is untested pseudo code )
I'm happy to explain more here or over zoom. |
…is removed from the graph, see #816
We discussed 6/27/18. @zepumph demonstrated the problem. We discovered that when we remove Node from the scene graph we do not update any part of the AccessiblePeer, and until now there hasn't been a need to. But in this case, we need to broadcast a message that notifies that aria-labelledby and aria-describedby associations need to be updated when the Node is removed. We made sure that the associations are updated However, we were aware that this fix will definitely change with the model/view separation of Accessibility, see #814. |
We can close this issue after the above commits which add #816 (comment). |
From creating unit tests as part of #701, I found that the PDOM wasn't updating the arialabelledby associations appropriately when removing child. I'm not too familiar with the
AccessibleTree
code, but I don't see potential discrepancies betweenremoveTree
which callsI also know that the accessibility fuzzer is testing the removal of children, so maybe this is a weird edge case, or a bug where I'm doing a bad practice in the aria-labelledby tests without realizing it, like in #811.
I will need to take a closer look at it, and maybe talk to @jonathanolson about it.
The text was updated successfully, but these errors were encountered: