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

Closed
wants to merge 1 commit into 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?

@reillyeon
Copy link
Member Author

Thanks for the reminder. Abandoning this change because it's not valid WebIDL. We should instead do as I suggested on #91 and update the specification to match implementations after @rakuco's investigation.

@reillyeon reillyeon closed this Jun 15, 2024
@reillyeon reillyeon deleted the issue_91 branch June 15, 2024 00:09
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