w3c / deviceorientation

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

Convert Acceleration/RotationRate interfaces to dictionaries #90

Closed saschanaz closed 3 years ago

saschanaz commented 3 years ago

Fixes #89


Preview | Diff

anssiko commented 3 years ago

Thanks, given Blink currently is the only implementation that exposes the interfaces (per #89), I'll defer to @reillyeon to understand web compat implications (I did not see any UseCounters in Blink that'd help here, but maybe I overlooked something).

I could imagine some existing web content might feature test against these interfaces, but I'd like to see some data on that.

mkruisselbrink commented 3 years ago

Per WebIDL attributes can not be dictionary types. As this seems to be changing the types of various attributes in DeviceMotionEvent to a dictionary, the result of that is invalid IDL.

(see https://heycam.github.io/webidl/#idl-attributes:

The type of the attribute, after resolving typedefs, must not be a nullable or non-nullable version of any of the following types: [...] a dictionary type

saschanaz commented 3 years ago

Per WebIDL attributes can not be dictionary types. As this seems to be changing the types of various attributes in DeviceMotionEvent to a dictionary, the result of that is invalid IDL.

(see https://heycam.github.io/webidl/#idl-attributes:

The type of the attribute, after resolving typedefs, must not be a nullable or non-nullable version of any of the following types: [...] a dictionary type

Oh that's true! Sorry for bothering you, I'll file an issue at Web IDL instead.

saschanaz commented 3 years ago

Okay, dictionaries are copied and thus not very good for attributes (ev.acceleration === ev.acceleration will return false), closing.