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: style element corner case #1417

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

YunFeng0817
Copy link
Member

style element's rules can be changed both by textContent and sheet API duplicate textContent can cause make dynamic rule mutation invalid

style element's rules can be changed both by textContent and sheet API
duplicate textContent can cause make dynamic rule mutation invalid
Copy link

changeset-bot bot commented Feb 23, 2024

🦋 Changeset detected

Latest commit: 4272390

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
rrweb-snapshot Patch
rrweb Patch
rrdom Patch
rrdom-nodejs Patch
rrweb-player Patch
@rrweb/types Patch
@rrweb/web-extension Patch
rrvideo Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@eoghanmurray
Copy link
Contributor

I think I need a little more explanation or a test case to review this properly

@@ -1558,20 +1558,33 @@ export class Replayer {
if (
parentSn &&
parentSn.type === NodeType.Element &&
parentSn.tagName === 'textarea' &&
mutation.node.type === NodeType.Text
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm confused by the removal of the tagName check here as this is supposed to be for legacy support.
shouldn't the check be changed to
(parentSn.tagName === 'textarea' || parentSn.tagName === 'style')
?

@eoghanmurray
Copy link
Contributor

eoghanmurray commented Apr 5, 2024

I'm working on similar stuff and am working on a test case


See #1437

@eoghanmurray
Copy link
Contributor

The new integration test in #1437 doesn't do much as-is as it passes both before and after the changesets in this PR, but maybe we could use it to demonstrate the problem you are fixing in this PR...

see comment
// TODO: we could get a lot more elaborate here with mixed textContent and insertRule mutations there

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.

None yet

2 participants