Commit graph

1155 commits

Author SHA1 Message Date
Josh Matthews
c94ac5bccb
Move various reflector types and traits to script_bindings (#35279)
* 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>
2025-02-04 06:58:08 +00:00
Martin Robinson
fdfaf7b15c
libservo: Combine LoadStart, HeadParsed, and LoadComplete` messages (#35260)
These will be a single method in the upcoming `WebView` delegate, so it
makes sense to also combine the internal message to match this. In
addition, since `LoadStatus` is now exposed to the API if there is ever
the need to add more statuses or to move to an event-based version, the
API is already set up for this.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-02-03 22:31:17 +00:00
webbeef
c4f4d5cc04
Only consider fully active documents when running the 'update the rendering' steps (#35245)
This is specified in https://html.spec.whatwg.org/multipage/#update-the-rendering step 3.2 but we where not filtering out inactive documents.

Signed-off-by: webbeef <me@webbeef.org>
2025-02-01 18:10:20 +00:00
Delan Azabani
5e9de2cb61
Include WebViewId into EmbedderMsg variants where possible (#35211)
`EmbedderMsg` was previously paired with an implicit
`Option<WebViewId>`, even though almost all variants were either always
`Some` or always `None`, depending on whether there was a `WebView
involved.

This patch adds the `WebViewId` to as many `EmbedderMsg` variants as
possible, so we can call their associated `WebView` delegate methods
without needing to check and unwrap the `Option`. In many cases, this
required more changes to plumb through the `WebViewId`.

Notably, all `Request`s now explicitly need a `WebView` or not, in order
to ensure that it is passed when appropriate.

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2025-01-30 11:15:35 +00:00
Martin Robinson
a1cf0cbf86
libservo: Stop using script_traits in the embedding layer (#35185)
Many types used directly in the `libservo` API are in the
`script_traits` crate, which was created to break circular dependencies.
Move all API exposed types to `embedder_traits` which now contains types
exposed via the `libservo` embedding API. Also expose these at the root
of the `libservo` `servo` crate so that the API won't break when they
move around in the future.

The idea with `embedder_traits` in the future is that it contains types
that are available throughout servo because they are used in the
embedding API and thus should have minimal dependencies on other Servo
crates (a bit like `base`).

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-01-28 11:15:36 +00:00
Domenico Rizzo
fe5a075766
[35131] Borrow hazard in Document::broadcast_active_resize_observations (#35168)
* removed panic status: added cloned and collect

Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>

* applied fmt

Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>

---------

Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
2025-01-25 00:42:13 +00:00
Josh Matthews
ac22157491
script: Handle shadow roots when determining common ancestors of dirty roots. (#35132)
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-01-24 01:14:16 +00:00
Gae24
6195026db0
dom: set composed flag when constructing ClipboardEvent (#35146)
* clipboardevent: set composed flag

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* add clipboardevent test expectations

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
2025-01-23 18:07:59 +00:00
Josh Matthews
875e387004
script: Feature-gate all crown support. (#35055)
* script: Feature-gate all crown support.

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

* script: Use cfg(crown) instead of a cargo feature.

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

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-01-18 21:36:15 +00:00
mcclure
d5993a0cea
servo-media 1e28d1d997: don't unwrap ServoMedia::get() (#35049)
Signed-off-by: mcc <andi.m.mcclure@gmail.com>
2025-01-18 06:30:46 +00:00
Gae24
d470f219b1
Implement Clipboard Event Api (#33576)
* implement ClipboardEvent interface

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* draft implementation of clipboard events

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* handle received clipboard events inside html elemtents

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* use rustdoc style

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* fix compilation errors due to rebase

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* update arboard crate

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* improve paste events

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* code cleanup

revert arboard crate's update, handle text only

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* restrict visibility of some methods to script crate

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* propagate CanGc argument

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* simplify handle_clipboard_msg

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* remove code duplication

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* fix potential borrow hazard

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* add clipboard_event pref, restore unit test code

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* retrict visibility of some document's methods

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* check if clipboardevent is trusted

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* enable clipboardevent

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* fix compilation for egl ports

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
2025-01-15 19:45:29 +00:00
Martin Robinson
0e616e0c5d
api: Flatten and simplify Servo preferences (#34966)
Flatten and simplify Servo's preferences code. In addition, have both
preferences and options passed in as arguments to `Servo::new()` and
make sure not to use the globally set preferences in `servoshell` (as
much as possible now).

Instead of a complex procedural macro to generate preferences, just
expose a very simple derive macro that adds string based getters and
setters.

- All command-line parsing is moved to servoshell.
- There is no longer the concept of a missing preference.
- Preferences no longer have to be part of the resources bundle because
  they now have reasonable default values.
- servoshell specific preferences are no longer part of the preferences
  exposed by the Servo API.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-01-14 13:54:06 +00:00
Martin Robinson
748954d610
net: Use RequestId to cancel fetches instead of creating an IPC channel (#34883)
Instead of creating an IPC channel for every fetch, allow cancelling
fetches based on the `RequestId` of the original request. This requires
that `RequestId`s be UUIDs so that they are unique between processes
that might communicating with the resource process.

In addition, the resource process loop now keeps a `HashMap` or `Weak`
handles to cancellers and cleans them up.

This allows for creating mutiple `FetchCanceller`s in `script` for a
single fetch request, allowing integration of the media and video
elements to integrate with the `Document` canceller list -- meaning
these fetches also get cancelled when the `Document` unloads.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-01-11 11:49:22 +00:00
Josh Matthews
c94d909a86
script: Limit public exports. (#34915)
* 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>
2025-01-10 08:19:19 +00:00
Martin Robinson
77bc7f415d
script: Use enums for event loop senders and receivers (#34896)
Previously, senders and receivers to different kinds of event loops (the
main `ScriptThread`, different types of workers) used a rust `trait`
mechanism to implement dynamic behavior. This led to having many unused
implementations of this `trait`. This change moves to using an `enum`
based approach for these senders and receivers and removes all of the
dead code.

In addition, to allowing for use of rust's dead code detection, it
simplifies the code a great deal. All of these generic senders and
receivers are moved to the `messaging.rs` file and given proper
documentation.

Finally, empty an `JSTraceable` implementation is made for all
crossbeam `Sender<...>`s to avoid having to manually skip them everytime
they are included in structs. The pre-existing empty `MallocSizeOf`
implementation is used more thoroughly.

Other unecessary wrappers around these senders and receivers are removed
as well.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-01-08 21:33:29 +00:00
Martin Robinson
e42b4b793d
script: Expose NodeTraits::owner_global / Window::as_global_scope (#34843)
Expose two new helpers and start using them as much as possible.

- `NodeTraits::owner_global`: which gets the `GlobalScope` that currenty
 owns a `Node`. This may be different than `.global()` in the case that
 the `Node` was adopted by a different `Document`.
- `Window::as_global_scope`: A helper to avoid having to cast so much
  when treating a `Window` like a `GlobalScope`.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-01-07 09:56:02 +00:00
Martin Robinson
fe8a22b72c
script: Unsilence all main thread TaskQueue errors (#34849)
No longer hide errors while queueing tasks on the main thread. This
requires creating two types of `TaskSource`s: one for the main thread
and one that can be sent to other threads. This makes queueing a bit
more efficient on the main thread and more importantly, no longer hides
task queue errors.

Fixes #25688.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2025-01-07 03:36:39 +00:00
Martin Robinson
b2eda71952
script: Move TaskManager to GlobalScope (#34827)
This is a simplification of the internal `TaskQueue` API that moves the
`TaskManager` to the `GlobalScope` itself. In addition, the handling of
cancellers is moved to the `TaskManager` as well. This means that no
arguments other than the `task` are necessary for queueing tasks, which
makes the API a lot easier to use and cleaner.

`TaskSource` now also keeps a copy of the canceller with it, so that
they always know the proper way to cancel any tasks queued on them.

There is one complication here. The event loop `sender` for dedicated
workers is constantly changing as it is set to `None` when not handling
messages. This is because this sender keeps a handle to the main
thread's `Worker` object, preventing garbage collection while any
messages are still in flight or being handled. This change allows
setting the `sender` on the `TaskManager` to `None` to allow proper
garbabge collection.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-01-04 08:41:50 +00:00
Martin Robinson
e8f75c9aea
script: Expose node helpers as NodeTraits and give more descriptive names (#34832)
This puts a few commonly used `Node` helpers into a trait (`NodeTraits`)
and gives them more descriptive names and documentation. The renames:

- `document_from_node` -> `NodeTraits::owner_document`
- `window_from_node` -> `NodeTraits::owner_window`
- `stylesheets_owner_from_node<T:` -> `NodeTraits::stylesheet_list_owner`
- `containing_shadow_root` -> `NodeTraits::containing_shadow_root`

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-01-03 18:55:01 +00:00
Martin Robinson
77cfca65c4
script: Eliminate code duplication in the task queue (#34798)
Instead of creating a type for each `TaskSource` variety have each `TaskSource`
hold the same kind of sender (this was inconsistent before, but each
sender was effectively the same trait object), a pipeline, and a
`TaskSourceName`. This elminates the need to reimplement the same
queuing code for every task source.

In addition, have workers hold their own `TaskManager`. This allows just
exposing the manager on the `GlobalScope`. Currently the `TaskCanceller`
is different, but this will also be eliminated in a followup change.

This is a the first step toward having a shared set of `Sender`s on
`GlobalScope`.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-01-01 13:50:52 +00:00
shanehandley
08a3e61bb4
Use spec-aligned process for resolving history handling during navigation (#34747)
Makes use of the is_initial_about_blank property on Document in order to
determine whether the navigation should create a history entry, or replace
the current history entry.

Signed-off-by: Shane Handley <shanehandley@fastmail.com>
2024-12-27 02:45:53 +00:00
Martin Robinson
5f927a2c28
script: Refactor channels in ScriptThread into receivers and senders (#34776)
Create two new data structures in the `script` crate to hold senders and
receiver:

- `ScriptThreadSenders`: holds all outgoing channels from the
  `ScriptThread` including a channel to the `ScriptThread` itself. The
  ultimate goal with this is to reduce duplication by giving a boxed
  version of this this to `Window`s.
- `ScriptThradReceivers`: holds all incoming channels to the
  `ScriptThread`. This isn't cloenable like the senders. This is used to
  abstract away `recv()` and `try_recv()` methods used to make the
  `ScriptThread` event loop easier to read.

In addition:

- The many duplicated `ScriptThread` self-senders for the `TaskManager`
  have been removed and, in general, a lot of boilerplate is removed as
  well.
- Visibilty of all methods affected by this change is changed to
  `pub(crate)` in order to take advantage of dead code detection. Some
  dead code produced from macros is removed.
- Some conversion code is refactord into implementations of the `From`
  trait.
- The names of channels uses a standard "sender" and "receiver" naming
  as well as trying to be descriptive of where they go in `ScriptThread`
  as well as `InitialScriptState`

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-12-26 03:34:54 +00:00
Martin Robinson
a5c461146f
script: Cache the <iframe> list per-Document (#34702)
This change creates a new struct `IFrameCollection` that is used to
cache the list of `<iframe>`s in a `Document` as long as the
`Document`'s DOM has not changed. This prevent constantly iterating the
entire DOM during *update the rendering*, which runs up to 60 times per
second as well as for other operations.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-12-20 11:46:46 +00:00
Jonathan Schwender
c3c3e5ed16
Fix compilation with --no-default-features (#34678)
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2024-12-18 09:00:42 +00:00
Martin Robinson
9d986a8ab3
script: Expose a constructor on HTMLCollection that takes a static function (#34667)
Expose a new constructor on `HTMLCollection`, `new_with_filter_fn`, that
filters elements using a simple static function -- a common pattern.
This allows more easily creating this `HTMLCollection` without having to
create a new data structure. Since the constructor takes a static
function, no data should be captured preventing garbage collection
issues.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-12-18 08:03:50 +00:00
Samson
b7e528d2ff
webgpu: Fix HTML event loop integration (#34631)
* webgpu: Fix HTML event loop integration

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

* Bring back self.drawing_buffer.borrow().cleared

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

* Rc webgpu_contexts

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

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-12-17 06:13:44 +00:00
Martin Robinson
471d3572b7
script: No longer do explicit reflows for display (#34599)
These all happen now in *update the rendering*, typically after the
message that triggered this code is processed, though in two cases
reflow needs to be triggered explicitly. This makes `ReflowReason`
redundant though perhaps `ReflowCondition` can be expanded later to give
more insight into why the page is dirty.

- Handling of the "reflow timer" concept has been explained a bit more via
  data structures and rustdoc comments.
- Theme changes are cleaned up a little to simplify what happens during
  reflow and to avoid unecessary reflows when the theme doesn't change.

Notably, layout queries and scrolling still trigger normal reflows and
don't update the rendering. This needs more investigation as it's
unclear to me currently whether or not they should update the rendering
and simply delay event dispatch or only reflow.

In general, this is a simplfication of the code.

Fixes #31871.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-12-13 13:25:47 +00:00
Martin Robinson
2bcee38e52
script: Remove note_rendering_opportunity and rendering_opportunity (#34575)
A rendering opportunity is now unconditionally triggered by handling IPC
messages in the `ScriptThread`, unless animations are running in which
case it's driven by the compositor. We can now remove calls to
`note_rendering_opportunity` and `rendering_opportunity`.

There is one tricky case, which is when a promise completion during a
microtask checkpoint dirties the page again. In this case we need to
trigger a new rendering opportunity, unless animations are running.  In
a followup change, when not driven by the compositor, rendering
opportunities will be driven by a timed task, meaning we can remove this
workaround.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-12-12 08:43:58 +00:00
Martin Robinson
25f242b652
script: Do not do explicit reflows when handing rAFs (#34576)
This removes two explicit calls to reflow to detect rAFs that do not
modify the DOM and to trigger reflows when the page isn't dirty. This
can cause extra reflows, especially when animations are running. This
change removes them, relying on *update the rendering* to properly
trigger reflows, shortly after running rAF callbacks and after
animations are updated.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-12-11 18:06:03 +00:00
Martin Robinson
3f85a27097
script: Remove 'pending reflow' concept and some explicit reflows (#34558)
The `pending reflow` concept isn't necessary now that *update the
rendering* is taking care of triggering reflows at the correct time.
`Window::reflow` already avoids reflows if the page is not dirty, so
pending reflows is now just an extraneous check as long as *update the
rendering* runs properly.

This change also removes some explicit reflows, which now wait until the
appropriate moment during *update the rendering*. This should remove
some extra reflows that are not necessary.

Servo needs some way to track that resizing the web view needs to
re-layout due to the initial containing block changing. Move handling
of `Document::needs_paint` to the script thread and use this, expanding
the rustdoc to explain what it is for a bit more clearly.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-12-11 12:58:37 +00:00
Martin Robinson
a0743f60b3
script: Update the rendering when receiving IPC messages instead of just reflowing (#34486)
This changes fixes two issues:

1. A reflow of all `Document`s currently done unconditionally after
   receving IPC messages in the `ScriptThread`. Reflowing without first
   updating the animation timeline can lead to transitions finshing as
   soon as they start (because it looks like time advancement is
   measaured between calls to `update-the-rendering`).
2. Fix an issue where not all `Pipeline`s were updated during *update
   the rendering*. The previous code only took into account top level
   frames and their children. It's not guaranteed that a particular
   `ScriptThread` is managing any top level frames, depending on the
   origens of those frames. We should update the rendering of those
   non-top-level iframes regardless.

   The new code attempts to order the frames according to the
   specification as much as possible without knowing the entire frame
   tree, without skipping any documents managed by the `ScriptThread` in
   question.

In addition, `Documents` is pulled out the `script_thread.rs` and
renamed to `DocumentCollection`.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-12-09 11:33:58 +00:00
Ville Lindholm
bc7fe41a02
Add XPath parser/evaluator (#34463)
* Add XPath parser/evaluator

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* Correctly annotate XPathEvaluator IDL

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* [PR review]: have bindings pass in `can_gc`

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* [PR review]: add docstrings

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* [PR review]: implement PartialEq for Value for readability

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* [PR review]: add docstrings for CoreFunctions

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* [PR review]: simplify node test code

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* [PR review]: add unit tests for string handling xpath functions

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* put xpath features behind dom.xpath.enabled pref

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* [PR review] remove rstest and insta dev-deps

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* update wpt test expectations

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* [PR review]: tweak metadata files

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* update wpt test expectations AGAIN

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

---------

Signed-off-by: Ville Lindholm <ville@lindholm.dev>
2024-12-08 02:01:50 +00:00
Martin Robinson
54761b4f32
script: Update animations once per-Document during update_the_rendering() (#34489)
Before, `update_the_rendering()` would update all animations for all
Documents once per-Document. Apart from being generally wrong, the
specification says this should be done once per-Document. This
theoretically means that `update_the_rendering()` is just doing less
work every time it runs.

In addition:
 - Don't redirty animations nodes when running rAF callbacks. They
   should already be dirty when animations are updated.
 - Perform a microtask checkpoint while updating animations as dictacted
   by the specification.
 - Update comments to reflect the specification text.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-12-05 16:37:59 +00:00
atbrakhi
1591a3b506
Add webgpu feature flag (#34444)
* 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>
2024-12-05 16:07:27 +00:00
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
shanehandley
975e2ae859
Remove referrer policy from document (#34263)
* Remove the referrer policy from document and rely on its policy container

Signed-off-by: Shane Handley <shanehandley@fastmail.com>

* Make ReferrerPolicy non-optional, instead using a new enum value to represent the empty string case

Signed-off-by: Shane Handley <shanehandley@fastmail.com>

* Fix clippy issue

Signed-off-by: Shane Handley <shanehandley@fastmail.com>

* Fix usage of Option<ReferrerPolicy> in unit test

Signed-off-by: Shane Handley <shanehandley@fastmail.com>

---------

Signed-off-by: Shane Handley <shanehandley@fastmail.com>
2024-11-19 12:45:10 +00:00
shanehandley
5e2c7908d0
Use the correct fallback referrer policy for the empty string case (#34201)
Signed-off-by: Shane Handley <shanehandley@fastmail.com>
2024-11-10 03:26:19 +00:00
shanehandley
6451767428
Implement PolicyContainer and update the default ReferrerPolicy (#33977)
* Implement PolicyContainer

Signed-off-by: Shane Handley <shanehandley@fastmail.com>

* implement small parts of fetch that interact with policy container

Signed-off-by: Shane Handley <shanehandley@fastmail.com>

* fix: allow policy container's csp list to be unset

Signed-off-by: Shane Handley <shanehandley@fastmail.com>

* fix: use the correct default policy when parsing from a token

Signed-off-by: Shane Handley <shanehandley@fastmail.com>

---------

Signed-off-by: Shane Handley <shanehandley@fastmail.com>
2024-11-08 07:19:23 +00:00
chickenleaf
82c9d41330
GC hazard fix in document.rs (#34020)
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
2024-10-26 13:22:10 +00:00
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