-
Notifications
You must be signed in to change notification settings - Fork 55
Make it easy to synthesize objects typically created by the UA? #51
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
Comments
I can take this. I have been dispensing opinions around constructors for a long time, and having it written down somewhere would be great. It's a bit subtle sometimes---see e.g. w3c/wot-scripting-api#3 where I came to the conclusion that there was too much UA magic for constructors to make sense---so this will be an interesting entry to write. |
Great, looking forward to gleaning your wisdom! |
@domenic you assigned yourself on this. Are you planning to submit a PR? |
Somehow this fell off my to-do list. Let me bump it back up. |
Should this be merged with #44? |
Oh, except there's a PR for this in #80. :-) |
Often the 99% use case for an API involves the UA generating objects of a particular type (eg.
MouseEvent
). IMHO it's important to also support the 1% case where subject objects are created by script and are (mostly) indistinguishable from the UA-generated ones.For example, a library/component designed just for
MouseEvent
could be driven via another component that consumesTouchEvent
s by synthesizing fakeMouseEvent
instances. Also this is often necessary to enable good unit testing of components.Should the design principles say something about this?
The text was updated successfully, but these errors were encountered: