Skip to content

Commit 01612b7

Browse files
authored
update cssom package to rrweb self-owned package 'rrweb-cssom' (#925)
* test: update cssom package to rrweb self-owned package 'rrweb-cssom' * style: remove outdated comments
1 parent d5d877e commit 01612b7

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@
3939
"lint": "yarn run concurrently --success=all -r -m=1 'yarn run markdownlint docs' 'yarn eslint packages/*/src --ext .ts,.tsx,.js,.jsx,.svelte'"
4040
},
4141
"resolutions": {
42-
"**/jsdom/cssom": "^0.5.0"
42+
"**/jsdom/cssom": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz"
4343
}
4444
}

packages/rrdom/test/diff.test.ts

+1-7
Original file line numberDiff line numberDiff line change
@@ -1210,9 +1210,7 @@ describe('diff algorithm for rrdom', () => {
12101210
expect(styleEl.sheet?.cssRules[0].cssText).toEqual('div {color: black;}');
12111211
});
12121212

1213-
// JSDOM/CSSOM is currently broken for this test
1214-
// remove '.skip' once https://github.com/NV/CSSOM/pull/113#issue-712485075 is merged
1215-
it.skip('should insert rule at index [0,0] and keep existing rules', () => {
1213+
it('should insert rule at index [0,0] and keep existing rules', () => {
12161214
document.write(`
12171215
<style>
12181216
@media {
@@ -1229,10 +1227,6 @@ describe('diff algorithm for rrdom', () => {
12291227
];
12301228
applyVirtualStyleRulesToNode(styleEl, virtualStyleRules);
12311229

1232-
console.log(
1233-
Array.from((styleEl.sheet?.cssRules[0] as CSSMediaRule).cssRules),
1234-
);
1235-
12361230
expect(
12371231
(styleEl.sheet?.cssRules[0] as CSSMediaRule).cssRules?.length,
12381232
).toEqual(3);

yarn.lock

+5-1
Original file line numberDiff line numberDiff line change
@@ -3878,7 +3878,11 @@ csso@^4.0.2:
38783878
dependencies:
38793879
css-tree "^1.1.2"
38803880

3881-
cssom@^0.4.4, cssom@^0.5.0:
3881+
cssom@^0.4.4, "cssom@https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz":
3882+
version "0.6.0"
3883+
resolved "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz#ed298055b97cbddcdeb278f904857629dec5e0e1"
3884+
3885+
cssom@^0.5.0:
38823886
version "0.5.0"
38833887
resolved "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz"
38843888
integrity sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw==

0 commit comments

Comments
 (0)