-
Notifications
You must be signed in to change notification settings - Fork 29
Update XRRay vector constructor to use correct webidl semantics #85
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
Conversation
Fixes immersive-web#84 This adds a new initializer type so that the defaults work correctly.
| 1. Initialize |ray|'s {{XRRay/direction}} to <code>{ x: 0.0, y: 0.0, z: -1.0, w: 0.0 }</code>. | ||
| 1. If |origin| was set, initialize |ray|'s {{XRRay/origin}}’s {{DOMPointReadOnly/x}} value to |origin|'s x dictionary member, {{DOMPointReadOnly/y}} value to |origin|'s y dictionary member, and {{DOMPointReadOnly/z}} value to |origin|'s z dictionary member. | ||
| 1. If |direction| was set, initialize |ray|'s {{XRRay/direction}}’s {{DOMPointReadOnly/x}} value to |direction|'s x dictionary member, {{DOMPointReadOnly/y}} value to |direction|'s y dictionary member, and {{DOMPointReadOnly/z}} value to |direction|'s z dictionary member. | ||
| 1. If all of |direction|'s {{XRRayDirectionInit/x}}, {{XRRayDirectionInit/y}}, and {{XRRayDirectionInit/z}} are zero, throw a {{TypeError}} and abort these steps. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chrome throws an InvalidStateError, but this should be a TypeError (XRRigidTransform also uses TypeErrors for this)
|
Looks good, merging now. |
|
On the Chrome side, y'all ideally should update webidl parsing to the newer thing, however if not you should then make the default behavior work as much as possible and change the error type to |
|
Oh, and the tests need fixing, but I might end up doing that myself if my Servo changes land first. |
Implements changes from immersive-web/hit-test#85
|
Chrome's behavior was incorrect because the implementation relied on multiple overloads for the constructor, I've reached out internally and was told that the change to require For reference, I've sent out initial CL with the fix (including WPTs): https://crrev.com/c/2145937. |
|
@bialpio it changes the semantics in the sense that you can no longer receive "nullable" dictionaries in webidl Also, you should use |
IIUC, that's the case even prior to this change, but the reason why we were getting them is because Chrome's XRRay Web IDL was not matching the one in the spec: https://chromium-review.googlesource.com/c/chromium/src/+/2145937/1/third_party/blink/renderer/modules/xr/xr_ray.idl#b11 - note the 0, 1 and 2 parameter overloads. I think I got it working in Chrome in a way that made sense in WPTs but forgot to adjust the specification. :( If you're ready to upstream your changes to the tests then go for it, I think it'll take me a while to go through CL with my change. |
Implements changes from immersive-web/hit-test#85
Implements changes from immersive-web/hit-test#85
Implements changes from immersive-web/hit-test#85
|
Ah, I see! I'd just assumed the spec had the webidl chrome was using :) My tests can be found in web-platform-tests/wpt#22868 , if you review that PR we can just go ahead and land it! |
Implements changes from immersive-web/hit-test#85
Implements changes from immersive-web/hit-test#85
Implements changes from immersive-web/hit-test#85
Implements changes from immersive-web/hit-test#85
Automatic update from web-platform-tests Update xrRay_constructor test to not throw See immersive-web/hit-test#83, this test is currently impossible to pass for a browser implementing the current WebIDL specification. -- Update XRRay semantics Implements changes from immersive-web/hit-test#85 -- Fix world generation to have vertices member -- wpt-commits: 7513c92e130e043def925bda97e9fb9d8fd0b48f, 0fce2e94f0feb04966868a0b5795d76ea1db3906, 08c95d8ca3466c37df307cb775502a916e22b814 wpt-pr: 22868
Automatic update from web-platform-tests Update xrRay_constructor test to not throw See immersive-web/hit-test#83, this test is currently impossible to pass for a browser implementing the current WebIDL specification. -- Update XRRay semantics Implements changes from immersive-web/hit-test#85 -- Fix world generation to have vertices member -- wpt-commits: 7513c92e130e043def925bda97e9fb9d8fd0b48f, 0fce2e94f0feb04966868a0b5795d76ea1db3906, 08c95d8ca3466c37df307cb775502a916e22b814 wpt-pr: 22868
Implements changes from immersive-web/hit-test#85
Implements changes from immersive-web/hit-test#85
Implements changes from immersive-web/hit-test#85
Automatic update from web-platform-tests Update xrRay_constructor test to not throw See immersive-web/hit-test#83, this test is currently impossible to pass for a browser implementing the current WebIDL specification. -- Update XRRay semantics Implements changes from immersive-web/hit-test#85 -- Fix world generation to have vertices member -- wpt-commits: 7513c92e130e043def925bda97e9fb9d8fd0b48f, 0fce2e94f0feb04966868a0b5795d76ea1db3906, 08c95d8ca3466c37df307cb775502a916e22b814 wpt-pr: 22868 UltraBlame original commit: 309322031e57b9f606c20274ad42711703753086
Automatic update from web-platform-tests Update xrRay_constructor test to not throw See immersive-web/hit-test#83, this test is currently impossible to pass for a browser implementing the current WebIDL specification. -- Update XRRay semantics Implements changes from immersive-web/hit-test#85 -- Fix world generation to have vertices member -- wpt-commits: 7513c92e130e043def925bda97e9fb9d8fd0b48f, 0fce2e94f0feb04966868a0b5795d76ea1db3906, 08c95d8ca3466c37df307cb775502a916e22b814 wpt-pr: 22868 UltraBlame original commit: 309322031e57b9f606c20274ad42711703753086
Automatic update from web-platform-tests Update xrRay_constructor test to not throw See immersive-web/hit-test#83, this test is currently impossible to pass for a browser implementing the current WebIDL specification. -- Update XRRay semantics Implements changes from immersive-web/hit-test#85 -- Fix world generation to have vertices member -- wpt-commits: 7513c92e130e043def925bda97e9fb9d8fd0b48f, 0fce2e94f0feb04966868a0b5795d76ea1db3906, 08c95d8ca3466c37df307cb775502a916e22b814 wpt-pr: 22868 UltraBlame original commit: 309322031e57b9f606c20274ad42711703753086
Bring XRRay up to spec, adjusting the behavior with changes introduced by PR: immersive-web/hit-test#85 Additionally, fix Chrome's Web IDL to not rely on overloads. Change-Id: I98af1a4ed90dbeb8e311795e818efb64bb15034d
Bring XRRay up to spec, adjusting the behavior with changes introduced by PR: immersive-web/hit-test#85 Additionally, fix Chrome's Web IDL to not rely on overloads. Change-Id: I98af1a4ed90dbeb8e311795e818efb64bb15034d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2145937 Reviewed-by: Klaus Weidner <klausw@chromium.org> Reviewed-by: Jeremy Roman <jbroman@chromium.org> Commit-Queue: Piotr Bialecki <bialpio@chromium.org> Commit-Queue: Jeremy Roman <jbroman@chromium.org> Auto-Submit: Piotr Bialecki <bialpio@chromium.org> Cr-Commit-Position: refs/heads/master@{#761766}
Bring XRRay up to spec, adjusting the behavior with changes introduced by PR: immersive-web/hit-test#85 Additionally, fix Chrome's Web IDL to not rely on overloads. Change-Id: I98af1a4ed90dbeb8e311795e818efb64bb15034d
Bring XRRay up to spec, adjusting the behavior with changes introduced by PR: immersive-web/hit-test#85 Additionally, fix Chrome's Web IDL to not rely on overloads. Change-Id: I98af1a4ed90dbeb8e311795e818efb64bb15034d
Bring XRRay up to spec, adjusting the behavior with changes introduced by PR: immersive-web/hit-test#85 Additionally, fix Chrome's Web IDL to not rely on overloads. Change-Id: I98af1a4ed90dbeb8e311795e818efb64bb15034d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2145937 Reviewed-by: Klaus Weidner <klausw@chromium.org> Reviewed-by: Jeremy Roman <jbroman@chromium.org> Commit-Queue: Piotr Bialecki <bialpio@chromium.org> Commit-Queue: Jeremy Roman <jbroman@chromium.org> Auto-Submit: Piotr Bialecki <bialpio@chromium.org> Cr-Commit-Position: refs/heads/master@{#761766}
…pec, a=testonly Automatic update from web-platform-tests WebXR - AR - adjust XRRay to match the spec Bring XRRay up to spec, adjusting the behavior with changes introduced by PR: immersive-web/hit-test#85 Additionally, fix Chrome's Web IDL to not rely on overloads. Change-Id: I98af1a4ed90dbeb8e311795e818efb64bb15034d -- wpt-commits: fd045759df43fa155b34a5e4fe4187610ad1bb24 wpt-pr: 23126
…pec, a=testonly Automatic update from web-platform-tests WebXR - AR - adjust XRRay to match the spec Bring XRRay up to spec, adjusting the behavior with changes introduced by PR: immersive-web/hit-test#85 Additionally, fix Chrome's Web IDL to not rely on overloads. Change-Id: I98af1a4ed90dbeb8e311795e818efb64bb15034d -- wpt-commits: fd045759df43fa155b34a5e4fe4187610ad1bb24 wpt-pr: 23126
…pec, a=testonly Automatic update from web-platform-tests WebXR - AR - adjust XRRay to match the spec Bring XRRay up to spec, adjusting the behavior with changes introduced by PR: immersive-web/hit-test#85 Additionally, fix Chrome's Web IDL to not rely on overloads. Change-Id: I98af1a4ed90dbeb8e311795e818efb64bb15034d -- wpt-commits: fd045759df43fa155b34a5e4fe4187610ad1bb24 wpt-pr: 23126
…pec, a=testonly Automatic update from web-platform-tests WebXR - AR - adjust XRRay to match the spec Bring XRRay up to spec, adjusting the behavior with changes introduced by PR: immersive-web/hit-test#85 Additionally, fix Chrome's Web IDL to not rely on overloads. Change-Id: I98af1a4ed90dbeb8e311795e818efb64bb15034d -- wpt-commits: fd045759df43fa155b34a5e4fe4187610ad1bb24 wpt-pr: 23126
…pec, a=testonly Automatic update from web-platform-tests WebXR - AR - adjust XRRay to match the spec Bring XRRay up to spec, adjusting the behavior with changes introduced by PR: immersive-web/hit-test#85 Additionally, fix Chrome's Web IDL to not rely on overloads. Change-Id: I98af1a4ed90dbeb8e311795e818efb64bb15034d -- wpt-commits: fd045759df43fa155b34a5e4fe4187610ad1bb24 wpt-pr: 23126 UltraBlame original commit: b4c21d6c137e0e39e8b8a9364434136980cf957b
…pec, a=testonly Automatic update from web-platform-tests WebXR - AR - adjust XRRay to match the spec Bring XRRay up to spec, adjusting the behavior with changes introduced by PR: immersive-web/hit-test#85 Additionally, fix Chrome's Web IDL to not rely on overloads. Change-Id: I98af1a4ed90dbeb8e311795e818efb64bb15034d -- wpt-commits: fd045759df43fa155b34a5e4fe4187610ad1bb24 wpt-pr: 23126 UltraBlame original commit: 32e3888c79b097fdd320539a1b9b1895f9cd03ff
…pec, a=testonly Automatic update from web-platform-tests WebXR - AR - adjust XRRay to match the spec Bring XRRay up to spec, adjusting the behavior with changes introduced by PR: immersive-web/hit-test#85 Additionally, fix Chrome's Web IDL to not rely on overloads. Change-Id: I98af1a4ed90dbeb8e311795e818efb64bb15034d -- wpt-commits: fd045759df43fa155b34a5e4fe4187610ad1bb24 wpt-pr: 23126 UltraBlame original commit: b4c21d6c137e0e39e8b8a9364434136980cf957b
…pec, a=testonly Automatic update from web-platform-tests WebXR - AR - adjust XRRay to match the spec Bring XRRay up to spec, adjusting the behavior with changes introduced by PR: immersive-web/hit-test#85 Additionally, fix Chrome's Web IDL to not rely on overloads. Change-Id: I98af1a4ed90dbeb8e311795e818efb64bb15034d -- wpt-commits: fd045759df43fa155b34a5e4fe4187610ad1bb24 wpt-pr: 23126 UltraBlame original commit: 32e3888c79b097fdd320539a1b9b1895f9cd03ff
…pec, a=testonly Automatic update from web-platform-tests WebXR - AR - adjust XRRay to match the spec Bring XRRay up to spec, adjusting the behavior with changes introduced by PR: immersive-web/hit-test#85 Additionally, fix Chrome's Web IDL to not rely on overloads. Change-Id: I98af1a4ed90dbeb8e311795e818efb64bb15034d -- wpt-commits: fd045759df43fa155b34a5e4fe4187610ad1bb24 wpt-pr: 23126 UltraBlame original commit: b4c21d6c137e0e39e8b8a9364434136980cf957b
…pec, a=testonly Automatic update from web-platform-tests WebXR - AR - adjust XRRay to match the spec Bring XRRay up to spec, adjusting the behavior with changes introduced by PR: immersive-web/hit-test#85 Additionally, fix Chrome's Web IDL to not rely on overloads. Change-Id: I98af1a4ed90dbeb8e311795e818efb64bb15034d -- wpt-commits: fd045759df43fa155b34a5e4fe4187610ad1bb24 wpt-pr: 23126 UltraBlame original commit: 32e3888c79b097fdd320539a1b9b1895f9cd03ff
Implements changes from immersive-web/hit-test#85
Automatic update from web-platform-tests Update xrRay_constructor test to not throw See immersive-web/hit-test#83, this test is currently impossible to pass for a browser implementing the current WebIDL specification. -- Update XRRay semantics Implements changes from immersive-web/hit-test#85 -- Fix world generation to have vertices member -- wpt-commits: 7513c92e130e043def925bda97e9fb9d8fd0b48f, 0fce2e94f0feb04966868a0b5795d76ea1db3906, 08c95d8ca3466c37df307cb775502a916e22b814 wpt-pr: 22868
…pec, a=testonly Automatic update from web-platform-tests WebXR - AR - adjust XRRay to match the spec Bring XRRay up to spec, adjusting the behavior with changes introduced by PR: immersive-web/hit-test#85 Additionally, fix Chrome's Web IDL to not rely on overloads. Change-Id: I98af1a4ed90dbeb8e311795e818efb64bb15034d -- wpt-commits: fd045759df43fa155b34a5e4fe4187610ad1bb24 wpt-pr: 23126
…pec, a=testonly Automatic update from web-platform-tests WebXR - AR - adjust XRRay to match the spec Bring XRRay up to spec, adjusting the behavior with changes introduced by PR: immersive-web/hit-test#85 Additionally, fix Chrome's Web IDL to not rely on overloads. Change-Id: I98af1a4ed90dbeb8e311795e818efb64bb15034d -- wpt-commits: fd045759df43fa155b34a5e4fe4187610ad1bb24 wpt-pr: 23126
Fixes #84
This adds a new initializer type so that the defaults work correctly.
This also throws an error for non-1
wcoordinates for theorigin, similar toXRRigidTransform.r? @bialpio
Preview | Diff