Skip to content
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

invalidate a11y #1260

Conversation

wsdwsd0829
Copy link
Contributor

The invaidateAccessibilityElements is needed for following cases:

  1. when there is a accessibilityContainer in the tree we need to make sure it's invalidated whenever insert a view or layer.
  2. If no accessibilityContainer involved, we still need to invalidate the first ancestor view to recollect new nodes.
  3. Whenever layer backed nodes changes themselves like attributedText change.

They all covered in tests.
Downside: it involves climbing the tree two times for 1 & 2.
With all the work I still think it's better to just remove the cache (_accessibilityElements) in _ASDisplayView.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@@ -285,6 +285,28 @@ - (void)addSubview:(UIView *)view
#endif
}

- (void)insertSubview:(UIView *)view atIndex:(NSInteger)index {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will be called instead of addSubview above.

@ay8s
Copy link
Collaborator

ay8s commented Dec 3, 2018

Related: #1161

@wsdwsd0829 wsdwsd0829 closed this Dec 7, 2018
@wsdwsd0829 wsdwsd0829 mentioned this pull request Dec 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants