aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/gamepad.rs
diff options
context:
space:
mode:
authorYerkebulan Tulibergenov <yerkebulan@gmail.com>2025-02-21 21:42:55 -0800
committerGitHub <noreply@github.com>2025-02-22 05:42:55 +0000
commit245a39c07eb14f1acb03c4d85aaa4901af863a71 (patch)
tree648c6d8de054b198aed81e680685afbce40ca457 /components/script/dom/gamepad.rs
parent35f21e426b2fec968ebd0970b743d43ac6fd012f (diff)
downloadservo-245a39c07eb14f1acb03c4d85aaa4901af863a71.tar.gz
servo-245a39c07eb14f1acb03c4d85aaa4901af863a71.zip
refactor: add CanGc as argument to create_buffer_source (#35597)
Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
Diffstat (limited to 'components/script/dom/gamepad.rs')
-rw-r--r--components/script/dom/gamepad.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/components/script/dom/gamepad.rs b/components/script/dom/gamepad.rs
index b7587804b19..a2d2298875a 100644
--- a/components/script/dom/gamepad.rs
+++ b/components/script/dom/gamepad.rs
@@ -153,7 +153,7 @@ impl Gamepad {
None,
can_gc,
);
- gamepad.init_axes();
+ gamepad.init_axes(can_gc);
gamepad
}
}
@@ -254,7 +254,7 @@ impl Gamepad {
/// Initialize the number of axes in the "standard" gamepad mapping.
/// <https://www.w3.org/TR/gamepad/#dfn-initializing-axes>
- fn init_axes(&self) {
+ fn init_axes(&self, can_gc: CanGc) {
let initial_axes: Vec<f64> = vec![
0., // Horizontal axis for left stick (negative left/positive right)
0., // Vertical axis for left stick (negative up/positive down)
@@ -262,7 +262,7 @@ impl Gamepad {
0., // Vertical axis for right stick (negative up/positive down)
];
self.axes
- .set_data(GlobalScope::get_cx(), &initial_axes)
+ .set_data(GlobalScope::get_cx(), &initial_axes, can_gc)
.expect("Failed to set axes data on gamepad.")
}