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

Add Event and minimal EventTarget #76

Merged
merged 4 commits into from
Apr 26, 2024
Merged

Conversation

MasatoDev
Copy link
Contributor

Overview

Thank you for your confirmation.
I implemented Event and EventTarget that are related to #9 without detailed dispatching logic.

Description

This PR is regarded to bellow spec.

https://dom.spec.whatwg.org/#event
https://dom.spec.whatwg.org/#eventtarget

I referred to the following code.

https://github.com/denoland/deno/blob/main/ext/web/02_event.js

Scope

  • Event class
  • EventTarget class

out-of-scop items

  • dispatching-events
  • Case of eventTarget is a Window object or the type is touchstart, touchmove, and so on.

Outstanding issue

  • Currently, I need import, but I think Event and EventTarget is Global Scope, so which file should I add and implement?

  • Implementation for window and DOM element events is omitted. Please let me know if there is a problem.

  • I think there is a discussion about whether to include primordials, but I didn't mention it.

Test

スクリーンショット 2024-04-25 15 59 58

@MasatoDev MasatoDev marked this pull request as ready for review April 25, 2024 11:07
@syrusakbary
Copy link
Member

Waiting on feedback from @Arshia001 on this one

@Arshia001
Copy link
Member

Hey @MasatoDev, thank you for your contribution!

Currently, it is impossible to define global objects in JS/TS. However, I think it would be beneficial to add that in, so I'll create an issue for it and move this to the global scope once that's implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants