Skip to content

Conversation

@YunFeng0817
Copy link
Member

@YunFeng0817 YunFeng0817 commented Feb 16, 2022

scenario

If a page highly depends on custom elements, there may be lots of nested shadow dom. #754 may as an example
And the current version doesn't support recording shadow doms which were attached after the full snapshot.

what changed

  1. Hijack HTMLElement.attachShadow. When we attach a shadow dom on a created element, the old version can't detect the change and the new shadow dom can't be observed.
  2. If we attach a shadow dom on a created element, the serialized element data won't contain 'isShadowHost' property. So I have to add a workaround on the replay side.
  3. notInDoc check doesn't work for nested shadow dom so I changed the checking way.
  4. add recording test for nested shadow dom

Related issues: #38, #754

@YunFeng0817 YunFeng0817 requested a review from Yuyz0112 February 23, 2022 05:59
@YunFeng0817 YunFeng0817 marked this pull request as draft March 9, 2022 13:17
@YunFeng0817 YunFeng0817 marked this pull request as ready for review March 9, 2022 16:47
Copy link
Member

@Juice10 Juice10 left a comment

Choose a reason for hiding this comment

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

I'm new to shadowDom, so probably not the best to judge this, but the PR looks good to me!

@Yuyz0112
Copy link
Member

Looks this is the only way to observe the attaching behavior.

@Yuyz0112 Yuyz0112 merged commit d8f9290 into master Mar 18, 2022
@YunFeng0817 YunFeng0817 deleted the shadowdom branch March 18, 2022 09:04
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.

4 participants