add meta event and fix childList observer, also update related replayer

This commit is contained in:
Yanzhen Yu
2026-04-01 12:00:00 +08:00
parent cd0889e9c5
commit 487f1d0c9a
7 changed files with 164 additions and 189 deletions

View File

@@ -74,13 +74,6 @@ function initMutationObserver(cb: mutationCallBack): MutationObserver {
item.attributes[attributeName!] = value;
}
case 'childList': {
removedNodes.forEach(n => {
removes.push({
parentId: id,
id: mirror.getId(n as INode),
});
mirror.removeNodeFromMap(n as INode);
});
addedNodes.forEach(n => {
adds.push({
parentId: id,
@@ -90,9 +83,15 @@ function initMutationObserver(cb: mutationCallBack): MutationObserver {
nextId: !nextSibling
? nextSibling
: mirror.getId(nextSibling as INode),
node: serializeNodeWithId(n, document, mirror.map)!,
});
});
removedNodes.forEach(n => {
removes.push({
parentId: id,
id: mirror.getId(n as INode),
});
serializeNodeWithId(n as INode, document, mirror.map);
mirror.removeNodeFromMap(n as INode);
});
break;
}