browser icon indicating copy to clipboard operation
browser copied to clipboard

events: bubble DOM tree events to window

Open krichprollsch opened this issue 1 year ago • 1 comments

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.

krichprollsch avatar Jan 19 '24 10:01 krichprollsch