w3c / deviceorientation

W3C Device Orientation spec
https://www.w3.org/TR/orientation-event/
Other
49 stars 32 forks source link

Need to define the DeviceMotionEvent constructor #83

Closed foolip closed 7 months ago

foolip commented 5 years ago

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 commented 4 years ago

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 commented 11 months ago

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

rakuco commented 7 months ago

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 commented 7 months ago

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