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

fix: Add shadow dom support for tab stops visualizations #6046

Merged
merged 4 commits into from
Oct 10, 2022

Conversation

sfoslund
Copy link
Member

Details

Adds shadow dom support for tab stops visualization, before this change:

[Screenshot of new tab stops shadow doms test resource page with tab stops visualization from current canary extension. There are only 3 tabbed elements visualized and shadow dom elements are skipped.]
BeforeTabstopShadowDoms

After:
[Screenshot of new tab stops shadow doms test resource page with tab stops visualization from built dev extension. There are 5 tabbed elements visualized, including open shadow dom elements.]
AfterTabstopShadowDoms

Motivation

Addresses issue #5489

Context

First half of #5489 was addressed in #5728, this addresses the remainder.

Pull request checklist

  • Addresses an existing issue: Improve shadow DOM support (visualizations & tab stops automation) #5489
  • Ran yarn null:autoadd
  • Ran yarn fastpass
  • Added/updated relevant unit test(s) (and ran yarn test)
  • Verified code coverage for the changes made. Check coverage report at: <rootDir>/test-results/unit/coverage
  • PR title AND final merge commit title both start with a semantic tag (fix:, chore:, feat(feature-name):, refactor:). See CONTRIBUTING.md.
  • (UI changes only) Added screenshots/GIFs to description above
  • [n/a] (UI changes only) Verified usability with NVDA/JAWS

@sfoslund sfoslund requested a review from a team as a code owner September 16, 2022 21:15
@peterdur
Copy link
Contributor

Looks like this may also address #6042. The MSN portal uses lots of shadow DOM.


export class SingleFrameTabStopListener implements AllFrameRunnerTarget<TabStopEvent> {
export class SingleFrameTabStopListener
extends ShadowDomFocusTracker
Copy link
Member

Choose a reason for hiding this comment

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

Is there a particular reason we're using inheritance for this? Do we foresee this being a base class that others would use?

We generally favor using composition over inheritance unless there's a strong reason to use inheritance.

Copy link
Member Author

Choose a reason for hiding this comment

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

I chose inheritance here since it felt like there was a lot of duplicated code between SingleFrameTabStopsListener and TabStopsOrchestrator (which both use this as a base class with these PR changes)- specifically, managing the shadow root event listeners felt like it lends itself more to inheritance.

Copy link
Member Author

Choose a reason for hiding this comment

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

@waabid I'm going to go ahead and merge this since it's been approved and has been sitting for so long, but let me know if you have any further feedback and I'll be happy to make a follow up PR to resolve it!

Copy link
Contributor

@peterdur peterdur left a comment

Choose a reason for hiding this comment

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

A couple of notes, but generally looks good!

@sfoslund sfoslund merged commit 3ad13f2 into microsoft:main Oct 10, 2022
@sfoslund sfoslund deleted the TabStopsShadowDom branch October 10, 2022 19:12
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.

3 participants