Mutation (attribute & text) duplicate info elimination (#1269)

* Add a test which demonstrates how no mutations are generated when an element is created & destroyed in the same 'cycle' (a cylce here being enforced by freezePage)

* Test demonstrating current behaviour I'm about to modify; the data-test="x" attribute is present twice in the mutation, as is the textContent value of 'y'

* Attribute or text modifications on just-added nodes are redundant as demonstrated in test case

* Some correct test changes from other tests; I've manually inspected each of these mutation removals and confirmed that the attribute values are already present in the newly added nodes elsewhere in the same mutation

* Improve reliability of test case as per Justin's advice
This commit is contained in:
Eoghan Murray
2023-08-03 17:11:43 +01:00
committed by GitHub
parent d872d2809e
commit 7103625b46
5 changed files with 305 additions and 42 deletions

View File

@@ -0,0 +1,5 @@
---
'rrweb': patch
---
Don't include redundant data from text/attribute mutations on just-added nodes