From dbdf9c4504a8531fa49814bec203d361b6c50b04 Mon Sep 17 00:00:00 2001 From: Reilly Grant Date: Wed, 28 Feb 2024 14:38:13 -0800 Subject: [PATCH] Make DeviceMotionEventInit members nullable with null default This change reverts #55 and defines the default values of the DeviceMotionEventInit as null as I believe was the original intent of the definition before that change. Null DeviceMotionEvent attributes have semantic meaning (they declare that the host does not provide the given sensor) and so script should be able to initialize an event with its attributes set to null. Fixed #91. --- index.bs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.bs b/index.bs index 5d2622b..1dce358 100644 --- a/index.bs +++ b/index.bs @@ -507,9 +507,9 @@ dictionary DeviceMotionEventRotationRateInit { }; dictionary DeviceMotionEventInit : EventInit { - DeviceMotionEventAccelerationInit acceleration; - DeviceMotionEventAccelerationInit accelerationIncludingGravity; - DeviceMotionEventRotationRateInit rotationRate; + DeviceMotionEventAccelerationInit? acceleration = null; + DeviceMotionEventAccelerationInit? accelerationIncludingGravity = null; + DeviceMotionEventRotationRateInit? rotationRate = null; double interval = 0; };