GoogleChrome / accessibility-developer-tools

This is a library of accessibility-related testing and utility code.
Apache License 2.0
2.27k stars 359 forks source link

specify support of ShadowRoot #341

Open valdrinkoshi opened 7 years ago

valdrinkoshi commented 7 years ago

https://github.com/GoogleChrome/accessibility-developer-tools/pull/338 actually provided support for elements hosted in a shadow root, not a <template>. This PR makes it more clear & updates the tests accordingly.

When an element is hosted in <template>.content, its .parentNode will be a DocumentFragment, and the fragment's .host will be undefined. When an element is hosted in a shadowRoot, its .parentNode will be a DocumentFragment, and the fragment's .host will be the shadowRoot owner element 🎉

valdrinkoshi commented 7 years ago

@alice @addyosmani FYI. This is just to have more robust tests 💪