Commit graph

33 commits

Author SHA1 Message Date
Josh Matthews
3faed9b921
Filter out webidl files based on special comments, and feature-gate webxr 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>
2024-11-24 18:01:35 +00:00
Josh Matthews
e956f3124c
Generate a trait abstracting over all known DOM interfaces (#34357)
* 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>
2024-11-24 07:35:14 +00:00
Josh Matthews
25a0764a37
Use out parameter for generated methods returning JSVal (#34087)
* 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>
2024-11-05 08:29:08 +00:00
webbeef
2b71130a8a
Various CanGc fixes (#33800)
* CanGc fix for pagetransitionevent

Signed-off-by: webbeef <me@webbeef.org>

* CanGc fix for dom/node

Signed-off-by: webbeef <me@webbeef.org>

* CanGc fix for gamepad

Signed-off-by: webbeef <me@webbeef.org>

* CanGc fix for gpu

Signed-off-by: webbeef <me@webbeef.org>

* CanGc fix for dom/element

Signed-off-by: webbeef <me@webbeef.org>

* CanGc fix for xhr

Signed-off-by: webbeef <me@webbeef.org>

* CanGc fix for dom/worker

Signed-off-by: webbeef <me@webbeef.org>

* CanGc fix for rtcdatachannel

Signed-off-by: webbeef <me@webbeef.org>

* CanGc fix for rtcerror

Signed-off-by: webbeef <me@webbeef.org>

* Address review comments

Signed-off-by: webbeef <me@webbeef.org>

---------

Signed-off-by: webbeef <me@webbeef.org>
2024-10-11 03:53:39 +00:00
Daniel Adams
08a4d751d7
webxr: Update XRInputSource Gamepad handling, FakeXRInputController (#33403)
* Disconnect XRInputSource gamepads on removal

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update Cargo.lock

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Comments, adjustments

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-09-12 01:52:16 +00:00
Daniel Adams
938fd8c12f
webxr: Update XRInputSource gamepad index to be -1 (#33369)
* Update XRInputSource gamepad index to be -1

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update test expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-09-09 11:07:56 +00:00
Daniel Adams
7501e3e12f
webxr: Update XRInputSource interface to latest spec (#33155)
* Update XRInputSource interface to latest spec

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Bump webxr version

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Add missing spec link

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-08-21 21:26:29 +00:00
Jose Monagas
a34920b605
fix(clippy): Clippy suggestions in components/script/dom/* (#33072)
Signed-off-by: Jose T. Monagas <josetmonagas@proton.me>
Co-authored-by: Jose T. Monagas <josetmonagas@proton.me>
2024-08-15 19:31:30 +00:00
danik292
5d6840873a
clippy: Fix missing indentation in comments and remove on unecessary cast (#33026)
* Add missing indendations in comments.

Signed-off-by: Daniel Frantes <danfrantes@seznam.cz>

* Fix test tidy error

Signed-off-by: Daniel Frantes <danfrantes@seznam.cz>

---------

Signed-off-by: Daniel Frantes <danfrantes@seznam.cz>
2024-08-13 11:28:09 +00:00
Daniel Adams
fd83281657
Implement WebXR Gamepads Module (#32860)
* Expose gamepad attribute on XRInputSource

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Tidy, add spec links

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update WPT test expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update gamepad state on InputChanged event

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Pin webxr commit

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Apply gamepad updates during frame updates

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Drain input frame map

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Don't store gamepad as option

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-08-03 12:51:44 +00:00
Oluwatobi Sofela
7349ce5b6a
clippy: Fix manual_map warnings (#31922) 2024-03-28 15:58:36 +00:00
Aarya Khandelwal
f7669b5238
fixes dereferencing on an immutable reference (#31864) 2024-03-26 08:37:44 +00:00
Oluwatobi Sofela
02a0cdd6fa
clippy: Fix dereferenced warnings (#31770) 2024-03-20 08:07:22 +00:00
Richard Dushime
01ca220f83
clippy: Fix many warnings in components/script (#31717)
* Fix Several clippy warnings

* Fix Build errors

* Fix Unused import

* Fix requested changes

* Fix rustfmt

* Minor fixes

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-03-19 16:05:56 +00:00
Martin Robinson
5c1723c983
rustdoc: Fix many rustdoc errors (#31147)
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.
2024-01-22 13:13:48 +00:00
Samson
aad2dccc9c
Strict import formatting (grouping and granularity) (#30325)
* strict imports formatting

* Reformat all imports
2023-09-11 19:16:54 +00:00
Samson
9514f670d1
No tracing of nop traceable fields (#29926)
* Add `no_trace` option to JSTraceable derive

* NoTrace wrapper

* Port some types to no_trace schematics

* Fixing my unsafe mistakes (not tracing traceables)

* Add docs & safety guards for no_trace

Safety guards (trait shenanigans) guarantees safety usage of `no_trace`

* Port canvas_traits to no_trace

* Port servo_media to no_trace

* Port net_traits to no_trace

* Port style to no_trace

* Port webgpu to no_trace

* Port script_traits to no_trace

* Port canvas_traits, devtools_traits, embedder_traits, profile_traits to no_trace

* unrooted_must_root lint in seperate file

* Add trace_in_no_trace_lint as script_plugin

* Composable types in must_not_have_traceable

* Introduced HashMapTracedValues wrapper

* `HashMap<NoTrace<K>,V>`->`HashMapTracedValues<K,V>`

* Port rest of servo's types to no_trace

* Port html5ever, euclid, mime and http to no_trace

* Port remaining externals to no_trace

* Port webxr and Arc<Mutex<_>>

* Fix spelling in notrace doc
2023-08-04 10:17:43 +00:00
Josh Matthews
f79e1e327d Make GlobalScope.get_cx a static method. 2023-05-20 11:05:09 -04:00
Manish Goregaokar
ad6da0591c Add XRHand[index] 2020-04-27 17:35:48 -07:00
Manish Goregaokar
c89dc821ba Add XRHand interface 2020-04-27 17:35:48 -07:00
YUAN LYU
3ea6d87bcc
Add trait DomObjectWrap to provide WRAP function 2020-03-20 22:16:56 -04:00
Kunal Mohan
5a3e1b8e69
rename compartment to realm 2020-01-24 20:52:36 +05:30
Manish Goregaokar
e0135fe783 Support profiles 2020-01-21 15:47:30 -08:00
Manish Goregaokar
7046f543a1 Expose targetRayMode 2020-01-09 08:16:25 +05:30
Manish Goregaokar
11e882385d Correctly initialize grip space 2020-01-09 08:16:25 +05:30
Manish Goregaokar
c521d8ec01 Support grip spaces in WebXR 2019-10-09 14:00:03 -07:00
Manish Goregaokar
b654b6007a Hook input code into new webxr crate 2019-07-11 11:12:59 -07:00
Manish Goregaokar
8780edb165 Hook webxr data into XRFrame/XRView/XRSpace 2019-07-11 11:12:59 -07:00
Manish Goregaokar
d4a6a4987d Add XRInputSource.targetRaySpace 2019-05-03 18:46:31 -07:00
Manish Goregaokar
e5716624d4 Add XRInputSource.handedness 2019-05-03 14:37:41 -07:00
Manish Goregaokar
b693af6a54 Sync input source data every frame if necessary 2019-05-03 14:37:41 -07:00
Manish Goregaokar
3a08e917e0 Write method for initializing input sources 2019-05-03 14:37:41 -07:00
Manish Goregaokar
0f952c7ff8 Add blank XRInputSource 2019-05-03 14:37:41 -07:00