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

fire an orientation event need to use the dictionary #184

Open
marcoscaceres opened this issue May 19, 2024 · 1 comment
Open

fire an orientation event need to use the dictionary #184

marcoscaceres opened this issue May 19, 2024 · 1 comment

Comments

@marcoscaceres
Copy link
Member

In "fire an orientation event", it reads:

Fire an event named event at window, using DeviceOrientationEvent, with the alpha attribute initialized to z, the beta attribute initialized to x, the gamma attribute initialized to y, and the absolute attribute initialized to absolute.

However, the event needs to be initialized with DeviceOrientationEventInit instead.

@reillyeon
Copy link
Member

reillyeon commented Jun 14, 2024

Are there any canonical examples (e.g. in the WebIDL or Infra specs) for the correct incantation for initializing a new instance of an interface? I feel like I've seen a number of different styles over the years. Your comment that "the event needs to be initialized with DeviceOrientationEventInit instead" implies that the steps should be something like:

  1. Let eventInit be «[ "alpha" → z, "beta" → x, "gamma" → y, "absolute" → absolute ]».
  2. Let event be a new DeviceOrientationEvent using eventInit.
  3. Fire an event named event at window, using event.

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

No branches or pull requests

2 participants