Skip to content

Commit

Permalink
Generate two text content entries in the existing style element
Browse files Browse the repository at this point in the history
  • Loading branch information
eoghanmurray committed Jul 9, 2024
1 parent 75808d8 commit 2978a91
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 20 deletions.
43 changes: 24 additions & 19 deletions packages/rrweb/test/__snapshots__/integration.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -16522,14 +16522,19 @@ exports[`record integration tests > should record style mutations with multiple
\\"type\\": 3,
\\"textContent\\": \\"\\",
\\"id\\": 7
},
{
\\"type\\": 3,
\\"textContent\\": \\"\\",
\\"id\\": 8
}
],
\\"id\\": 6
},
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n \\",
\\"id\\": 8
\\"id\\": 9
},
{
\\"type\\": 2,
Expand All @@ -16539,18 +16544,18 @@ exports[`record integration tests > should record style mutations with multiple
{
\\"type\\": 3,
\\"textContent\\": \\"SCRIPT_PLACEHOLDER\\",
\\"id\\": 10
\\"id\\": 11
}
],
\\"id\\": 9
\\"id\\": 10
}
],
\\"id\\": 4
},
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n \\",
\\"id\\": 11
\\"id\\": 12
},
{
\\"type\\": 2,
Expand All @@ -16560,7 +16565,7 @@ exports[`record integration tests > should record style mutations with multiple
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n\\\\t \\",
\\"id\\": 13
\\"id\\": 14
},
{
\\"type\\": 2,
Expand All @@ -16569,12 +16574,12 @@ exports[`record integration tests > should record style mutations with multiple
\\"id\\": \\"one\\"
},
\\"childNodes\\": [],
\\"id\\": 14
\\"id\\": 15
},
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n \\",
\\"id\\": 15
\\"id\\": 16
},
{
\\"type\\": 2,
Expand All @@ -16583,12 +16588,12 @@ exports[`record integration tests > should record style mutations with multiple
\\"id\\": \\"two\\"
},
\\"childNodes\\": [],
\\"id\\": 16
\\"id\\": 17
},
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n\\\\t \\",
\\"id\\": 17
\\"id\\": 18
},
{
\\"type\\": 2,
Expand All @@ -16598,18 +16603,18 @@ exports[`record integration tests > should record style mutations with multiple
{
\\"type\\": 3,
\\"textContent\\": \\"SCRIPT_PLACEHOLDER\\",
\\"id\\": 19
\\"id\\": 20
}
],
\\"id\\": 18
\\"id\\": 19
},
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n \\\\n \\",
\\"id\\": 20
\\"id\\": 21
}
],
\\"id\\": 12
\\"id\\": 13
}
],
\\"id\\": 3
Expand Down Expand Up @@ -16641,25 +16646,25 @@ exports[`record integration tests > should record style mutations with multiple
\\"_cssText\\": \\"#two { color: rgb(255, 0, 0); }\\"
},
\\"childNodes\\": [],
\\"id\\": 21
\\"id\\": 22
}
},
{
\\"parentId\\": 21,
\\"parentId\\": 22,
\\"nextId\\": null,
\\"node\\": {
\\"type\\": 3,
\\"textContent\\": \\"\\",
\\"id\\": 22
\\"id\\": 23
}
},
{
\\"parentId\\": 21,
\\"nextId\\": 22,
\\"parentId\\": 22,
\\"nextId\\": 23,
\\"node\\": {
\\"type\\": 3,
\\"textContent\\": \\"\\",
\\"id\\": 23
\\"id\\": 24
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion packages/rrweb/test/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1487,13 +1487,13 @@ describe('record integration tests', function (this: ISuite) {
<head>
<style>
/* hello */
/* world */
</style>
</head>
<body>
<div id="one"></div>
<div id="two"></div>
<script>
document.querySelector("style").append(document.createTextNode("/* world */"));
document.querySelector("style").sheet.insertRule('#one { color: ${Color}; }', 0);
</script>
</body></html>
Expand Down

0 comments on commit 2978a91

Please sign in to comment.