Commit graph

122 commits

Author SHA1 Message Date
Daniel Adams
c028b5c299
webxr: Implement XRBoundedReferenceSpace (#33176)
* Implement XRBoundedReferenceSpace

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

* Update expectations

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

* Update interfaces

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

* Add missing pref condition on IDL interface

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

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-08-25 23:53:39 +00:00
Daniel Adams
20273b062a
webxr: Update XRSession to latest spec (#33059)
* Add missing XRSession members, initial implementations

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

* Implement supportedFramerates getter

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

* Implement framerate changes, add spec links

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

* Update WPT expectations

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

* ./mach fmt

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-17 03:36:52 +00:00
Daniel Adams
0d137d276a
webxr: Add missing IDL members from AR Module (#33007)
* Add missing IDL members from AR module

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

* Update test expectations

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

* ./mach fmt

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

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-08-13 04:28:40 +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
Martin Robinson
f7448b5d61
Remove the WebXR dependency on ancient time@0.1 crate (#32862)
`webxr` depends on a very old verison of `time`, which allowed serializing
monotonic clock output. This isn't possible on all platforms, so newer
versions of `time` do not allow this. In order to stop using the old
0.1 versions of `time` we have to stop relying on times passed from `webxr`
to Servo. This change does that, at the cost of removing the XR
profiling feature. It has to be rewritten in another way in the `webxr`
crate.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-07-26 13:53:34 +00:00
石蕊 (Pi-Cla)
f29dd64a7b
Fix more clippy (#32740) 2024-07-09 04:47:43 +00:00
Kitsu
67f239d1ba
clippy: fix several lint warns (#32126)
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.
2024-04-22 06:45:39 +00:00
Oluwatobi Sofela
da3991c8f3
clippy: Fix search_is_some warnings (#31971) 2024-04-02 04:01:52 +00:00
Ekta Siwach
1bc63801e7
fix redundant closures in component/script/dom (#31917)
* fixed unnecessary conversions

* resolved conflicts

* resolved conflicts

* fix redundant closures in component/script/dom

* resolved conflicts

* fixed formatting
2024-03-28 09:06:02 +00:00
Oluwatobi Sofela
da518823ff
clippy: Fix op_ref warnings (#31900) 2024-03-27 16:45:58 +00:00
Oluwatobi Sofela
3c05b58221
clippy: Fix explicit_auto_deref warnings in components/script (#31837)
* clippy: Fix explicit auto-deref warnings

* clippy: Fix explicit auto-deref warnings

* refactor: Tidy up code

* refactor: Fix method not found errors
2024-03-23 11:29:20 +00:00
Oluwatobi Sofela
02a0cdd6fa
clippy: Fix dereferenced warnings (#31770) 2024-03-20 08:07:22 +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
ebd41d4101
Use Foo_Binding instead of FooBinding for namespace modules (#30447)
* Update Codegen.py to emit Foo_Binding instead of FooBinding

* s/FooBinding/Foo_Binding/g
2023-09-30 00:52:04 +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
fca5833e21 Remove global argument from Promise::new_in_current_realm. 2023-05-20 11:05:09 -04:00
Alan Jeffrey
754019f6bc Add test for layers feature (currently always false) 2020-08-04 11:55:06 -05:00
Alan Jeffrey
31de34704d Implement the changes to updating the render state from the WebXR Layers spec 2020-08-03 13:19:22 -05:00
Alan Jeffrey
bf7f4eae31 Update WebXR Layer IDL, and matching changes to the Rust code. 2020-08-03 12:37:01 -05:00
Josh Matthews
c34e587140 Update XRWebGLLayer to match specification. 2020-07-20 15:52:16 -04:00
Alan Jeffrey
349619ed2d Support for webxr layer management 2020-06-28 16:37:45 -05:00
bors-servo
c183f95297
Auto merge of #26551 - Manishearth:per-view, r=asajeffrey
Update to handle per-view eye transforms

Depends on https://github.com/servo/webxr/pull/175
2020-05-18 11:21:33 -04:00
Manish Goregaokar
d627476893 Update to treat view transforms as native-relative 2020-05-18 08:20:54 -07:00
Manish Goregaokar
794624b42b Move viewports to being per-session, not per-frame 2020-05-18 08:20:19 -07:00
huangjiahua
c253ad8399 Handle cancelAnimationFrame() when called within a requestAnimationFrame() callback 2020-05-13 15:41:09 +08:00
Manish Goregaokar
30cd89d2d8 Add feature gating for hit tests 2020-04-19 20:29:14 -07:00
Manish Goregaokar
1b07b77323 Add XRSession::requestHitTestSource() 2020-04-19 20:29:14 -07:00
Manish Goregaokar
e7ba4e5a47 Add XRRay(transform) constructor 2020-04-19 20:29:14 -07:00
bors-servo
33a74a4f4e
Auto merge of #26164 - Manishearth:dirty-endsession, r=jdm
Dirty canvas when exiting immersive sessions

Fixes https://github.com/servo/servo/issues/26162, fixes servo/webxr#155

We basically end up in a situation where the main thread is asleep. It's unclear to me why it doesn't wake up after attempts to interact with the screen, but we stopped dirtying the canvas during the immersive session (https://github.com/servo/servo/pull/26077) so the main thread wasn't awake initially.

This is probably not the cleanest fix -- we really should not be ending up in situations where the main thread is perma-asleep -- however, we should be dirtying the canvas after exiting immersive mode _anyway_ since the contents need to be shown to the user, so this fix is still valid, even if it's not fixing the root cause.
2020-04-13 20:02:48 -04:00
Manish Goregaokar
453be48c94 Dirty layers when changing visibility state 2020-04-13 15:12:41 -07:00
Alan Jeffrey
fda8da0e9d Added first-cut implementation of XR layers 2020-04-13 13:57:58 -05:00
YUAN LYU
3ea6d87bcc
Add trait DomObjectWrap to provide WRAP function 2020-03-20 22:16:56 -04:00
Josh Matthews
51145cfd83 Update to 3/4 nightly rustc. 2020-03-10 10:09:07 -04:00
Josh Matthews
aa060dfd59 Remove unused imports. 2020-03-09 21:11:27 -04:00
Josh Matthews
085e17b73c Remove XR canvas dirtying step. 2020-03-09 21:11:27 -04:00
Josh Matthews
fbcf2bbc3e Integrate swapchain surface provider changes into webgl and webxr implementations. 2020-03-09 17:50:54 -04:00
Josh Matthews
a29f4a9afe Revert "Auto merge of #25898 - jdm:rustup, r=asajeffrey"
This reverts commit ea8aed1ba9, reversing
changes made to 3749eb5397.
2020-03-06 00:06:15 -05:00
Josh Matthews
bf7537ef5b Update to 3/4 nightly rustc. 2020-03-04 15:08:18 -05:00
bors-servo
92f5b36f49
Auto merge of #25738 - jsjoeio:jsjoeio/issue-25732-rename-xr, r=Manishearth,jdm
refactor: rename XR to XRSystem

<!-- Please describe your changes on the following line: -->
This PR renames XR to XRSystem.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [X] These changes fix #25732

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because it's the changing of a name (XR -> XRSystem)

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
2020-02-24 02:27:13 -05:00
JavaScript Joe
30f474312f refactor: rename XR to XRSystem
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
2020-02-23 14:34:42 -08:00
Manish Goregaokar
f3e1aba4e3 Add profiling for WebXR 2020-02-22 22:00:05 -08:00
bors-servo
ea7e753cea
Auto merge of #25773 - Manishearth:input-sources-change, r=jdm
Always trigger an input sources change event on session creation

Fixes our behavior to match the spec, and to specifically do it in a way
that makes sense. This is also what Chromium does currently, though I'm
not sure if it does the scheduling the same way.

The spec for this may change, see https://github.com/immersive-web/webxr/issues/961.

This fix, along with https://github.com/servo/servo/pull/25770 , makes
three.js content work on servo. Instead of this fix we can also wait for
https://github.com/mrdoob/three.js/issues/18638 to land (which isn't
certain until we figure out more about
https://github.com/immersive-web/webxr/issues/961 )

Even if https://github.com/immersive-web/webxr/issues/961 decides to
choose the option that obviates this patch, we should probably keep it
for now since there's already content out in the wild relying on this
behavior.

r? @jdm @asajeffrey
2020-02-16 03:10:56 -05:00
Manish Goregaokar
09a23b0cb1 Always trigger an input sources change event on session creation 2020-02-15 07:53:55 -08:00
Patrick Shaughnessy
8e65782efb Expose DOMHighResTimeStamps at lower res 2020-02-03 09:54:39 -05:00
Kunal Mohan
5a3e1b8e69
rename compartment to realm 2020-01-24 20:52:36 +05:30
Manish Goregaokar
9a04a37c1c Gate reference space creation on requested features 2020-01-21 20:19:22 -08:00
Manish Goregaokar
9c34a6585b Handle SetTargetRayMode and SetHandedness 2020-01-21 15:47:30 -08:00
Manish Goregaokar
f721113f8d Handle AddInput/RemoveInput events 2020-01-09 08:16:25 +05:30
Manish Goregaokar
666ee5ceff Kick the raf loop in inline sessions 2020-01-02 13:56:16 +05:30