Fix adapt css with split (#1600)
Fix for #1575 where postcss was raising an exception * adapt the entire CSS as a whole in one pass with postcss, rather than adapting each split part separately * break up the postcss output again and assign to individual text nodes (kind of inverse of splitCssText at record side) * impose an upper bound of 30 iterations on the substring searches to preempt possible pathological behavior * add tests to demonstrate the scenario and prevent regression More technical details: * Fix algorithm; checks against `ix_end` within loop were incorrect when `ix_start` was bigger than zero. * Fix that length check against wrong array was causing 'should record style mutations with multiple child nodes and replay them correctly' test to fail. Note on last point: I haven't looked into things more deeply than that the test was complaining about missing .length after `replayer.pause(1000);`
This commit is contained in:
6
.changeset/fix-adapt-css.md
Normal file
6
.changeset/fix-adapt-css.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"rrweb": patch
|
||||
"rrweb-snapshot": patch
|
||||
---
|
||||
|
||||
#1575 Fix that postcss could fall over when trying to process css content split arbitrarily
|
||||
Reference in New Issue
Block a user