Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make DeviceMotionEventInit members nullable with null default #141

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

reillyeon
Copy link
Member

@reillyeon reillyeon commented Feb 28, 2024

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.


Preview | Diff

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.
Comment on lines +510 to +512
DeviceMotionEventAccelerationInit? acceleration = null;
DeviceMotionEventAccelerationInit? accelerationIncludingGravity = null;
DeviceMotionEventRotationRateInit? rotationRate = null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if you default these to {} instead?

@marcoscaceres
Copy link
Member

@reillyeon, what would you like to do here? See @annevk suggestion. As the events are primarily fired by the browser, we can make these defaults as implementation friendly as possible.

@annevk
Copy link
Member

annevk commented May 24, 2024

@marcoscaceres see #91 (comment) for context. At this point we're waiting for @rakuco I think.

@marcoscaceres
Copy link
Member

Ah, right, thanks!... @rakuco, do you want me to take this over?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DeviceMotionEvent atttributes can't be null per current IDL
3 participants