<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>303737</bug_id>
          
          <creation_ts>2025-12-08 01:23:08 -0800</creation_ts>
          <short_desc>[WebXR Hit Test] imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_unlocalizable.https.html is failing</short_desc>
          <delta_ts>2025-12-17 02:44:06 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebXR</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>300754</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Fujii Hironori">fujii</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>djg</cc>
    
    <cc>kkinnunen</cc>
    
    <cc>svillar</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2164062</commentid>
    <comment_count>0</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2025-12-08 01:23:08 -0800</bug_when>
    <thetext>[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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2164685</commentid>
    <comment_count>1</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2025-12-09 19:06:46 -0800</bug_when>
    <thetext>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-&gt;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&apos;t see why other-&gt;NativeFromMojo() would guarantee that it&apos;s non-nullopt in this case. Let me add a WPT to verify.
Alex Cooper: Hmm, yeah I&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2165844</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2025-12-15 01:24:11 -0800</bug_when>
    <thetext>&lt;rdar://problem/166522898&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2166530</commentid>
    <comment_count>3</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2025-12-16 22:42:26 -0800</bug_when>
    <thetext>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: &quot;right&quot;,
       targetRayMode: &quot;tracked-pointer&quot;,
       pointerOrigin: IDENTITY_TRANSFORM,
+      gripOrigin: IDENTITY_TRANSFORM,
       profiles: []
     });
 

&gt; This is a testharness.js-based test.
&gt; [FAIL] Ensures hit test result returns null pose w/unlocalizable space - viewer space - webgl
&gt;   assert_true: Pose should be null since input source is not localizable expected true got false
&gt; [FAIL] Ensures hit test result returns null pose w/unlocalizable space - viewer space - webgl2
&gt;   assert_true: Pose should be null since input source is not localizable expected true got false
&gt; Harness: the test ran to completion.

Thus, if gripOrigin is null, the input source is unlocalizable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2166544</commentid>
    <comment_count>4</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2025-12-16 23:39:14 -0800</bug_when>
    <thetext>Looking into it more.

XRTargetRaySpace::MojoFromNative() returns nullopt in the test case because input_source_-&gt;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-&gt;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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2166561</commentid>
    <comment_count>5</comment_count>
    <who name="Sergio Villar Senin">svillar</who>
    <bug_when>2025-12-17 01:15:52 -0800</bug_when>
    <thetext>Looks like a WPT test added for something specific to chromium? If that&apos;s the case I think it&apos;s safe to skip, as you mentioned there seem to be nothing related to that in the spec.

Actually I&apos;d open a bug against the spec, just to ask about that issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2166571</commentid>
    <comment_count>6</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2025-12-17 02:44:06 -0800</bug_when>
    <thetext>This is about the spec of WebXR Test API.

It&apos;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 &lt;https://github.com/chromium/chromium/blob/9ffe3999a201b3d58e05873d438c43f5676afaa6/third_party/blink/renderer/modules/xr/xr_target_ray_space.cc#L39&gt;

&gt; // mojo_from_pointer is just: MojoFromInput*InputFromPointer;

IIUC, this means pointerOrigin is relative to gripOrigin.
That&apos;s the reason input_source.targetRaySpace is unlocalizable if gripOrigin is null.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>