Bug 303737
| Summary: | [WebXR Hit Test] imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_unlocalizable.https.html is failing | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Fujii Hironori <fujii.hironori> |
| Component: | WebXR | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | djg, kkinnunen, svillar, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Bug Depends on: | |||
| Bug Blocks: | 300754 | ||
Fujii Hironori
[WebXR Hit Test] imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_unlocalizable.https.html is failing
FAIL Ensures hit test result returns null pose w/unlocalizable space - viewer space - webgl assert_true: Pose should be null since input source is not localizable expected true got false
FAIL Ensures hit test result returns null pose w/unlocalizable space - viewer space - webgl2 assert_true: Pose should be null since input source is not localizable expected true got false
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Fujii Hironori
This test was added by https://chromium-review.googlesource.com/c/chromium/src/+/3733395
There was a following change.
~~~
diff --git a/third_party/blink/renderer/modules/xr/xr_hit_test_result.cc b/third_party/blink/renderer/modules/xr/xr_hit_test_result.cc
index ab8173eca7473..a367f6608b729 100644
--- a/third_party/blink/renderer/modules/xr/xr_hit_test_result.cc
+++ b/third_party/blink/renderer/modules/xr/xr_hit_test_result.cc
@@ -25,9 +25,18 @@ XRHitTestResult::XRHitTestResult(
}
auto maybe_other_space_native_from_mojo = other->NativeFromMojo();
- DCHECK(maybe_other_space_native_from_mojo);
+ if (!maybe_other_space_native_from_mojo) {
+ return nullptr;
+ }
auto mojo_from_this = TransformationMatrix(mojo_from_this_.ToTransform());
~~~
There were a review comments.
Alex Cooper: What made this change?
Piotr Bialecki: Previous version looked incorrect - I don't see why other->NativeFromMojo() would guarantee that it's non-nullopt in this case. Let me add a WPT to verify.
Alex Cooper: Hmm, yeah I'm not seeing any spec text that requires space to be localizable. So this is fine.
Piotr Bialecki: WPT added, PTAL.
This is the reason the test case was added.
Radar WebKit Bug Importer
<rdar://problem/166522898>
Fujii Hironori
I built and tested Chromium. If I modified the test case, it fails.
diff --git a/third_party/blink/web_tests/external/wpt/webxr/hit-test/ar_hittest_subscription_unlocalizable.https.html b/third_party/blink/web_tests/external/wpt/webxr/hit-test/ar_hittest_subscription_unlocalizable.https.html
index d1cb1a5a5c444..b113d0fc1331d 100644
--- a/third_party/blink/web_tests/external/wpt/webxr/hit-test/ar_hittest_subscription_unlocalizable.https.html
+++ b/third_party/blink/web_tests/external/wpt/webxr/hit-test/ar_hittest_subscription_unlocalizable.https.html
@@ -43,6 +43,7 @@ let testFunctionGenerator = function(ray, refSpaceName) {
handedness: "right",
targetRayMode: "tracked-pointer",
pointerOrigin: IDENTITY_TRANSFORM,
+ gripOrigin: IDENTITY_TRANSFORM,
profiles: []
});
> This is a testharness.js-based test.
> [FAIL] Ensures hit test result returns null pose w/unlocalizable space - viewer space - webgl
> assert_true: Pose should be null since input source is not localizable expected true got false
> [FAIL] Ensures hit test result returns null pose w/unlocalizable space - viewer space - webgl2
> assert_true: Pose should be null since input source is not localizable expected true got false
> Harness: the test ran to completion.
Thus, if gripOrigin is null, the input source is unlocalizable.
Fujii Hironori
Looking into it more.
XRTargetRaySpace::MojoFromNative() returns nullopt in the test case because input_source_->MojoFromInput() is nullopt.
https://github.com/chromium/chromium/blob/9ffe3999a201b3d58e05873d438c43f5676afaa6/third_party/blink/renderer/modules/xr/xr_target_ray_space.cc#L38-L42
XRInputSource::MojoFromInput() returns nullopt because mojo_from_input_ is null.
https://github.com/chromium/chromium/blob/9ffe3999a201b3d58e05873d438c43f5676afaa6/third_party/blink/renderer/modules/xr/xr_input_source.cc#L262-L263
mojo_from_input_ is null because state->mojo_from_input is null XRInputSource::CreateOrUpdateFrom.
https://github.com/chromium/chromium/blob/9ffe3999a201b3d58e05873d438c43f5676afaa6/third_party/blink/renderer/modules/xr/xr_input_source.cc#L107
mojo_from_input_ is set in setGripOrigin().
https://github.com/chromium/chromium/blob/868cd2197aceec8d0641c47efcfd865f4adb0537/third_party/blink/web_tests/external/wpt/resources/chromium/webxr-test.js#L2011
setGripOrigin() is called if fakeInputSourceInit.gripOrigin != null.
https://github.com/chromium/chromium/blob/868cd2197aceec8d0641c47efcfd865f4adb0537/third_party/blink/web_tests/external/wpt/resources/chromium/webxr-test.js#L1978-L1979
Sergio Villar Senin
Looks like a WPT test added for something specific to chromium? If that's the case I think it's safe to skip, as you mentioned there seem to be nothing related to that in the spec.
Actually I'd open a bug against the spec, just to ask about that issue.
Fujii Hironori
This is about the spec of WebXR Test API.
It's unclear to me the relationship of pointerOrigin and gripOrigin.
https://immersive-web.github.io/webxr-test-api/
There is a comment in Chromium code <https://github.com/chromium/chromium/blob/9ffe3999a201b3d58e05873d438c43f5676afaa6/third_party/blink/renderer/modules/xr/xr_target_ray_space.cc#L39>
> // mojo_from_pointer is just: MojoFromInput*InputFromPointer;
IIUC, this means pointerOrigin is relative to gripOrigin.
That's the reason input_source.targetRaySpace is unlocalizable if gripOrigin is null.