diff options
author | Auguste Baum <52001167+augustebaum@users.noreply.github.com> | 2025-02-20 17:17:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-20 16:17:45 +0000 |
commit | 863d2ce8710fc5141b2c8fd0743697c0956412cb (patch) | |
tree | 05d3f853fa53b38a359427ac3d9ff19b7bc75db6 /components/script/dom/gamepadbuttonlist.rs | |
parent | 5465bfc2af38e561df5f0a7f81250a0238520d6d (diff) | |
download | servo-863d2ce8710fc5141b2c8fd0743697c0956412cb.tar.gz servo-863d2ce8710fc5141b2c8fd0743697c0956412cb.zip |
Propagate `CanGc` arguments through callers in constructors (#35541)
Signed-off-by: Auguste Baum <auguste.apple@gmail.com>
Diffstat (limited to 'components/script/dom/gamepadbuttonlist.rs')
-rw-r--r-- | components/script/dom/gamepadbuttonlist.rs | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/components/script/dom/gamepadbuttonlist.rs b/components/script/dom/gamepadbuttonlist.rs index 1689711d1ee..acca0bd03cb 100644 --- a/components/script/dom/gamepadbuttonlist.rs +++ b/components/script/dom/gamepadbuttonlist.rs @@ -27,11 +27,15 @@ impl GamepadButtonList { } } - pub(crate) fn new(global: &GlobalScope, list: &[&GamepadButton]) -> DomRoot<GamepadButtonList> { + pub(crate) fn new( + global: &GlobalScope, + list: &[&GamepadButton], + can_gc: CanGc, + ) -> DomRoot<GamepadButtonList> { reflect_dom_object( Box::new(GamepadButtonList::new_inherited(list)), global, - CanGc::note(), + can_gc, ) } } @@ -60,25 +64,25 @@ impl GamepadButtonList { /// <https://www.w3.org/TR/gamepad/#dfn-initializing-buttons> pub(crate) fn init_buttons(global: &GlobalScope) -> DomRoot<GamepadButtonList> { let standard_buttons = &[ - GamepadButton::new(global, false, false), // Bottom button in right cluster - GamepadButton::new(global, false, false), // Right button in right cluster - GamepadButton::new(global, false, false), // Left button in right cluster - GamepadButton::new(global, false, false), // Top button in right cluster - GamepadButton::new(global, false, false), // Top left front button - GamepadButton::new(global, false, false), // Top right front button - GamepadButton::new(global, false, false), // Bottom left front button - GamepadButton::new(global, false, false), // Bottom right front button - GamepadButton::new(global, false, false), // Left button in center cluster - GamepadButton::new(global, false, false), // Right button in center cluster - GamepadButton::new(global, false, false), // Left stick pressed button - GamepadButton::new(global, false, false), // Right stick pressed button - GamepadButton::new(global, false, false), // Top button in left cluster - GamepadButton::new(global, false, false), // Bottom button in left cluster - GamepadButton::new(global, false, false), // Left button in left cluster - GamepadButton::new(global, false, false), // Right button in left cluster - GamepadButton::new(global, false, false), // Center button in center cluster + GamepadButton::new(global, false, false, CanGc::note()), // Bottom button in right cluster + GamepadButton::new(global, false, false, CanGc::note()), // Right button in right cluster + GamepadButton::new(global, false, false, CanGc::note()), // Left button in right cluster + GamepadButton::new(global, false, false, CanGc::note()), // Top button in right cluster + GamepadButton::new(global, false, false, CanGc::note()), // Top left front button + GamepadButton::new(global, false, false, CanGc::note()), // Top right front button + GamepadButton::new(global, false, false, CanGc::note()), // Bottom left front button + GamepadButton::new(global, false, false, CanGc::note()), // Bottom right front button + GamepadButton::new(global, false, false, CanGc::note()), // Left button in center cluster + GamepadButton::new(global, false, false, CanGc::note()), // Right button in center cluster + GamepadButton::new(global, false, false, CanGc::note()), // Left stick pressed button + GamepadButton::new(global, false, false, CanGc::note()), // Right stick pressed button + GamepadButton::new(global, false, false, CanGc::note()), // Top button in left cluster + GamepadButton::new(global, false, false, CanGc::note()), // Bottom button in left cluster + GamepadButton::new(global, false, false, CanGc::note()), // Left button in left cluster + GamepadButton::new(global, false, false, CanGc::note()), // Right button in left cluster + GamepadButton::new(global, false, false, CanGc::note()), // Center button in center cluster ]; rooted_vec!(let buttons <- standard_buttons.iter().map(DomRoot::as_traced)); - Self::new(global, buttons.r()) + Self::new(global, buttons.r(), CanGc::note()) } } |