Skip to content

Commit

Permalink
update cssom package to rrweb self-owned package 'rrweb-cssom' (#925)
Browse files Browse the repository at this point in the history
* test: update cssom package to rrweb self-owned package 'rrweb-cssom'

* style: remove outdated comments
  • Loading branch information
YunFeng0817 authored Jul 2, 2022
1 parent d5d877e commit 01612b7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@
"lint": "yarn run concurrently --success=all -r -m=1 'yarn run markdownlint docs' 'yarn eslint packages/*/src --ext .ts,.tsx,.js,.jsx,.svelte'"
},
"resolutions": {
"**/jsdom/cssom": "^0.5.0"
"**/jsdom/cssom": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz"
}
}
8 changes: 1 addition & 7 deletions packages/rrdom/test/diff.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1210,9 +1210,7 @@ describe('diff algorithm for rrdom', () => {
expect(styleEl.sheet?.cssRules[0].cssText).toEqual('div {color: black;}');
});

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

console.log(
Array.from((styleEl.sheet?.cssRules[0] as CSSMediaRule).cssRules),
);

expect(
(styleEl.sheet?.cssRules[0] as CSSMediaRule).cssRules?.length,
).toEqual(3);
Expand Down
6 changes: 5 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3878,7 +3878,11 @@ csso@^4.0.2:
dependencies:
css-tree "^1.1.2"

cssom@^0.4.4, cssom@^0.5.0:
cssom@^0.4.4, "cssom@https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz":
version "0.6.0"
resolved "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz#ed298055b97cbddcdeb278f904857629dec5e0e1"

cssom@^0.5.0:
version "0.5.0"
resolved "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz"
integrity sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw==
Expand Down

0 comments on commit 01612b7

Please sign in to comment.