On click, this outputs 1 then 2:
const myElem = document.getElementById("myElem")
myElem.addEventListener('click', () => queueMicrotask(() => console.log(1)));
window.addEventListener('click', () => console.log(2));
<button id="myElem">Click me</button>
If queueMicrotask is replaced with setTimeout it outputs 2 then 1. This means bubbling happens in microtasks, but not macrotasks.
Is it a part of DOM spec or just a browser implementation detail?