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(snapshotter): support constructed CSSStyleSheet #7084

Merged
merged 1 commit into from
Jun 17, 2021

Conversation

JoelEinbinder
Copy link
Contributor

@JoelEinbinder JoelEinbinder commented Jun 12, 2021

Fixes #7085

@pavelfeldman
Copy link
Member

I am reading about constructable ss here and it feels like you should dedupe them. It will actually make the code simpler to follow.

The doc is saying that you are supposed to create a bunch of constructable stylesheets and then add them into the adopted collections left and right. I would mimic this spirit in the serialization process:

  • dedupe constructables by reference, serialize them once
  • use your array of stylesheets only on the snapshot itself, not on shadow attrs
  • put the index in that table in the template attributes for hydration

That way you are as scaleable as the web itself.

src/server/snapshot/snapshotterInjected.ts Outdated Show resolved Hide resolved
src/server/snapshot/snapshotterInjected.ts Outdated Show resolved Hide resolved
@JoelEinbinder JoelEinbinder merged commit 10a82f8 into microsoft:master Jun 17, 2021
This was referenced Jun 17, 2021
aslushnikov pushed a commit to aslushnikov/playwright that referenced this pull request Jun 26, 2021
aslushnikov added a commit that referenced this pull request Jun 26, 2021
PR #7084 SHA 10a82f8

Fixes #7085

Co-authored-by: Joel Einbinder <joel.einbinder@gmail.com>
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.

[BUG] Traceviewer screens are not recorded well when using constructable stylesheets
3 participants