mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
webxr: Update XRInputSource gamepad index to be -1 (#33369)
* Update XRInputSource gamepad index to be -1 Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update test expectations Signed-off-by: Daniel Adams <msub2official@gmail.com> --------- Signed-off-by: Daniel Adams <msub2official@gmail.com>
This commit is contained in:
parent
9cfbaf92e5
commit
938fd8c12f
5 changed files with 14 additions and 6 deletions
|
@ -96,6 +96,7 @@ impl Gamepad {
|
||||||
axis_bounds: (f64, f64),
|
axis_bounds: (f64, f64),
|
||||||
button_bounds: (f64, f64),
|
button_bounds: (f64, f64),
|
||||||
supported_haptic_effects: GamepadSupportedHapticEffects,
|
supported_haptic_effects: GamepadSupportedHapticEffects,
|
||||||
|
xr: bool,
|
||||||
) -> DomRoot<Gamepad> {
|
) -> DomRoot<Gamepad> {
|
||||||
Self::new_with_proto(
|
Self::new_with_proto(
|
||||||
global,
|
global,
|
||||||
|
@ -105,6 +106,7 @@ impl Gamepad {
|
||||||
axis_bounds,
|
axis_bounds,
|
||||||
button_bounds,
|
button_bounds,
|
||||||
supported_haptic_effects,
|
supported_haptic_effects,
|
||||||
|
xr,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,15 +123,17 @@ impl Gamepad {
|
||||||
axis_bounds: (f64, f64),
|
axis_bounds: (f64, f64),
|
||||||
button_bounds: (f64, f64),
|
button_bounds: (f64, f64),
|
||||||
supported_haptic_effects: GamepadSupportedHapticEffects,
|
supported_haptic_effects: GamepadSupportedHapticEffects,
|
||||||
|
xr: bool,
|
||||||
) -> DomRoot<Gamepad> {
|
) -> DomRoot<Gamepad> {
|
||||||
let button_list = GamepadButtonList::init_buttons(global);
|
let button_list = GamepadButtonList::init_buttons(global);
|
||||||
let vibration_actuator =
|
let vibration_actuator =
|
||||||
GamepadHapticActuator::new(global, gamepad_id, supported_haptic_effects);
|
GamepadHapticActuator::new(global, gamepad_id, supported_haptic_effects);
|
||||||
|
let index = if xr { -1 } else { 0 };
|
||||||
let gamepad = reflect_dom_object_with_proto(
|
let gamepad = reflect_dom_object_with_proto(
|
||||||
Box::new(Gamepad::new_inherited(
|
Box::new(Gamepad::new_inherited(
|
||||||
gamepad_id,
|
gamepad_id,
|
||||||
id,
|
id,
|
||||||
0,
|
index,
|
||||||
true,
|
true,
|
||||||
0.,
|
0.,
|
||||||
mapping_type,
|
mapping_type,
|
||||||
|
|
|
@ -3236,7 +3236,8 @@ impl GlobalScope {
|
||||||
"standard".into(),
|
"standard".into(),
|
||||||
axis_bounds,
|
axis_bounds,
|
||||||
button_bounds,
|
button_bounds,
|
||||||
supported_haptic_effects
|
supported_haptic_effects,
|
||||||
|
false
|
||||||
);
|
);
|
||||||
navigator.set_gamepad(selected_index as usize, &gamepad);
|
navigator.set_gamepad(selected_index as usize, &gamepad);
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,6 +55,7 @@ impl XRInputSource {
|
||||||
supports_dual_rumble: false,
|
supports_dual_rumble: false,
|
||||||
supports_trigger_rumble: false,
|
supports_trigger_rumble: false,
|
||||||
},
|
},
|
||||||
|
true,
|
||||||
);
|
);
|
||||||
XRInputSource {
|
XRInputSource {
|
||||||
reflector: Reflector::new(),
|
reflector: Reflector::new(),
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
[xrInputSource_gamepad_disconnect.https.html]
|
[xrInputSource_gamepad_disconnect.https.html]
|
||||||
|
expected: ERROR
|
||||||
[WebXR InputSource's gamepad gets disconnected when the input source is removed - webgl2]
|
[WebXR InputSource's gamepad gets disconnected when the input source is removed - webgl2]
|
||||||
expected: FAIL
|
expected: NOTRUN
|
||||||
|
|
||||||
[WebXR InputSource's gamepad gets disconnected when the input source is removed - webgl]
|
[WebXR InputSource's gamepad gets disconnected when the input source is removed - webgl]
|
||||||
expected: FAIL
|
expected: TIMEOUT
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
[xrInputSource_gamepad_disconnect.https.html]
|
[xrInputSource_gamepad_disconnect.https.html]
|
||||||
|
expected: ERROR
|
||||||
[WebXR InputSource's gamepad gets disconnected when the input source is removed - webgl2]
|
[WebXR InputSource's gamepad gets disconnected when the input source is removed - webgl2]
|
||||||
expected: FAIL
|
expected: NOTRUN
|
||||||
|
|
||||||
[WebXR InputSource's gamepad gets disconnected when the input source is removed - webgl]
|
[WebXR InputSource's gamepad gets disconnected when the input source is removed - webgl]
|
||||||
expected: FAIL
|
expected: TIMEOUT
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue