Skip to content

Commit

Permalink
Put the constructedstylesheets on the HTML element instead of the doc…
Browse files Browse the repository at this point in the history
…ument
  • Loading branch information
skitterm committed Sep 24, 2024
1 parent e76afcd commit b24f271
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/rrweb-snapshot/src/snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1050,10 +1050,6 @@ export function serializeNodeWithId(
constructedStylesheets['a'] = shadowRootEl.adoptedStyleSheets.map(
(stylesheet) => stringifyStylesheet(stylesheet),
);
serializedNode.chromaticAdoptedStylesheets =
shadowRootEl.adoptedStyleSheets.map((stylesheet) =>
stringifyStylesheet(stylesheet),
);
}
}
}
Expand Down Expand Up @@ -1363,7 +1359,8 @@ function snapshot(
});

// @ts-expect-error asdf
serializedNode.constructedStylesheets = constructedStylesheets;
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
serializedNode.childNodes[1].constructedStylesheets = constructedStylesheets;

return serializedNode;
}
Expand Down

0 comments on commit b24f271

Please sign in to comment.