Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

events: bubble DOM tree events to window #161

Open
krichprollsch opened this issue Jan 19, 2024 · 1 comment
Open

events: bubble DOM tree events to window #161

krichprollsch opened this issue Jan 19, 2024 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@krichprollsch
Copy link
Member

krichprollsch commented Jan 19, 2024

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 krichprollsch added the bug Something isn't working label Jan 19, 2024
@krichprollsch
Copy link
Member Author

We could register listeners to document with a * type to receive document's events.
Then we will able to dispatch these events to widow's listeners.

Maybe we will have to implement the * type into libdom to do so.

@francisbouvier francisbouvier added this to the Invite Beta milestone Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants