Files
rrweb/.changeset/skip-mask-check-on-leaf-elements.md
Eoghan Murray bbf7efd61c Skip mask check on leaf elements (#1512)
* Minor fixup for #1349; the 'we can avoid the check on leaf elements' optimisation wasn't being applied as `n.childNodes` was always truthy even when there were no childNodes.

Changing it to `n.childNodes.length` directly there (see #1402) actually caused a bug as during a mutation, we serialize the text node directly, and need to jump to the parentElement to do the check.
This is why I've reimplemented this optimisation inside `needMaskingText` where we are already had an `isElement` test

Thanks to @Paulhejia (https://github.com/Paulhejia/rrweb/) for spotting that `Boolean(n.childNodes)` is aways true.
2026-04-01 12:00:00 +08:00

95 B

rrweb-snapshot, rrweb
rrweb-snapshot rrweb
patch patch

optimisation: skip mask check on leaf elements