-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1628931 [wpt PR 22836] - Add interfaces/hit-test.idl and test, a=…
…testonly Automatic update from web-platform-tests Add interfaces/hit-test.idl and test (#22836) Due to the difficulty in testing webxr until test-only APIs are supported in WPT (see web-platform-tests/wpt#16455 (comment)), the added test only tests the XRSession interface additions for now. Closes web-platform-tests/wpt#22155 -- wpt-commits: 8a9e492c5bbfafeeb074902ab39910348a20776a wpt-pr: 22836 UltraBlame original commit: 98cd0a5fb4a5952175d709aee6a2593c33f35ab9
- Loading branch information
Showing
2 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!doctype html> | ||
<title>WebXR hit-test IDL tests</title> | ||
<link rel="help" href="https://immersive-web.github.io/hit-test/"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/resources/WebIDLParser.js"></script> | ||
<script src="/resources/idlharness.js"></script> | ||
|
||
<script> | ||
'use strict'; | ||
|
||
idl_test( | ||
['hit-test'], | ||
['webxr', 'geometry', 'dom'], | ||
async idl_array => { | ||
idl_array.add_objects({ | ||
// TODO: XRHitTestSource | ||
// TODO: XRTransientInputHitTestSource | ||
// TODO: XRHitTestResult | ||
// TODO: XRTransientInputHitTestResult | ||
XRSession: ['xrSession'], | ||
// TODO: XRFrame | ||
XRRay: ['new XRRay()'], | ||
}); | ||
|
||
self.xrSession = await navigator.xr.requestSession("inline"); | ||
} | ||
); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// GENERATED CONTENT - DO NOT EDIT | ||
// Content was automatically extracted by Reffy into reffy-reports | ||
// (https://github.com/tidoust/reffy-reports) | ||
// Source: WebXR Hit Test Module (https://immersive-web.github.io/hit-test/) | ||
|
||
enum XRHitTestTrackableType { | ||
"point", | ||
"plane", | ||
"mesh" | ||
}; | ||
|
||
dictionary XRHitTestOptionsInit { | ||
required XRSpace space; | ||
FrozenArray<XRHitTestTrackableType> entityTypes; | ||
XRRay offsetRay; | ||
}; | ||
|
||
dictionary XRTransientInputHitTestOptionsInit { | ||
required DOMString profile; | ||
FrozenArray<XRHitTestTrackableType> entityTypes; | ||
XRRay offsetRay; | ||
}; | ||
|
||
[SecureContext, Exposed=Window] | ||
interface XRHitTestSource { | ||
void cancel(); | ||
}; | ||
|
||
[SecureContext, Exposed=Window] | ||
interface XRTransientInputHitTestSource { | ||
void cancel(); | ||
}; | ||
|
||
[SecureContext, Exposed=Window] | ||
interface XRHitTestResult { | ||
XRPose? getPose(XRSpace baseSpace); | ||
}; | ||
|
||
[SecureContext, Exposed=Window] | ||
interface XRTransientInputHitTestResult { | ||
[SameObject] readonly attribute XRInputSource inputSource; | ||
readonly attribute FrozenArray<XRHitTestResult> results; | ||
}; | ||
|
||
partial interface XRSession { | ||
Promise<XRHitTestSource> requestHitTestSource(XRHitTestOptionsInit options); | ||
Promise<XRTransientInputHitTestSource> requestHitTestSourceForTransientInput(XRTransientInputHitTestOptionsInit options); | ||
}; | ||
|
||
partial interface XRFrame { | ||
FrozenArray<XRHitTestResult> getHitTestResults(XRHitTestSource hitTestSource); | ||
FrozenArray<XRTransientInputHitTestResult> getHitTestResultsForTransientInput(XRTransientInputHitTestSource hitTestSource); | ||
}; | ||
|
||
[SecureContext, Exposed=Window, | ||
Constructor(optional DOMPointInit origin, optional DOMPointInit direction), | ||
Constructor(XRRigidTransform transform)] | ||
interface XRRay { | ||
[SameObject] readonly attribute DOMPointReadOnly origin; | ||
[SameObject] readonly attribute DOMPointReadOnly direction; | ||
[SameObject] readonly attribute Float32Array matrix; | ||
}; |