-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Single style capture #1437
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
Merged
eoghanmurray
merged 44 commits into
rrweb-io:master
from
eoghanmurray:single-style-capture
Aug 6, 2024
Merged
Single style capture #1437
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
ea9f096
Unrelated, but the presence of a blank `<style></style>` element when…
eoghanmurray 385dee8
Default to headless on retest
eoghanmurray 945bde3
Add motivating test which can be used against this PR as well as in #…
eoghanmurray a6ef9c4
Recognize that snapshot.ts::serializeTextNode does important work for…
eoghanmurray bc769aa
Prep PR for async <style> serialization via assets: refactor stringif…
eoghanmurray b98c062
Add a test to show how mutations on multiple text nodes within the <s…
eoghanmurray 6df62e1
Multiple <style> text children: Demonstrate a failing test as CSS was…
eoghanmurray 899911d
Add test and remedy for the most trivial type of failure of `findCssT…
eoghanmurray 173cd0f
Missed this which is 'happy path' - add a test to catch catch case
eoghanmurray 2983a19
Create single-style-capture.md
eoghanmurray ee0fab5
An expected test change as per this PR; must have missed it first tim…
eoghanmurray 3f4e0b7
More expected test changes I missed when authoring PR
eoghanmurray 8d440c3
New function buildStyleNode to better encapsulate the separate behavi…
eoghanmurray 1d31ad7
Revert an accidental reordering
eoghanmurray 0067f5d
Add the css text length to the splits array as a method of checking t…
eoghanmurray 7b5dda7
Refactor out `applyCssSplits` for clarity and so we can test it
eoghanmurray 27832fe
Add more tests and fix bug that was causing css text to end up in the…
eoghanmurray 7099d29
The _cssTextSplits should only apply to <style> elements
eoghanmurray 2a7560a
Realize we don't actually need to look at the `.sheet` during a mutat…
eoghanmurray 7a3d21e
Fix the following typing problem in the tests:
eoghanmurray b357b43
Highlight that there is a replayer involved in this test (as well as …
eoghanmurray 91d29a5
Think this is how this should have been authored
eoghanmurray 45f2953
Rather than recording a new separate error-prone _cssTextSplits attri…
eoghanmurray 9fe426d
The `blankTextNodes` config option proved very confusing for both Jus…
eoghanmurray c5d1ef0
Simplify as I don't think this warning is actually needed, and tests …
eoghanmurray dd1bfee
Caught a case where a text mutation, which bypasses `_cssText`, wasn'…
eoghanmurray 46aa8f2
Don't record css content twice when a <style> element is added in a m…
eoghanmurray 8b9cc06
I suspected this style of mutation was going to result in duplicate t…
eoghanmurray 3e9edbc
Include another type of <style> addition to ensure it doesn't duplica…
eoghanmurray b9622d0
Fix case where we wouldn't have been able to mutate a <style> text no…
eoghanmurray a9d14ea
Prefer `waitForRAF`
eoghanmurray 3156575
feat: add test for recording and replaying style mutations with multi…
Juice10 b358827
This is the effect of the following two changesets:
eoghanmurray 217e149
A bit more explicit with which style elements we're referring to in test
eoghanmurray b932c98
Generate two text content entries in the existing style element
eoghanmurray 876b109
Fixup eslint
eoghanmurray 39007f1
Some extra reminder on these tests as I believe 'can record and repla…
eoghanmurray 34def57
Fix regression on test [html file]: with-style-sheet-with-import.html
eoghanmurray f40a053
Make algorithm easier to understand while still ensuring the 'maintai…
eoghanmurray 7a93a1d
add 'type' keyword in css.test.ts
eoghanmurray 83b3482
add cross-env to retest command in packages/rrweb/package.json
eoghanmurray 63d79fb
Add break to short circuit when normalized string found
eoghanmurray 9770a16
Convert one test over to happy-dom as unlike JSDOM, that can access s…
eoghanmurray 58bfecc
Add stripping of css comments and also semicolons to the `normalizeCs…
eoghanmurray File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| "rrweb-snapshot": patch | ||
| "rrweb": patch | ||
| --- | ||
|
|
||
| Edge case: Provide support for mutations on a <style> element which (unusually) has multiple text nodes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.