Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: duplicate textContent for style element cause incremental style mutation invalid #1417
fix: duplicate textContent for style element cause incremental style mutation invalid #1417
Changes from 15 commits
4272390
0c90863
8c5a69f
c294538
5d18b46
8825d53
3e00f09
a83dc52
9331f17
226bd9b
9256f7e
55dbb38
71245d7
d1fba35
1e8a670
5211578
d778c77
2a91f6f
02a50bc
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check warning on line 923 in packages/rrweb/src/replay/index.ts
GitHub Actions / ESLint Report Analysis
packages/rrweb/src/replay/index.ts#L923
Check warning on line 942 in packages/rrweb/src/replay/index.ts
GitHub Actions / ESLint Report Analysis
packages/rrweb/src/replay/index.ts#L942
Check warning on line 949 in packages/rrweb/src/replay/index.ts
GitHub Actions / ESLint Report Analysis
packages/rrweb/src/replay/index.ts#L949
Check warning on line 1064 in packages/rrweb/src/replay/index.ts
GitHub Actions / ESLint Report Analysis
packages/rrweb/src/replay/index.ts#L1064
Check warning on line 1385 in packages/rrweb/src/replay/index.ts
GitHub Actions / ESLint Report Analysis
packages/rrweb/src/replay/index.ts#L1385
Check warning on line 1502 in packages/rrweb/src/replay/index.ts
GitHub Actions / ESLint Report Analysis
packages/rrweb/src/replay/index.ts#L1502
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
given
childNodeArray
is of length 1, couldn't we go directly toconst cssText = childNodeArray[0] as (Node & RRNode)
without the for loop?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But maybe I should be asking why you are checking that the length is only one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it a proxy for '_cssText attribute was present'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I see that the
!mirror.hasNode(cssText)
check makes sure it's not a previously legitimately added text contentThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this always going to be the same?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should raise a warning instead in case these are not the same?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be the same, but I’m not entirely sure if there might be any corner cases that could cause issues. I believe that _cssText should always contain the most accurate style content, so I use that value to avoid any potential problems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tweaked the color in d778c77 to show which one we intend to use.
I don't think a warning is worth it; this fixup is for 'historic' bad data and the only case we know is that they are both the same