mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
script: Move Window-only gamepad functionality out of GlobalScope (#36805)
The only code that calls these methods is in the script thread, and the code is simpler when we can assume a Window global. Pulling this thread led to cleaning up a lot of constructors for Window-only WebXR code, too. Testing: Existing WPT coverage. --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
80d3e138a8
commit
b8971e528f
13 changed files with 199 additions and 236 deletions
|
@ -8,7 +8,7 @@ use webxr_api::HitTestId;
|
|||
use crate::dom::bindings::codegen::Bindings::XRHitTestSourceBinding::XRHitTestSourceMethods;
|
||||
use crate::dom::bindings::reflector::{Reflector, reflect_dom_object};
|
||||
use crate::dom::bindings::root::{Dom, DomRoot};
|
||||
use crate::dom::globalscope::GlobalScope;
|
||||
use crate::dom::window::Window;
|
||||
use crate::dom::xrsession::XRSession;
|
||||
use crate::script_runtime::CanGc;
|
||||
|
||||
|
@ -31,14 +31,14 @@ impl XRHitTestSource {
|
|||
}
|
||||
|
||||
pub(crate) fn new(
|
||||
global: &GlobalScope,
|
||||
window: &Window,
|
||||
id: HitTestId,
|
||||
session: &XRSession,
|
||||
can_gc: CanGc,
|
||||
) -> DomRoot<XRHitTestSource> {
|
||||
reflect_dom_object(
|
||||
Box::new(XRHitTestSource::new_inherited(id, session)),
|
||||
global,
|
||||
window,
|
||||
can_gc,
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue