browser
browser copied to clipboard
events: bubble DOM tree events to window
According with the MDN documentation, the DOM tree events must bubble untli the window object.
In addition to the events listed below, many events can bubble from the Document contained in the window object. https://developer.mozilla.org/en-US/docs/Web/API/Window#events
Examples using FF:
var nb = 0;
window.addEventListener('foo', function(event) {nb ++;}, true);
document.getElementById('content').dispatchEvent(new Event('foo'));
nb; // returns 1
var nb = 0;
window.addEventListener('foo', function(event) {nb ++;});
document.getElementById('content').dispatchEvent(new Event('foo', {'bubbles':true}));
nb; // returns 1
But our usage of libdom node dispatch will not take account the pure zig window object.