mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
webxr: Add some missing internal checks/validation (#33318)
* Ensure depthFar is non-negative Signed-off-by: Daniel Adams <msub2official@gmail.com> * Properly append default features in requestSession Signed-off-by: Daniel Adams <msub2official@gmail.com> * Ensure XRRigidTransform init members have finite values Signed-off-by: Daniel Adams <msub2official@gmail.com> --------- Signed-off-by: Daniel Adams <msub2official@gmail.com>
This commit is contained in:
parent
aadc212b95
commit
75c7712905
9 changed files with 35 additions and 40 deletions
|
@ -187,8 +187,6 @@ impl XRSystemMethods for XRSystem {
|
|||
let mut optional_features = vec![];
|
||||
let cx = GlobalScope::get_cx();
|
||||
|
||||
// We are supposed to include "viewer" and on immersive devices "local"
|
||||
// by default here, but this is handled directly in requestReferenceSpace()
|
||||
if let Some(ref r) = init.requiredFeatures {
|
||||
for feature in r {
|
||||
unsafe {
|
||||
|
@ -222,6 +220,14 @@ impl XRSystemMethods for XRSystem {
|
|||
}
|
||||
}
|
||||
|
||||
if !required_features.contains(&"viewer".to_string()) {
|
||||
required_features.push("viewer".to_string());
|
||||
}
|
||||
|
||||
if !required_features.contains(&"local".to_string()) && mode != XRSessionMode::Inline {
|
||||
required_features.push("local".to_string());
|
||||
}
|
||||
|
||||
let init = SessionInit {
|
||||
required_features,
|
||||
optional_features,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue