Commit graph

1115 commits

Author SHA1 Message Date
chickenleaf
7ad8822d94
cangc fixes in several files + event.rs + rtcpeerconnection.rs (#34002)
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
2024-10-25 12:44:15 +00:00
tanishka
ea875f0a51
CanGc fixes from EventTarget::fire_event (#33985)
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
2024-10-23 22:48:19 +00:00
chickenleaf
bb4932026c
cangc fixes in node.rs (#33984)
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
2024-10-23 22:44:50 +00:00
tanishka
7fbd2a521e
CanGc fixes from eventtarget.rs (#33973)
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
2024-10-22 22:43:52 +00:00
tanishka
7015e0fb5f
CanGc fixes in errorevent.rs (#33960)
* CanGc fixes in errorevent.rs

Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>

* Allow too_many_arguments to avoid lint error

Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>

---------

Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
2024-10-22 10:08:55 +00:00
Josh Matthews
575e885529
Mark promise creation methods with CanGc (#33928)
* Add CanGc annotations to promise constructor.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Propagate CanGc arguments for Promise::new_in_current_realm.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Fix out-of-order entries.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Propagate CanGc from Promise::new.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Suppress clippy warning.

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-10-22 09:35:20 +00:00
chickenleaf
9acb25521e
CanGc changes from fontfaceset.rs (#33920)
* CanGc changes from fontfaceset.rs

Signed-off-by: L Ashwin B <lashwinib@gmail.com>

* Update components/script/dom/bindings/codegen/Bindings.conf

Co-authored-by: Josh Matthews <josh@joshmatthews.net>
Signed-off-by: chickenleaf <lashwinib@gmail.com>

---------

Signed-off-by: L Ashwin B <lashwinib@gmail.com>
Signed-off-by: chickenleaf <lashwinib@gmail.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2024-10-21 12:28:56 +00:00
tanishka
4d11b2dc84
CanGc fixes from constantsourcenode.rs & window.rs (#33931)
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
2024-10-20 19:54:02 +00:00
tanishka
65c866285f
Multiple CanGc fixes in components/script/dom (#33924)
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
2024-10-20 16:07:15 +00:00
tanishka
a57b6a3f79
CanGc fixes through focusevent.rs & hashchangeevent.rs (#33921)
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
2024-10-20 08:05:11 +00:00
Josh Matthews
b85093ad74
Prevent moving CanGc values between threads/tasks (#33902)
* Make CanGc non-sendable, and add documentation.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Update CanGc usage to fix usages that were moved between threads/tasks.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-10-18 17:26:54 +00:00
chickenleaf
af6154cf63
More files with CanGc fixes (#33892)
* More files with CanGc fixes

Signed-off-by: L Ashwin B <lashwinib@gmail.com>

* removed the can_gc inside !task

Signed-off-by: L Ashwin B <lashwinib@gmail.com>

---------

Signed-off-by: L Ashwin B <lashwinib@gmail.com>
2024-10-18 13:42:43 +00:00
tanishka
6b87ecc291
Some CanGc fixes in components/script/dom (#33895)
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
2024-10-18 11:52:37 +00:00
chickenleaf
9c893c7f4d
More CanGc fixes (#33888)
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
2024-10-17 19:36:42 +00:00
lwz23
595aab10dc
fix clippy warning in components/script (#33878)
Signed-off-by: lwz23 <wenzhaoliao@ruc.edu.cn>
2024-10-17 12:58:28 +00:00
Martin Robinson
036e74524a
net: Start reducing number of IPCs channels used for fetch with a FetchThread (#33863)
Instead of creating a `ROUTER` for each fetch, create a fetch thread
which handles all incoming and outcoming fetch requests. Now messages
involving fetches carry a "request id" which indicates which fetch is
being addressed by the message. This greatly reduces the number of file
descriptors used by fetch.

In addition, the interface for kicking off fetches is simplified when
using the `Listener` with `Document`s and the `GlobalScope`.

This does not fix all leaked file descriptors / mach ports, but greatly
eliminates the number used. Now tests can be run without limiting
procesess on modern macOS systems.

Followup work:

1. There are more instances where fetch is done using the old method.
   Some of these require more changes in order to be converted to the
   `FetchThread` approach.
2. Eliminate usage of IPC channels when doing redirects.
3. Also eliminate the IPC channel used for cancel handling.
4. This change opens up the possiblity of controlling the priority of
   fetch requests.

Fixes #29834.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-10-16 16:53:24 +00:00
chickenleaf
a2f81d69c1
CanGc fixes (#33852)
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
2024-10-16 02:50:28 +00:00
tanishka
46d6c0c883
CanGc fixes in components/script/dom (#33843)
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
2024-10-15 04:45:16 +00:00
chickenleaf
1e39787573
CanGc fixes and checks in multiple files (#33836)
* CanGc fixes and checks in multiple files

Signed-off-by: L Ashwin B <lashwinib@gmail.com>

* CanGc fixes in storageevent.rs

Signed-off-by: L Ashwin B <lashwinib@gmail.com>

---------

Signed-off-by: L Ashwin B <lashwinib@gmail.com>
2024-10-15 04:30:48 +00:00
chickenleaf
fc0835bae3
CanGc fixes in focusevent.rs oscillartornode.rs response.rs resizeobserversize.rs animationevent.rs (#33827)
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
2024-10-13 21:35:59 +00:00
Simon Wülker
bdd5fb2e5b
Use document encoding when parsing url in href setter (#33825)
* Implement encoding-parse-a-url algorithm

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Parse url with encoding when setting href on HtmlAnchorElement

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Update WPT expectations

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2024-10-13 15:12:51 +00:00
tanishka
5c0a0d29d0
clippy: Fix warnings in components/script & components/script/dom (#33821)
* clippy: Fix warnings in components/script & components/script/dom

Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>

* Remove unused variable - can_gc

Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>

* Use _can_gc instead of removing it

Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>

---------

Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
2024-10-13 01:05:46 +00:00
chickenleaf
a55f9a37ec
CanGc fixes starting from blob.rs, mediastream.rs, custom_event.rs (#33820)
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
2024-10-12 17:17:47 +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
webbeef
f9a06d62a2
More CanGc fixes: Range, Event, gpu error, Header (#33774)
* Propagate CanGc parameter in Range

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

* Propagate CanGc parameter in gpu code and dependencies

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

* Propagate CanGc parameter in Header and dependencies

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

* Propagate CanGc parameter in Event and dependencies

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

* Propagate CanGc parameter in rtcdatachannel

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

* Propagate CanGc parameter in servoparser

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

---------

Signed-off-by: webbeef <me@webbeef.org>
2024-10-10 15:51:22 +00:00
Josh Matthews
7d931e673a
script: Include constructors and static methods in generated DOM traits (#33665)
* Add all constructors, special operations, and static methods to generated DOM interface traits.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Move all constructors and static methods defined in bare impl blocks inside FooMethods trait impls.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Add missing doc links.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-10-08 01:51:58 +00:00
Josh Matthews
d7da0563d3
Remove unneeded comments about suppressed errors. (#33612)
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-10-02 04:19:04 +00:00
Samson
05ecb8eddb
webgpu: renovate gpucanvascontext and webgpu presentation to match the spec (#33521)
* Reimpl gpucanvascontext

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* ValidateTextureDescriptorAndCreateSwapChain

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* reconfigure

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* resize

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* work around deadlocks in wgpu core

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* match spec even more by moving all swapchain operations into one updatecontext

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* error handling

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* enable one test

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* label dummy texture

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* update expect

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* clean some expectation (they are not flaky anymore)

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* one more

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* change for configuration change in update_wr_image

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* DEFAULT_IMAGE_FORMAT

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* fixup

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* introduce WebGPUImageDescriptor

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-10-01 10:03:11 +00:00
Simon Wülker
7df30f3788
Replace .map_or(false with Option::is_some_and (#33468)
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2024-09-16 10:03:52 +00:00
Ali
ed6b1b5e6a
clippy: Fix suggestions in script, libservo, and servoshell (#33453)
* fix clone on copy warning in servoshell

Signed-off-by: Ali Zein Yousuf <azy5030@gmail.com>

* Remove unecessary borrow in libservo

Signed-off-by: Ali Zein Yousuf <azy5030@gmail.com>

* Ignore too many arguments warning on create_constellation()

Signed-off-by: Ali Zein Yousuf <azy5030@gmail.com>

* fix explicit auto-deref warning

Signed-off-by: Ali Zein Yousuf <azy5030@gmail.com>

* Autofix multiple clippy warnings in components/script

Signed-off-by: Ali Zein Yousuf <azy5030@gmail.com>

---------

Signed-off-by: Ali Zein Yousuf <azy5030@gmail.com>
2024-09-14 08:41:13 +00:00
Gregory Terzian
23b0dc603c
Raf delivery: run rafs for all pipeline if tick received for any. (#33395)
* update the rendering: run rafs for all pipeline, if tick received for any

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* prioritize only one updating of the rendering per event-loop wake-up

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

---------

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
2024-09-11 16:23:20 +00:00
Martin Robinson
bc8d8b62c3
Stop using time@0.1 in Servo (#33394)
This removes the last few uses of `time@0.1` in Servo. There are still
dependencies from `style` and `webrender`, but they will be removed soon
as well. The uses of this version of `time` are replaced with
`std::time` types and `time@0.3` when negative `Duration` is necessary.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-09-11 07:09:56 +00:00
Ben
8286dd33a5
script: fixed document title being set to Some("") instead of None (#33354)
* Fixed document title being set to "" instead of None

Signed-off-by: Benjamin Vincent Schulenburg <bennyschulenburg@gmx.de>

* Update components/script/dom/document.rs

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Ben <bennyschulenburg@gmx.de>

---------

Signed-off-by: Benjamin Vincent Schulenburg <bennyschulenburg@gmx.de>
Signed-off-by: Ben <bennyschulenburg@gmx.de>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-09-10 07:06:50 +00:00
Andriy Sultanov
e5150dbda1
Propagate CanGc from Document::new() (#33386)
* Add canGc as a parameter to autogenerated trait methods

Signed-off-by: Andriy Sultanov <sultanovandriy@gmail.com>

* Propagate CanGc from Document::new()

Signed-off-by: Andriy Sultanov <sultanovandriy@gmail.com>

---------

Signed-off-by: Andriy Sultanov <sultanovandriy@gmail.com>
2024-09-09 22:38:01 +00:00
Samson
687f356db9
webgpu: Factor out swapchain to separate file (#33367)
* Move some stuff to swapchain.rs

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Use typed WebGPUContextId instead of u64

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Extract create_swapchain function and move more stuff in it

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* extract destroy_swapchain

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* extract swapchain_present

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* extract update_wr_image callback

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* fixup

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-09-09 13:29:04 +00:00
Martin Robinson
312cf0df08
script: Create a CrossProcessInstant to enable serializable monotonic time (#33282)
Up until now, Servo was using a very old version of time to get a
cross-process monotonic timestamp (using `time::precise_time_ns()`).
This change replaces the usage of old time with a new serializable
monotonic time called `CrossProcessInstant` and uses it where `u64`
timestamps were stored before. The standard library doesn't provide this
functionality because it isn't something you can do reliably on all
platforms. The idea is that we do our best and then fall back
gracefully.

This is a big change, because Servo was using `u64` timestamps all over
the place some as raw values taken from `time::precise_time_ns()` and
some as relative offsets from the "navigation start," which is a concept
similar to DOM's `timeOrigin` (but not exactly the same). It's very
difficult to fix this situation without fixing it everywhere as the
`Instant` concept is supposed to be opaque. The good thing is that this
change clears up all ambiguity when passing times as a `time::Duration`
is unit agnostic and a `CrossProcessInstant` represents an absolute
moment in time.

The `time` version of `Duration` is used because it can both be negative
and is also serializable.

Good things:
 - No need too pass around `time` and `time_precise` any longer.
   `CrossProcessInstant` is also precise and monotonic.
 - The distinction between a time that is unset or at `0` (at some kind
   of timer epoch) is now gone.

There still a lot of work to do to clean up timing, but this is the
first step. In general, I've tried to preserve existing behavior, even
when not spec compliant, as much as possible. I plan to submit followup
PRs fixing some of the issues I've noticed.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-09-05 18:50:09 +00:00
Martin Robinson
a4ceb82ef5
script: Stop using time in DOM timers (#33262)
This switches to using `std::time` types for DOM timer operations, which
allows removing our custom time units in favor of `Duration`.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-30 15:20:44 +00:00
Martin Robinson
83a40c5180
script: Stop using legacy time for Document::reflow_timeout (#33258)
Use `std::time` from the Rust standard library instead. This is one step
toward removing our use of the legacy `time` crate which has security
issues.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-30 08:00:34 +00:00
Josh Matthews
60ef6bc461
Start marking functions that can transitively trigger a GC (#33144)
* Mark JS reflector wrappers as CanGc.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Propagate CanGc from reflect_dom_object_with_proto.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Mark DOM constructors as GC operations.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-08-22 11:42:36 +00:00
Josh Matthews
bc5235827f
Various borrow hazard fixes (#33133)
* Reduce the scope of the document tag map borrow.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Reduce scope of borrow when finishing a Response.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Avoid creating a File object while borrowing FormData's data.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Prevent the GC from seeing an uninitialized window proxy slot.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-08-20 16:06:24 +00:00
Josh Matthews
4df7a1af25
Support HTML parser reentrancy (#32820)
* Update parser interface for reentrancy.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Remove assertions around invoking scripts with active parser.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Add regression test.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Run test with normal and async html parser.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-08-16 16:25:50 +00:00
Josh Matthews
3cc91e655f
Remove many explicit reflow calls (#33067)
* Remove explicit reflow for iframe content updates.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Remove explicit reflow for timers.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Remove explicit reflow for MouseEvent.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Remove explicit reflow for key events.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Remove explicit reflow for document load.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Remove explicit reflow for iframe load.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Remove unused reflow reasons.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Fix warnings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-08-15 22:20:52 +00:00
Hayashi Mikihiro
a797969efe
Replace the lazy_static crate whth std::sync::LazyLock in 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>
2024-08-12 07:30:35 +00:00
Chocolate Pie
92866ab911
enhance: Add support for unsafe-eval and wasm-unsafe-eval (#32893)
Signed-off-by: Chocolate Pie <106949016+chocolate-pie@users.noreply.github.com>
2024-08-01 17:26: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
Daniel Adams
2c17de7fa7
Gamepad: Implement GamepadHapticActuator (#32046)
* Implement Servo side of GamepadHapticActuator

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

* Get build working

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

* Create effect handling on embedder side

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

* Update tracing for GamepadHapticEffect

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

* Update gilrs to point to commit with effect complete event

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

* Implement playing and preempting haptic effects

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

* Update IDL to add trigger rumble

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

* Update WPT expectations

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

* Handle stopping haptic effects from reset()

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

* ./mach fmt, fix test-tidy issues

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

* Add extra validity checks for trigger rumble

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

* Retrieve supported haptic effects from embedder

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

* Fix test expectations

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

* Add missing spec link, pin gilrs commit

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

* servoshell cargo formatting

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

* Fix Cargo.toml

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

* Additional comments, realm proof, naming

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

* ./mach fmt

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

* Update gilrs rev to gilrs-core 0.5.12 release

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

* Implement sequence ids for gamepad haptic promises

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

* Take playing effect promise instead of cloning

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

* Implement listener for reset function

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

* Fix Cargo.lock

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

* Restructure IPC listeners, add comments, handle visibility change

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

* Check that haptic effect still exists before handling ff completion event

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

* Visibility steps, add InRealm bindings for promises

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

* Add Gamepad EmbedderMsg arms to egl servo_glue

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

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-07-20 06:29:27 +00:00
Ngo Iok Ui (Wu Yu Wei)
40bac8c3df
script: document.visibilityState and document.hidden (#32635)
* Squashed commit of the following:

commit 5e0ea9996cb0d8137c3e1cd04487a1065b61289d
Author: Wu Yu Wei <yuweiwu@pm.me>
Date:   Thu Jul 11 13:37:51 2024 +0900

    Move lint to new_inherited

    Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>

commit a8cbfb1eef2650d153ef41c232d9e80e1118fc37
Merge: b819968f3e 7a33f8f008
Author: Wu Yu Wei <yuweiwu@pm.me>
Date:   Thu Jul 11 13:32:18 2024 +0900

    Merge branch 'main' into visibility

commit b819968f3eaa361c8a2cf3af679943ae2065ab32
Merge: eda2ec4c22 1c6b74e1f1
Author: Wu Wayne <yuweiwu@pm.me>
Date:   Tue Jul 9 14:26:43 2024 +0900

    Merge branch 'main' into visibility

commit eda2ec4c225c63236d6851ea525455cad8874ce5
Author: Wu Wayne <yuweiwu@pm.me>
Date:   Thu Jul 4 14:25:05 2024 +0900

    Include page-visibility tests to wpt

commit 9da7b4ee39b141e59e4a21a64445c4b08499463f
Author: Wu Yu Wei <yuweiwu@pm.me>
Date:   Thu Jul 4 12:50:40 2024 +0900

    Add TODO comment for future update

commit 11f55fea3ead0c8fa07f16557a63cc6a77c15c3f
Author: Wu Yu Wei <yuweiwu@pm.me>
Date:   Wed Jul 3 11:01:51 2024 +0900

    Add spaces between steps

commit 408c3e51f25867e85f894cd77a6355bc32f2aa00
Author: Wu Wayne <yuweiwu@pm.me>
Date:   Tue Jul 2 18:33:53 2024 +0900

    Update MANIFEST.json

commit 679fe4ffdd28554b11b4018395fac22a08ccbc34
Author: Wu Wayne <yuweiwu@pm.me>
Date:   Tue Jul 2 18:27:02 2024 +0900

    Add VisibilityStateEntry to mozilla/interfaces.html

commit 4a456a2b4a473fa795274edf56ecf660616f90eb
Author: Wu Wayne <yuweiwu@pm.me>
Date:   Tue Jul 2 14:28:11 2024 +0900

    Update meta results

commit cd191447ff61de392526e00c13f765c2df7a269e
Merge: 7ff480a698 ad01342f00
Author: Ngo Iok Ui (Wu Yu Wei) <yuweiwu@pm.me>
Date:   Tue Jul 2 13:47:49 2024 +0900

    Merge branch 'main' into visibility

commit 7ff480a698413ac5526edfb1b8731373bb9d04ae
Author: Wu Yu Wei <yuweiwu@pm.me>
Date:   Tue Jul 2 13:12:44 2024 +0900

    Update description text of update_visibility_state

commit 0e496b7bce4fd5476a1919737b00e8f0c9e2fdc8
Author: Wu Yu Wei <yuweiwu@pm.me>
Date:   Tue Jul 2 12:59:40 2024 +0900

    Add specification link to VisibilityStateEntry methods

commit 3e4a061450621bd17f19ff81099dd4daaeaea478
Author: Wu Yu Wei <yuweiwu@pm.me>
Date:   Tue Jul 2 12:31:53 2024 +0900

    Add descriptive text to each step

commit 8bbdfcae97db5002b09e5f5ecec6ae80d080dc95
Author: Wu Wayne <yuweiwu@pm.me>
Date:   Fri Jun 28 19:15:34 2024 +0900

    mach fmt

commit dc1c7a4aec6aba56af7afcfee6feadbee242a643
Author: Wu Wayne <yuweiwu@pm.me>
Date:   Fri Jun 28 19:01:00 2024 +0900

    Add update_visibility_state

commit 6aa18143319044dc084a9585ab064cd853bccc21
Author: Wu Wayne <yuweiwu@pm.me>
Date:   Fri Jun 28 16:06:25 2024 +0900

    Add VisibilityStateEntry.webidl

commit 638ae3cd563004334d35cc3fbdc1f918d29833d0
Author: Wu Yu Wei <yuweiwu@pm.me>
Date:   Fri Jun 28 13:39:29 2024 +0900

    Add visibilityState and hidden in Document.webidl

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>

* Move creation into reflect call

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>

---------

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
2024-07-12 08:32:25 +00:00
石蕊 (Pi-Cla)
f29dd64a7b
Fix more clippy (#32740) 2024-07-09 04:47:43 +00:00
Martin Robinson
26624a109f
clippy: Fix a bunch of warnings in script (#32680)
This is just a portion of the errors that are remaining to be fixed.
2024-07-04 11:40:23 +00:00
Mukilan Thiyagarajan
a730469b70
script: Implement the FontFaceSet DOM API (#32576)
Add a skeleton implementation of FontFaceSet interface with support
for resolving the `document.fonts.ready` Promise when the loading of
web fonts is completed.

This change exposes new failures in the web platform tests.

These were ERROR before the change because `document.fonts.ready` caused
a `ReferenceError` causing the tests to be aborted and they now FAIL:
- /css/CSS2/linebox/vertical-align-top-bottom-001.html
- /css/css-flexbox/flex-one-sets-flex-basis-to-zero-px.html
- /css/css-fonts/generic-family-keywords-001.html
- /css/css-fonts/math-script-level-and-math-style/math-script-level-004.tentative.html
- /css/css-fonts/math-script-level-and-math-style/math-script-level-002.tentative.html
- /css/css-text/text-autospace/text-autospace-ligature-001.html
- /css/css-values/calc-size/calc-size-width.tentative.html

These were TIMEOUT before the change because `document.fonts.ready` was
a ReferenceError and the tests were asynchronous (reftest-wait). These now
FAIL because the assertions are now executed after fonts are loaded:
- /css/css-fonts/matching/fixed-stretch-style-over-weight.html
- /css/css-fonts/matching/range-descriptor-reversed.html
- /css/css-fonts/matching/stretch-distance-over-weight-distance.html
- /css/css-fonts/matching/style-ranges-over-weight-direction.html
- /css/css-fonts/variations/variable-box-font.html
- /css/css-fonts/variations/variable-gpos-m2b.html
- /css/css-fonts/variations/variable-gsub.html
- /css/css-fonts/variations/variable-opsz-size-adjust.html
- /css/css-position/sticky/position-sticky-change-top.html
- /css/css-position/sticky/position-sticky-fixed-ancestor.html
- /css/css-position/sticky/position-sticky-flexbox.html
- /css/css-position/sticky/position-sticky-grid.html
- /css/css-position/sticky/position-sticky-inline.html
- /css/css-position/sticky/position-sticky-rendering.html
- /css/css-position/sticky/position-sticky-stacking-context.html
- /css/css-position/sticky/position-sticky-table-td-left.html
- /css/css-position/sticky/position-sticky-table-td-right.html
- /css/css-position/sticky/position-sticky-table-tfoot-bottom.html
- /css/css-position/sticky/position-sticky-table-th-right.html
- /css/css-position/sticky/position-sticky-table-thead-top.html
- /css/css-position/sticky/position-sticky-table-tr-bottom.html
- /css/css-position/sticky/position-sticky-table-tr-top.html
- /css/css-position/sticky/position-sticky-writing-modes.html
- /css/css-pseudo/marker-intrinsic-contribution-001.html
- /css/css-text/hyphens/hyphens-character.html

These tests now PASS due to this patch:
* FAIL -> PASS
  - /html/canvas/element/text/2d.text.draw.fill.maxWidth.fontface.html
  - /html/canvas/element/text/2d.text.measure.width.empty.html
* TIMEOUT -> PASS
  - /css/css-fonts/variations/font-descriptor-range-reversed.html
  - /css/css-fonts/variations/variable-opsz.html
  - /css/css-position/sticky/position-sticky-table-th-left.html
* ERROR -> PASS
  - /css/css-fonts/generic-family-keywords-002.html
  - /css/css-fonts/generic-family-keywords-003.html
* These two tests only PASS in Layout 2020:
  - /css/CSS2/positioning/inline-static-position-001.html
  - /css/cssom-view/getBoundingClientRect-empty-inline.html

These two tests have subtests that PASS intermittenttly:
- /fetch/metadata/generated/css-font-face.sub.tentative.html
- /css/css-fonts/generic-family-keywords-001.html

These tests are new TIMEOUTS that used to FAIL because
`documents.fonts.ready` was undefined:
- /resource-timing/TAO-match.html
- /resource-timing/content-type.html
- /resource-timing/nextHopProtocol-is-tao-protected.https.html

The failure in `/resize-observer/change-layout-in-error.html` could be
due to an issue in the ResizeObserver implementation that is now exposed
with this change, but this needs more investigation.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-06-26 09:44:47 +00:00