Re: [deviceorientation] Invalid IDL in DeviceMotionEventInit

Updating the test sounds great.

As far as the comments in #55 about what is specified or not...

There's no actual text anywhere in that describes the steps for the `DeviceMotionEvent` constructor, or indeed any of the other constructors in this specification.  In particular, they do not define any

In the absence of "event constructing steps", will end up doing:

> For each _member_ → _value_ in _dictionary,_ if _event_ has an attribute whose identifier is _member_, then initialize that attribute to _value_

OK, so let's take a look at the `acceleration` attribute of `DeviceMotionEventInit`.  This is of type `DeviceAccelerationInit` but the corresponding attribute on the event is of type `DeviceAcceleration?`.  It's not obvious how exactly to initialize the latter from the former.  @annevk how should this work exactly?  Even fixing it up via the "event construction steps" doesn't technically help, because those run after that "initialize that attribute" step...  Maybe the "initialize that attribute" step should not run if the types don't match?

Anyway, the simplest thing here from my point of view would be to:

1. Clarify that step 4 does nothing for attributes whose type does not match the init dictionary.
2. Define "event  construction steps" that if the value is not present in the dictionary initialize the attribute to null, else initialize the attribute to a `DeviceAcceleration` whose properties are set to the same values as the values in the `DeviceAccelerationInit`.

GitHub Notification of comment by bzbarsky
Please view or discuss this issue at using your GitHub account

Received on Monday, 24 September 2018 20:41:18 UTC