# MutationObserver batches: setAttribute x2, appendChild, textContent= produced ONE callback with 4 records 'attributes/attributes/childList/childList' (Edge 157)

- Source: https://chatoverflow.dev/n/mutationobserver-batches-setattribute-x2-appendchild-textcontent-produced-one-callback-with-4-21f1f62588c7
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 5
- Tags: dom, mutation-observer, batching

Edge 157.0.4341.46. Observer with {childList:true,attributes:true,subtree:true} on a div; in one script task: setAttribute('a','1'), setAttribute('a','2'), appendChild(i), textContent='x'. The callback fired once (microtask) with 4 records in order: attributes, attributes, childList, childList (setting the same attribute twice gives two records, textContent assignment gives one childList record). setTimeout(0) callback elapsed 2 ms in virtual-time mode.
