Commit 07ac5c9
authored
Masking: Avoid the repeated calls to
* masking performance: avoid the repeated calls to `closest` when recursing through the DOM
- needsMask===true means that an ancestor has tested positively for masking, and so this node and all descendents should be masked
- needsMask===false means that no ancestors have tested positively for masking, we should check each node encountered
- needsMask===undefined means that we don't know whether ancestors are masked or not (e.g. after a mutation) and should look up the tree
* Add tests including an explicit characterData mutation tests
* Further performance improvement: avoid calls to `el.matches` when on a leaf node, e.g. a `<br/>`
---------
Authored-by: eoghanmurray <eoghan@getthere.ie>
Based on initial PR rrweb-io#1338 by Alexey Babik <alexey.babik@noibu.com>closest when recursing through the DOM (rrweb-io#1349)1 parent 8aea5b0 commit 07ac5c9
6 files changed
Lines changed: 323 additions & 24 deletions
File tree
- .changeset
- packages
- rrweb-snapshot/src
- rrweb
- src/record
- test
- __snapshots__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
| 313 | + | |
313 | 314 | | |
314 | 315 | | |
315 | 316 | | |
316 | 317 | | |
317 | 318 | | |
318 | 319 | | |
319 | 320 | | |
320 | | - | |
321 | 321 | | |
322 | | - | |
323 | | - | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
324 | 327 | | |
325 | | - | |
| 328 | + | |
326 | 329 | | |
327 | | - | |
328 | 330 | | |
329 | | - | |
330 | | - | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
331 | 336 | | |
332 | 337 | | |
333 | 338 | | |
| |||
426 | 431 | | |
427 | 432 | | |
428 | 433 | | |
429 | | - | |
430 | | - | |
| 434 | + | |
431 | 435 | | |
432 | 436 | | |
433 | 437 | | |
| |||
447 | 451 | | |
448 | 452 | | |
449 | 453 | | |
450 | | - | |
451 | | - | |
| 454 | + | |
452 | 455 | | |
453 | 456 | | |
454 | 457 | | |
| |||
500 | 503 | | |
501 | 504 | | |
502 | 505 | | |
503 | | - | |
504 | | - | |
| 506 | + | |
505 | 507 | | |
506 | 508 | | |
507 | 509 | | |
| |||
531 | 533 | | |
532 | 534 | | |
533 | 535 | | |
534 | | - | |
535 | | - | |
| 536 | + | |
536 | 537 | | |
537 | 538 | | |
538 | 539 | | |
539 | 540 | | |
540 | | - | |
| 541 | + | |
541 | 542 | | |
542 | 543 | | |
543 | 544 | | |
| |||
568 | 569 | | |
569 | 570 | | |
570 | 571 | | |
571 | | - | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
| 572 | + | |
577 | 573 | | |
578 | 574 | | |
579 | 575 | | |
| |||
935 | 931 | | |
936 | 932 | | |
937 | 933 | | |
| 934 | + | |
938 | 935 | | |
939 | 936 | | |
940 | 937 | | |
| |||
980 | 977 | | |
981 | 978 | | |
982 | 979 | | |
| 980 | + | |
983 | 981 | | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
984 | 997 | | |
985 | 998 | | |
986 | 999 | | |
987 | 1000 | | |
988 | 1001 | | |
989 | | - | |
990 | | - | |
| 1002 | + | |
991 | 1003 | | |
992 | 1004 | | |
993 | 1005 | | |
| |||
1058 | 1070 | | |
1059 | 1071 | | |
1060 | 1072 | | |
| 1073 | + | |
1061 | 1074 | | |
1062 | 1075 | | |
1063 | 1076 | | |
| |||
1118 | 1131 | | |
1119 | 1132 | | |
1120 | 1133 | | |
| 1134 | + | |
1121 | 1135 | | |
1122 | 1136 | | |
1123 | 1137 | | |
| |||
1165 | 1179 | | |
1166 | 1180 | | |
1167 | 1181 | | |
| 1182 | + | |
1168 | 1183 | | |
1169 | 1184 | | |
1170 | 1185 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
515 | 515 | | |
516 | 516 | | |
517 | 517 | | |
| 518 | + | |
518 | 519 | | |
519 | 520 | | |
520 | 521 | | |
| |||
0 commit comments