mirror of
https://github.com/servo/servo.git
synced 2025-09-04 12:08:21 +01:00
script: Move gamepad DOM interfaces to script/dom/gamepad/
(#38900)
Moves interfaces defined by the gamepad spec to the `script/dom/gamepad/` module from `script/dom/`. Testing: Just a refactor shouldn't need any testing Fixes: N/A Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
This commit is contained in:
parent
21a7782206
commit
461ff26812
10 changed files with 26 additions and 18 deletions
|
@ -44,15 +44,15 @@ use crate::dom::bindings::root::MutNullableDom;
|
|||
use crate::dom::clipboardevent::ClipboardEventType;
|
||||
use crate::dom::document::{FireMouseEventType, FocusInitiator, TouchEventResult};
|
||||
use crate::dom::event::{EventBubbles, EventCancelable, EventDefault};
|
||||
use crate::dom::gamepad::contains_user_gesture;
|
||||
use crate::dom::gamepadevent::GamepadEventType;
|
||||
use crate::dom::gamepad::gamepad::{Gamepad, contains_user_gesture};
|
||||
use crate::dom::gamepad::gamepadevent::GamepadEventType;
|
||||
use crate::dom::inputevent::HitTestResult;
|
||||
use crate::dom::node::{self, Node, ShadowIncluding};
|
||||
use crate::dom::pointerevent::PointerId;
|
||||
use crate::dom::types::{
|
||||
ClipboardEvent, CompositionEvent, DataTransfer, Element, Event, EventTarget, Gamepad,
|
||||
GlobalScope, HTMLAnchorElement, KeyboardEvent, MouseEvent, PointerEvent, Touch, TouchEvent,
|
||||
TouchList, WheelEvent, Window,
|
||||
ClipboardEvent, CompositionEvent, DataTransfer, Element, Event, EventTarget, GlobalScope,
|
||||
HTMLAnchorElement, KeyboardEvent, MouseEvent, PointerEvent, Touch, TouchEvent, TouchList,
|
||||
WheelEvent, Window,
|
||||
};
|
||||
use crate::drag_data_store::{DragDataStore, Kind, Mode};
|
||||
use crate::realms::enter_realm;
|
||||
|
|
|
@ -8,7 +8,10 @@ use dom_struct::dom_struct;
|
|||
use embedder_traits::{GamepadSupportedHapticEffects, GamepadUpdateType};
|
||||
use js::typedarray::{Float64, Float64Array};
|
||||
|
||||
use super::bindings::buffer_source::HeapBufferSource;
|
||||
use super::gamepadbuttonlist::GamepadButtonList;
|
||||
use super::gamepadhapticactuator::GamepadHapticActuator;
|
||||
use super::gamepadpose::GamepadPose;
|
||||
use crate::dom::bindings::buffer_source::HeapBufferSource;
|
||||
use crate::dom::bindings::codegen::Bindings::GamepadBinding::{GamepadHand, GamepadMethods};
|
||||
use crate::dom::bindings::codegen::Bindings::GamepadButtonListBinding::GamepadButtonListMethods;
|
||||
use crate::dom::bindings::inheritance::Castable;
|
||||
|
@ -18,10 +21,7 @@ use crate::dom::bindings::root::{Dom, DomRoot};
|
|||
use crate::dom::bindings::str::DOMString;
|
||||
use crate::dom::event::Event;
|
||||
use crate::dom::eventtarget::EventTarget;
|
||||
use crate::dom::gamepadbuttonlist::GamepadButtonList;
|
||||
use crate::dom::gamepadevent::{GamepadEvent, GamepadEventType};
|
||||
use crate::dom::gamepadhapticactuator::GamepadHapticActuator;
|
||||
use crate::dom::gamepadpose::GamepadPose;
|
||||
use crate::dom::globalscope::GlobalScope;
|
||||
use crate::dom::window::Window;
|
||||
use crate::script_runtime::{CanGc, JSContext};
|
|
@ -7,7 +7,7 @@ use dom_struct::dom_struct;
|
|||
use crate::dom::bindings::codegen::Bindings::GamepadButtonListBinding::GamepadButtonListMethods;
|
||||
use crate::dom::bindings::reflector::{Reflector, reflect_dom_object};
|
||||
use crate::dom::bindings::root::{Dom, DomRoot, DomSlice};
|
||||
use crate::dom::gamepadbutton::GamepadButton;
|
||||
use crate::dom::gamepad::gamepadbutton::GamepadButton;
|
||||
use crate::dom::window::Window;
|
||||
use crate::script_runtime::CanGc;
|
||||
|
|
@ -6,6 +6,7 @@ use dom_struct::dom_struct;
|
|||
use js::rust::HandleObject;
|
||||
use stylo_atoms::Atom;
|
||||
|
||||
use super::gamepad::Gamepad;
|
||||
use crate::dom::bindings::codegen::Bindings::EventBinding::Event_Binding::EventMethods;
|
||||
use crate::dom::bindings::codegen::Bindings::GamepadEventBinding;
|
||||
use crate::dom::bindings::codegen::Bindings::GamepadEventBinding::GamepadEventMethods;
|
||||
|
@ -15,7 +16,6 @@ use crate::dom::bindings::reflector::reflect_dom_object_with_proto;
|
|||
use crate::dom::bindings::root::{Dom, DomRoot};
|
||||
use crate::dom::bindings::str::DOMString;
|
||||
use crate::dom::event::Event;
|
||||
use crate::dom::gamepad::Gamepad;
|
||||
use crate::dom::window::Window;
|
||||
use crate::script_runtime::CanGc;
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
use dom_struct::dom_struct;
|
||||
use js::typedarray::{Float32, Float32Array};
|
||||
|
||||
use super::bindings::buffer_source::HeapBufferSource;
|
||||
use crate::dom::bindings::buffer_source::HeapBufferSource;
|
||||
use crate::dom::bindings::codegen::Bindings::GamepadPoseBinding::GamepadPoseMethods;
|
||||
use crate::dom::bindings::reflector::{Reflector, reflect_dom_object};
|
||||
use crate::dom::bindings::root::DomRoot;
|
12
components/script/dom/gamepad/mod.rs
Normal file
12
components/script/dom/gamepad/mod.rs
Normal file
|
@ -0,0 +1,12 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#[expect(clippy::module_inception, reason = "The interface name is Gamepad")]
|
||||
pub(crate) mod gamepad;
|
||||
pub(crate) use gamepad::Gamepad;
|
||||
pub(crate) mod gamepadbutton;
|
||||
pub(crate) mod gamepadbuttonlist;
|
||||
pub(crate) mod gamepadevent;
|
||||
pub(crate) mod gamepadhapticactuator;
|
||||
pub(crate) mod gamepadpose;
|
|
@ -325,11 +325,7 @@ pub(crate) mod fontfaceset;
|
|||
pub(crate) mod formdata;
|
||||
pub(crate) mod formdataevent;
|
||||
pub(crate) mod gamepad;
|
||||
pub(crate) mod gamepadbutton;
|
||||
pub(crate) mod gamepadbuttonlist;
|
||||
pub(crate) mod gamepadevent;
|
||||
pub(crate) mod gamepadhapticactuator;
|
||||
pub(crate) mod gamepadpose;
|
||||
pub(crate) use self::gamepad::*;
|
||||
#[allow(dead_code)]
|
||||
pub(crate) mod globalscope;
|
||||
pub(crate) mod hashchangeevent;
|
||||
|
|
|
@ -36,7 +36,7 @@ use crate::dom::bluetooth::Bluetooth;
|
|||
use crate::dom::clipboard::Clipboard;
|
||||
use crate::dom::csp::{GlobalCspReporting, Violation};
|
||||
use crate::dom::gamepad::Gamepad;
|
||||
use crate::dom::gamepadevent::GamepadEventType;
|
||||
use crate::dom::gamepad::gamepadevent::GamepadEventType;
|
||||
use crate::dom::globalscope::GlobalScope;
|
||||
use crate::dom::mediadevices::MediaDevices;
|
||||
use crate::dom::mediasession::MediaSession;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue