File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
packages/rrweb/src/replay Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -1402,6 +1402,17 @@ export class Replayer {
1402
1402
if ( parent )
1403
1403
try {
1404
1404
parent . removeChild ( target as Node & RRNode ) ;
1405
+ /**
1406
+ * https://github.com/rrweb-io/rrweb/pull/887
1407
+ * Remove any virtual style rules for stylesheets if a child text node is removed.
1408
+ */
1409
+ if (
1410
+ this . usingVirtualDom &&
1411
+ target . nodeName === '#text' &&
1412
+ parent . nodeName === 'STYLE' &&
1413
+ ( parent as RRStyleElement ) . rules ?. length > 0
1414
+ )
1415
+ ( parent as RRStyleElement ) . rules = [ ] ;
1405
1416
} catch ( error ) {
1406
1417
if ( error instanceof DOMException ) {
1407
1418
this . warn (
@@ -1556,6 +1567,17 @@ export class Replayer {
1556
1567
1557
1568
( parent as TNode ) . appendChild ( target as TNode ) ;
1558
1569
}
1570
+ /**
1571
+ * https://github.com/rrweb-io/rrweb/pull/887
1572
+ * Remove any virtual style rules for stylesheets if a new text node is appended.
1573
+ */
1574
+ if (
1575
+ this . usingVirtualDom &&
1576
+ target . nodeName === '#text' &&
1577
+ parent . nodeName === 'STYLE' &&
1578
+ ( parent as RRStyleElement ) . rules ?. length > 0
1579
+ )
1580
+ ( parent as RRStyleElement ) . rules = [ ] ;
1559
1581
1560
1582
if ( isSerializedIframe ( target , this . mirror ) ) {
1561
1583
const targetId = this . mirror . getId ( target as HTMLIFrameElement ) ;
You can’t perform that action at this time.
0 commit comments