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

Need to define the DeviceMotionEvent constructor #83

Closed
foolip opened this issue Sep 4, 2019 · 4 comments
Closed

Need to define the DeviceMotionEvent constructor #83

foolip opened this issue Sep 4, 2019 · 4 comments

Comments

@foolip
Copy link
Member

foolip commented Sep 4, 2019

https://w3c.github.io/deviceorientation/#devicemotionevent

There's no prose for what the constructor does, but questions that can't be answered from looking at the Web IDL definition.

Specifically, can acceleration, accelerationIncludingGravity and rotationRate ever be null? Because DeviceMotionEventInit takes init dictionaries for these members, I would guess that they can't, but prose could say something about this.

@rakuco
Copy link
Member

rakuco commented Oct 19, 2019

Hmm, existing implementations have conflicting views here.

new DeviceMotionEvent('foo') creates a DeviceMotionEvent whose accelerometer, accelerationIncludingGravity and rotationRate attributes return null on Chrome 78, but on Firefox 69.0.3 the attributes return Device{Acceleration,RotationRate} objects with all attributes set to null.

I don't have an iPhone to test the WebKit implementation.

@rakuco
Copy link
Member

rakuco commented Oct 31, 2023

WebKit doesn't implement DeviceMotionEvent's constructor, but the differences in behavior between Gecko and Blink still exist (see #91).

@rakuco
Copy link
Member

rakuco commented Feb 12, 2024

I think the Gecko and Blink behavior difference is #91. I don't think there needs to be any specific prose describing the constructor steps because it comes from https://dom.spec.whatwg.org/#concept-event-constructor and https://dom.spec.whatwg.org/#inner-event-creation-steps

@reillyeon
Copy link
Member

Closing this and will resolve the implementation differences mentioned in #91.

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

3 participants