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

refactor: usage of root node for getting window or shadow root #1064

Merged
merged 9 commits into from
Jul 4, 2022

Conversation

sshanzel
Copy link
Member

@sshanzel sshanzel commented Jun 30, 2022

Changes

Describe what this PR does

  • After reading through the proposals of what will be the official API for getting the Selection on shadow DOM, there seems to be no clear date of when to expect it.
  • Though after going through the links below, I was able to find a better solution for fetching the actual root.
  • We now require an element to be passed to identify which root it belongs to when we use getRootNode.

Relevant links:

One example is if you visit our preview deployment, which is not whitelisted in our background worker, and if you inspect the HTML, you'll notice the shadow DOM to be present but the user mention still works since the getRootNode provides a more accurate for which the element was embedded.

Preview deployment: https://preview.app.daily.dev/

Please make sure existing components are not breaking/affected by this PR

I have also manually tested the preview deployment on all major browsers we support (including Safari and Edge).

Manual Testing

On those affected packages:

  • Have you done sanity checks in the webapp?
  • Have you done sanity checks in the extension?
  • Does this not break anything in companion?

Did you test the modified components media queries?

  • MobileL (420px)
  • Tablet (656px)
  • Laptop (1020px)

Did you test on actual mobile devices?

  • iOS (Chrome and Safari)
  • Android

WT-104 #done

Copy link
Contributor

@rebelchris rebelchris left a comment

Choose a reason for hiding this comment

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

Wow interesting find!
Looks great, thanks for testing and validating this better fix :)

@sshanzel
Copy link
Member Author

sshanzel commented Jun 30, 2022

@rebelchris I refactored it a bit to be safer from edge cases on any other browsers outside of Chromium, just to be sure. Let me know if have any concerns about it. Thank you for the awesome review!

Also thoroughly tested it on our browser on all ends.

@sshanzel sshanzel requested a review from rebelchris June 30, 2022 19:35
@sshanzel sshanzel merged commit ae5979f into master Jul 4, 2022
@sshanzel sshanzel deleted the WT-104-root-selection branch July 4, 2022 23:27
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.

2 participants