aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/navigator.rs
Commit message (Collapse)AuthorAgeFilesLines
* Move various reflector types and traits to script_bindings (#35279)Josh Matthews2025-02-041-1/+1
| | | | | | | | | | | | | * script: Move Reflector to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Extract global() helper from DomObject into new trait. Move DomObject and related traits to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Limit public exports. (#34915)Josh Matthews2025-01-101-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * script: Restrict reexport visibility of DOM types. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Mass pub->pub(crate) conversion. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Hide existing dead code warnings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix clippy warnings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix unit tests. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix clippy. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * More formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Add CanGc argument to reflect_dom_object (#34606)Domenico Rizzo2024-12-131-1/+1
| | | | | | | | | | | | | | | | | | | | | * applied mach fmt Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com> Refinements Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com> Modified reflect_dom_object signature and all its calls Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com> * fix function calls when parameter is passed up Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com> --------- Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
* Add `webgpu` feature flag (#34444)atbrakhi2024-12-051-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Move script gpu files into webgpu folder Signed-off-by: atbrakhi <atbrakhi@igalia.com> * Modify gpu webidls Signed-off-by: atbrakhi <atbrakhi@igalia.com> * move gpu realted webidl Signed-off-by: atbrakhi <atbrakhi@igalia.com> * add webgpu feature to script Signed-off-by: atbrakhi <atbrakhi@igalia.com> * add dummy implementation for gpucanvascontext Signed-off-by: atbrakhi <atbrakhi@igalia.com> * fmt Signed-off-by: atbrakhi <atbrakhi@igalia.com> * add skip-if CARGO_FEATURE_WEBGPU Signed-off-by: atbrakhi <atbrakhi@igalia.com> * Move NavigatorGPU and workerNavigator GPU to webgpu idl Signed-off-by: atbrakhi <atbrakhi@igalia.com> * fmt and cleanup Signed-off-by: atbrakhi <atbrakhi@igalia.com> * review fix Signed-off-by: atbrakhi <atbrakhi@igalia.com> * enable webgpu by default and also some fmt fix Signed-off-by: atbrakhi <atbrakhi@igalia.com> * Add pref back, fix imports, small cleanups Signed-off-by: atbrakhi <atbrakhi@igalia.com> --------- Signed-off-by: atbrakhi <atbrakhi@igalia.com>
* Move script gpu files into webgpu folder (#34415)atbrakhi2024-11-281-1/+1
| | | Signed-off-by: atbrakhi <atbrakhi@igalia.com>
* Filter out webidl files based on special comments, and feature-gate webxr ↵Josh Matthews2024-11-241-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | interfaces. (#34348) * Filter out webidl files based on skip-if directives. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Don't build XR functionality without webxr feature. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix tidy. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Adjust imports for file movement. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix clippy. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Clean up webxr module import. Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com> Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net> Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>
* Generate a trait abstracting over all known DOM interfaces (#34357)Josh Matthews2024-11-241-1/+1
| | | | | | | | | | | | | | | | | * script: Generate trait for all DOM interfaces and parameterize generated Methods traits over it. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Update trait implementations with new generic type. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Use out parameter for generated methods returning JSVal (#34087)Josh Matthews2024-11-051-3/+3
| | | | | | | | | | | | | | | | | | | | | * Make generated bindings that return a WebIDL `any` value use out parameters. Returning raw JSVal values makes it easier to create GC hazards in code that calls these methods. Accepting a MutableHandle argument instead ensures that the values are rooted by the caller. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Update mozjs. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix clippy warnings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* CanGc fixes in several files (#33958)chickenleaf2024-10-211-3/+3
| | | | | | | | | | | | | * few cangc fixes Signed-off-by: L Ashwin B <lashwinib@gmail.com> * few cangc fixes Signed-off-by: L Ashwin B <lashwinib@gmail.com> --------- Signed-off-by: L Ashwin B <lashwinib@gmail.com>
* Replace the lazy_static crate whth `std::sync::LazyLock` in ↵Hayashi Mikihiro2024-08-121-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | components/script (#33004) * replace in str.rs Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * replace navigator.rs Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * replace htmlmetaelement.rs Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * replace document.rs Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * replace cssstyledeclaration.rs Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * replace script_runtime.rs Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * replace window_named_properties.rs Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * reduce dependency lazy_static Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * reduce lazy in script_runtime.rs `Mutex::new()` is const contexts. I think that `JS_ENGINE` is need not lazy initialize. Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> --------- Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
* clippy: fix several lint warns (#32126)Kitsu2024-04-221-2/+2
| | | | | | | | | | | | | | | As seems #31500 still remain opened here's the next partial fix. Fixed list: `unused_mut`, `clippy::needless_borrow`, `clippy::match_ref_pats`, `clippy::borrow_deref_ref`, `clippy::ptr_eq`, `clippy::unnecessary_cast`, `clippy::derivable_impls`, `clippy::collapsible_match`, `clippy::extra_unused_lifetimes`, `clippy::map_clone`, `clippy::manual_filter`. - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes are part of #31500. - [x] These changes do not require tests because are only cosmetic.
* Gamepad: Remove GamepadList and fix dropped connection event on startup (#31684)Daniel Adams2024-04-081-8/+48
| | | | | | | | | | | | | | | * Replace GamepadList * Fix initial gamepad connection event from gilrs getting dropped * Fix gamepad reconnection issues, use MutNullableDom * Reduce some repetition in handle_gamepad_events * Address feedback, move some steps to navigator methods * Refactor internal navigator gamepad methods * Add note re: unused gilrs index, adjust navigator gamepad methods
* clippy: Fix a variety of warnings in components/script/dom (#31894)Ekta Siwach2024-03-291-4/+2
|
* clippy: Fix dereferenced warnings (#31770)Oluwatobi Sofela2024-03-201-2/+1
|
* Gamepad: Align closer to spec and implement missing slots (#31385)Daniel Adams2024-03-121-7/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implement missing gamepad slots, align to spec more - Fixes TODO's from initial gamepad implementation - Adds some missing spec steps * Only handle gamepad events when pref is enabled * Return empty list in getGamepads if document not active * ./mach fmt * Update getGamepads to return an array instead of GamepadList * Add spec link for [[exposed]] slot * Remove failing test expectations for not-fully-active * A few fixes - Change should_notify to has_gesture - Add spec links and TODO to navigator - Remove unneeded clone from GamepadList::list - Move gamepadconnected event firing into has_gesture block * Use queue_with_canceller for tasks and add expects * Explicitly check for gamepad user gesture * Move user gesture check into separate function * Change contains_user_gesture to be a gamepad function * mach fmt * Change axis/button threshold constants to be private to module
* script: implement navigator.hardwareConcurrency (#31268)Smitty2024-02-071-0/+15
| | | Signed-off-by: syvb <me@iter.ca>
* rustdoc: Fix many rustdoc errors (#31147)Martin Robinson2024-01-221-3/+3
| | | | This fixes many rustdoc errors that occur due to raw URLs in rustdoc comments as well as unescaped Rust code that should be in backticks.
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-111-2/+3
| | | | | * strict imports formatting * Reformat all imports
* dom: Implement Navigator.languages.Josh Matthews2020-07-141-0/+9
|
* Remove WebVRAlan Jeffrey2020-04-081-18/+1
|
* webgl: Don't dirty canvas element while in immersive mode.Josh Matthews2020-03-311-0/+4
|
* Add trait DomObjectWrap to provide WRAP functionYUAN LYU2020-03-201-6/+1
|
* Avoid accessing DOM global from XR's destructor.Josh Matthews2020-02-241-1/+2
|
* refactor: rename XR to XRSystemJavaScript Joe2020-02-231-4/+4
| | | | | | | | | | | | | | chore: fix formatting refactor: change filename and ref to xrsystem refactor: change filename XRSystem.webidl refactor: update crate in navigator refactor: use XRSystem instead of XR in navigator refactor: update Bindings.conf refactor: use XRSystemMethods fix: update assertions for XRSystem fix: update manifest json
* rename compartment to realmKunal Mohan2020-01-241-3/+3
|
* Support worker for WebGPUIstvan Miklos2020-01-231-36/+0
| | | | | To create resource ids for the WebGPU we need to access the `IdentityHub`. In order to access the `IdentityHub` from a `Window` or a `Worker` as well, I've moved the `IdentityHub` to the `GlobalScope` from the `Navigator`.
* Initial implementation of GPUPipelineLayout for WebGPUIstvan Miklos2020-01-211-1/+7
| | | | | Added WebIDL bindings for `GPUPipelineLayout`. Implemented the createPipelineLayout function of `GPUDevice`.
* Initial implementation of GPUBindGroupLayout for WebGPUIstvan Miklos2020-01-161-1/+7
| | | | | | Added WebIDL bindings for `GPUBindGroupLayout`, `GPUBindGroupLayoutDescriptor`, `GPUBindingType`, `GPUShaderStage` and `GPUBindGroupLayoutBinding` (Note: The servo's codegen doesn't like the name, because its already occupied). Implemented the `createBindGroupLayout` function of `GPUDevice`.
* Initial implementation of GPUBuffer for WebGPUIstvan Miklos2019-12-171-1/+5
| | | | | Added WebIDL bindings for GPUBuffer, GPUBufferDescriptor, GPUBufferUsage Implemented the `createBuffer` and `createBufferMapped` functions of GPUDevice
* Replace wgpu-native with wgpu-coreZakor Gyula2019-12-061-5/+9
|
* Initial implementation of GPUDevice for WebGPUIstvan Miklos2019-12-051-1/+5
| | | | | Added the WebIDL bindigs for GPUDevice, GPUObjectDescriptorBase, GPUDeviceDescriptor, GPUObjectBase Implemented the `requestDevice` function of `GPUAdapter`
* Add WebGPU identity managementIstvan Miklos2019-11-281-0/+12
| | | | Issue: https://github.com/servo/servo/issues/24706#issuecomment-557891841
* Initial implementation of WebGPU APIZakor Gyula2019-11-211-0/+8
|
* Fix media session action handlingFernando Jiménez Moreno2019-11-201-10/+2
|
* Move active media session logic to constellationFernando Jiménez Moreno2019-11-201-2/+2
|
* Register media instance with session and prepare communication with embedderFernando Jiménez Moreno2019-11-201-2/+20
|
* MediaSession API DOM bindingsFernando Jiménez Moreno2019-11-201-0/+9
|
* Script: removed a few opts::get()oneturkmen2019-06-261-1/+1
|
* Added missing NavigatorId attributesAlan Jeffrey2019-06-111-0/+15
|
* Use the newly added inCompartments option everywhere it can beBastien Orivel2019-05-251-7/+3
|
* Pass InCompartment by valueAron Zwaan2019-04-251-1/+1
|
* Add proof parameter to Promise::new_in_current_compartmentAron Zwaan2019-04-241-2/+6
|
* Rename Promise::new to Promise::new_in_current_compartmentAron Zwaan2019-04-031-1/+2
|
* Add MediaDevices::GetUserMediaManish Goregaokar2019-01-291-1/+2
|
* Add Navigator::MediaDevicesManish Goregaokar2019-01-291-0/+8
|
* Remove now-unnecessary must_root and allow(unrooted_must_root) annotationsManish Goregaokar2019-01-041-1/+0
|
* Add spec linksManish Goregaokar2018-12-221-0/+1
|
* Fill in XR frame/pose/view implementationsManish Goregaokar2018-12-211-1/+1
|
* Fill in XR.requestSessionManish Goregaokar2018-12-191-1/+8
|
* Move VR interface to XRManish Goregaokar2018-12-191-10/+7
| | | | The WebVR spec no longer has a navigator.vr, but there is a navigator.XR in the XR spec. Instead of duplicating work I've combined the two.