-
Notifications
You must be signed in to change notification settings - Fork 776
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
Add support for shadowDOM #87
Comments
KSD-208 ESCAPE SELECTORS
@dylanb I think the original Chrome A11y Developer Tools source may have changed, so it's unclear which part of the source was supposed to be linked. We use document.querySelector methods which don't step into the Shadow DOM, right? Does the Chrome version do the work of iterating over nodes to audit instead of relying on DOM APIs? We might need something similar to support a subset of rules for testing virtual DOM (using JSDOM, pre-compiled Angular 2, etc.). |
This work is backlogged. @marcysutton it is a lot more complex than just iterating into shadow roots. For example IDs can be unique within each shadow root. Also, trying to figure out what the computed styles are... @felixzapata best short-term route is to use the polymer polyfilled DOM and ignore unique ID issues when the IDs live in their own shadow DOM |
Could you check for a shadow root on each node (maybe just on custom elements) and then just test the markup within it in isolation of the rest of the page? They're supposed to be a new document context anyway. Maybe not all tests are needed (eg you could potentially ignore ID uniqueness). |
@seancurtis That would seem to be in the spirit of Shadow DOM, yeah. And you wouldn't need to ignore ID uniqueness since IDs should be unique to a shadow root. |
The difficulty is in keeping this performant. It makes sense to limit Shadow DOM testing to custom elements. If anyone is interested in helping out building this into axe, I'd be happy to pitch in. |
On the performance issue, do you track performance already? @ricksbrown did an amazing refactor of accessibility-developer-tools where he pulled the entire "gather" step into one single tree traversal, instead of doing a traverse or select (which does a more efficient traverse on the browser-side) for each rule. Would that be feasible for axe-core? Short of that, how would you find custom elements in the page? Is there a way to do it without traversing? And, obviously, this wouldn't handle cases where developers have used Shadow DOM without using custom elements (see: Chrome DevTools for an example), but I guess that's enough of a corner case not to worry about? |
Side-note: I'm working on performance right now as part of #240. That work should definitely help since we're using a style cache for lookups instead of more expensive calculations on the tree over and over. |
Hi all. When shadow dom support is released, how big do you expect the breaking changes to be to the current API and generated results object (if any)? |
fix (audit): don't override custom helpUrl
@TalhaAydin you can review the work being conducted in the shadowDOM branch: #317 |
@TalhaAydin there will be no changes to the API when you use the library There will be changes to the API that rules use, so if a rule uses commons or utils functions, it may have to be updated. Rules that do not use commons and util functions will continue to function as before The results object will only change for violations that are found within shadow DOM. The We will update the version number to 3.x because of these changes. |
Closed with #317. |
…quelabs#87) Bumps [bl](https://github.com/rvagg/bl) from 4.0.2 to 4.0.3. - [Release notes](https://github.com/rvagg/bl/releases) - [Commits](rvagg/bl@v4.0.2...v4.0.3) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Similar to what is in accessibility-developer-tools https://github.com/GoogleChrome/accessibility-developer-tools/blob/master/src/js/AuditRule.js#L129
The text was updated successfully, but these errors were encountered: