mirror of
https://github.com/servo/servo.git
synced 2025-08-10 16:05:43 +01:00
Auto merge of #27235 - asajeffrey:webxr-sessionavailable, r=jdm
Add a sessionavailable event that allows content to enter an XR session without a user gesture <!-- Please describe your changes on the following line: --> This allows servo to implement immersive web apps. https://immersive-web.github.io/webxr/#application-launch --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes do not require tests because I'm not sure we should have a WPT for something this non-standard. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
commit
a77a1f7bf4
8 changed files with 68 additions and 1 deletions
|
@ -14731,6 +14731,13 @@
|
|||
null,
|
||||
{}
|
||||
]
|
||||
],
|
||||
"sessionavailable.html": [
|
||||
"dd9a071d05c4d696471be87428c12cea573cba60",
|
||||
[
|
||||
null,
|
||||
{}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
2
tests/wpt/mozilla/meta/webxr/sessionavailable.html.ini
Normal file
2
tests/wpt/mozilla/meta/webxr/sessionavailable.html.ini
Normal file
|
@ -0,0 +1,2 @@
|
|||
prefs: [dom.webxr.sessionavailable:true]
|
||||
|
20
tests/wpt/mozilla/tests/webxr/sessionavailable.html
Normal file
20
tests/wpt/mozilla/tests/webxr/sessionavailable.html
Normal file
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<body>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<script src="./resources/webxr-util.js"></script>
|
||||
<script>
|
||||
navigator.xr.test.simulateDeviceConnection({
|
||||
supportedModes: ["immersive-vr"],
|
||||
views: TEST_VIEWS,
|
||||
});
|
||||
async_test((t) => {
|
||||
navigator.xr.addEventListener("sessionavailable", (evt) => {
|
||||
navigator.xr.requestSession("immersive-vr")
|
||||
.then((session) => {
|
||||
t.done();
|
||||
})
|
||||
});
|
||||
}, "Requesting immersive session in a sessionavailable handler should succeed");
|
||||
</script>
|
||||
</body>
|
Loading…
Add table
Add a link
Reference in a new issue