-
Notifications
You must be signed in to change notification settings - Fork 152
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
Conversation
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
There was a problem hiding this 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!
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.]
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.]
Motivation
Addresses issue #5489
Context
First half of #5489 was addressed in #5728, this addresses the remainder.
Pull request checklist
yarn null:autoadd
yarn fastpass
yarn test
)<rootDir>/test-results/unit/coverage
fix:
,chore:
,feat(feature-name):
,refactor:
). SeeCONTRIBUTING.md
.