Closed foolip closed 7 months 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.
WebKit doesn't implement DeviceMotionEvent's constructor, but the differences in behavior between Gecko and Blink still exist (see #91).
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
Closing this and will resolve the implementation differences mentioned in #91.
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
androtationRate
ever be null? BecauseDeviceMotionEventInit
takes init dictionaries for these members, I would guess that they can't, but prose could say something about this.