aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_thread.rs
Commit message (Collapse)AuthorAgeFilesLines
* layout: Allow same `ScriptThread` `<iframe>`s to be resized synchronously ↵Martin Robinson2024-12-171-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | (#34656) Post layout, when a `Window` has all of the new `<iframe>` sizes, size any `Window`s for `Pipeline`s in the same `ScriptThread` synchronously. This ensures that when laying out from the outermost frame to the innermost frames, the frames sizes are set properly. There is still an issue where a non-same-`ScriptThread` `<iframe>` sits in between two `<iframe>`s of the same origin. According to the specification these frames should all be synchrnously laid out -- something quite difficult in Servo. This is issue #34655. This is the first change in a series of changes to improve the consistency of `<iframe>` loading and sizing. Fixes #14719. Fixes #24569. Fixes #24571. Fixes #25269. Fixes #25275. Fixes #25285. Fixes #30571. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* webgpu: Fix HTML event loop integration (#34631)Samson2024-12-171-0/+3
| | | | | | | | | | | | | | | | | * 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>
* script: No longer do explicit reflows for display (#34599)Martin Robinson2024-12-131-11/+9
| | | | | | | | | | | | | | | | | | | | | | | 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>
* script: Remove `note_rendering_opportunity` and `rendering_opportunity` (#34575)Martin Robinson2024-12-121-58/+37
| | | | | | | | | | | | | | | 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>
* Add embedder event for preferred color scheme and respond to it in the ↵arthmis2024-12-121-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | LayoutThread (#34532) * respond to winit platform theme changed event and send it to the layout thread Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> * refactoring viewport and theme change handling functions based on feedback Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> * fixing issues reported by test-tidy Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> * update stylo in order to use color_scheme function on Device Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> --------- Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> Co-authored-by: lazypassion <25536767+lazypassion@users.noreply.github.com>
* script: Do not do explicit reflows when handing rAFs (#34576)Martin Robinson2024-12-111-12/+11
| | | | | | | | | | 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>
* script: Remove 'pending reflow' concept and some explicit reflows (#34558)Martin Robinson2024-12-111-22/+11
| | | | | | | | | | | | | | | | | | 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>
* script: Do not prioritize *update-the-rendering* in `ScriptThread` message ↵Martin Robinson2024-12-101-101/+29
| | | | | | | | | | | | | | | | | | | | loop (#34539) Instead run *update the rendering* at the end of every process of gathering messages sent to the `ScriptThread`. This ensures that the thread is in a consistent state when the update is finally run and prevents running more than one instance of *update the rendering* per spin of the message loop. In addition: - Move the *run the resize steps* implementation to `Window` and ensure that the realm is active when it is run. - Profile the queueing of the resize message instead of handling it. I think this makes more sense as the profiling seems to be targeting message handling and not *update the rendering*. Additionally, it's difficult to profile from the context of `Window`. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* script: Update the rendering when receiving IPC messages instead of just ↵Martin Robinson2024-12-091-147/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* script: Update animations once per-Document during `update_the_rendering()` ↵Martin Robinson2024-12-051-20/+10
| | | | | | | | | | | | | | | | | | (#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>
* Add `webgpu` feature flag (#34444)atbrakhi2024-12-051-6/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Retain the referrer policy when loading an about:blank iframe. (#34432)shanehandley2024-11-301-7/+4
| | | | | This allows the referrer policy to be inherited correctly by the iframe. Signed-off-by: Shane Handley <shanehandley@fastmail.com>
* Filter out webidl files based on special comments, and feature-gate webxr ↵Josh Matthews2024-11-241-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* script: Remove a warning about a common situation involving OOP iframes (#34288)Martin Robinson2024-11-191-1/+4
| | | | | | | | | When an iframe is out of process or running in a different `ScriptThread`, it is expected that their `Document`s cannot be found in the current `ScriptThread` during the *update-the-rendering* step. Remove the warning in that situation and add a comment instead. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* Remove referrer policy from document (#34263)shanehandley2024-11-191-8/+9
| | | | | | | | | | | | | | | | | | | | | * 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>
* Plumb time profiler output into tracing (#34238)Delan Azabani2024-11-151-37/+116
| | | | | | | | | | | | | | | | | * Plumb time profiler output into tracing Signed-off-by: Delan Azabani <dazabani@igalia.com> * Enter the span tightly around the callback Signed-off-by: Delan Azabani <dazabani@igalia.com> * Use `info_span!()` shorthand Signed-off-by: Delan Azabani <dazabani@igalia.com> --------- Signed-off-by: Delan Azabani <dazabani@igalia.com>
* feat: `webxr` feature flag (#34241)Ngo Iok Ui (Wu Yu Wei)2024-11-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add webxr feature flag Add webxr feature flag to embedder_traits Add webxr flag to constellation Add webxr flag to compositor Add webxr flag to canvas Turn registry into optional Add webxr flag to servo lib Signed-off-by: Wu Yu Wei <yuweiwu@pm.me> Co-authored-by: august kline <me@augustkline.com> * Cargo fmt Signed-off-by: Wu Yu Wei <yuweiwu@pm.me> * Add missing license Signed-off-by: Wu Yu Wei <yuweiwu@pm.me> * Cargo clippy Signed-off-by: Wu Yu Wei <yuweiwu@pm.me> --------- Signed-off-by: Wu Yu Wei <yuweiwu@pm.me> Co-authored-by: august kline <me@augustkline.com>
* Support persisting unminified external stylesheets (#33919)Taym Haddadi2024-10-301-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | * Support local tweaking of external stylesheets Signed-off-by: Taym <haddadi.taym@gmail.com> * Remove duplicated code between unminify_css and unminify_js Signed-off-by: Taym <haddadi.taym@gmail.com> * Add License Signed-off-by: Taym <haddadi.taym@gmail.com> * Use js-beautify instead of npx Signed-off-by: Taym <haddadi.taym@gmail.com> * Fix clippy warning Signed-off-by: Taym <haddadi.taym@gmail.com> --------- Signed-off-by: Taym <haddadi.taym@gmail.com>
* Replace uses of SCRIPT_THREAD_ROOT with accessor helpers. (#34036)Josh Matthews2024-10-281-191/+115
| | | Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Devtools: Don't display iframes in the tab list (#34032)eri2024-10-271-5/+7
| | | Signed-off-by: eri <epazos@igalia.com>
* cangc fixes in several files + event.rs + rtcpeerconnection.rs (#34002)chickenleaf2024-10-251-7/+16
| | | Signed-off-by: L Ashwin B <lashwinib@gmail.com>
* CanGc fixes from EventTarget::fire_event (#33985)tanishka2024-10-231-3/+4
| | | Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
* cangc fixes in node.rs (#33984)chickenleaf2024-10-231-1/+1
| | | Signed-off-by: L Ashwin B <lashwinib@gmail.com>
* CanGc fixes in `errorevent.rs` (#33960)tanishka2024-10-221-6/+9
| | | | | | | | | | | | | * 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>
* Mark promise creation methods with CanGc (#33928)Josh Matthews2024-10-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* CanGc changes from fontfaceset.rs (#33920)chickenleaf2024-10-211-14/+18
| | | | | | | | | | | | | | | | * 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>
* CanGc fixes from constantsourcenode.rs & window.rs (#33931)tanishka2024-10-201-4/+4
| | | Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
* Multiple CanGc fixes in components/script/dom (#33924)tanishka2024-10-201-0/+3
| | | Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
* CanGc fixes through focusevent.rs & hashchangeevent.rs (#33921)tanishka2024-10-201-5/+21
| | | Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
* Prevent moving CanGc values between threads/tasks (#33902)Josh Matthews2024-10-181-10/+5
| | | | | | | | | | | | | * 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>
* Various CanGc fixes in 8 files (#33893)chickenleaf2024-10-181-3/+3
| | | | | | | | | | | | | * Various CanGc fixes in 8 files Signed-off-by: L Ashwin B <lashwinib@gmail.com> * fixed merge conflicts and formatting Signed-off-by: L Ashwin B <lashwinib@gmail.com> --------- Signed-off-by: L Ashwin B <lashwinib@gmail.com>
* Some CanGc fixes in components/script/dom (#33895)tanishka2024-10-181-1/+1
| | | Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
* clippy: Rename `RequestId::new()` to `RequestId::next()` and fix one more ↵komuhangi2024-10-181-2/+2
| | | | | | | | | | | | | | | issue in `servo/lib.rs` (#33881) * clippy: fix clippy warnings in components/ Signed-off-by: jahielkomu <ktumuhairwe24@gmail.com> * Addressed changes from the PR Signed-off-by: jahielkomu <ktumuhairwe24@gmail.com> --------- Signed-off-by: jahielkomu <ktumuhairwe24@gmail.com>
* More CanGc fixes (#33888)chickenleaf2024-10-171-1/+1
| | | Signed-off-by: L Ashwin B <lashwinib@gmail.com>
* net: Start reducing number of IPCs channels used for fetch with a ↵Martin Robinson2024-10-161-19/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `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>
* clippy: fix clippy warnings in `components/script` (#33849)komuhangi2024-10-161-0/+1
| | | | | | | | | | | | | * Clippy:Fix clippy warnings in components/script Signed-off-by: jahielkomu <ktumuhairwe24@gmail.com> * Addressed changes suggested in #33849 Signed-off-by: jahielkomu <ktumuhairwe24@gmail.com> --------- Signed-off-by: jahielkomu <ktumuhairwe24@gmail.com>
* clippy: Add safety documentation and clean up unsafe methods (#33748)Martin Robinson2024-10-161-7/+9
| | | | | | | | | | | This change: 1. Adds safety documentation where it was missing. 2. Limits the scope of unsafe code in some cases to where it is actually unsafe. 3. Converts some free functions to associated functions and methods, thereby making them more likely to be called safely. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* CanGc fixes (#33852)chickenleaf2024-10-161-1/+1
| | | Signed-off-by: L Ashwin B <lashwinib@gmail.com>
* CanGc fixes in components/script/dom (#33843)tanishka2024-10-151-2/+3
| | | Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
* CanGc fixes and checks in multiple files (#33836)chickenleaf2024-10-151-7/+20
| | | | | | | | | | | | | * 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>
* CanGc fixes in focusevent.rs oscillartornode.rs response.rs ↵chickenleaf2024-10-131-4/+6
| | | | | resizeobserversize.rs animationevent.rs (#33827) Signed-off-by: L Ashwin B <lashwinib@gmail.com>
* Various CanGc fixes (#33800)webbeef2024-10-111-11/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* More CanGc fixes: Range, Event, gpu error, Header (#33774)webbeef2024-10-101-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* use `ThreadSafeJSContext` instead of `ContextForRequestInterrupt` (#33769)Samson2024-10-101-5/+5
| | | | | | | | | | | | | * use `ThreadSafeJSContext` instead of `ContextForRequestInterrupt` Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * use servo/mozjs Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* compositor: Create a single cross-process compositor API (#33619) (#33660)Martin Robinson2024-10-091-6/+6
| | | | | | | | | | | | | | | | | | | | | | Instead of exposing many different kinds of messages to the compositor that are routed through the constellation, expose a single message type which can be sent across IPC channels. In addition, this IPC channel and the route to the crossbeam channel with the compositor is created along with the `CompositorProxy`, simplifying what needs to be passed around during pipeline initialization. Previously, some image updates (from video) were sent over IPC with a special serialization routine and some were sent via crossbeam channels (canvas). Now all updates go over the IPC channel `IpcSharedMemory` is used to avoid serialization penalties. This should improve performance and reduce copies for video, but add a memory copy overhead for canvas. This will improve in the future when canvas renders directly into a texture. All-in-all this is a simplification which opens the path toward having a standard compositor API and reduces the number of duplicate messages and proxying that had to happen in libservo. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Fixed some clippy warnings in components/script and components/devtools (#33689)komuhangi2024-10-071-1/+1
| | | Signed-off-by: jahielkomu <ktumuhairwe24@gmail.com>
* Revert "compositor: Create a single cross-process compositor API (#33619)" ↵Martin Robinson2024-10-041-6/+6
| | | | | | | | | (#33645) This reverts commit f2f5614ad64927aa82aa8937ae14a6086df49d2b. This is causing intermittent crashes: https://github.com/servo/servo/actions/runs/11167043809/job/31044255019 Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* compositor: Create a single cross-process compositor API (#33619)Martin Robinson2024-10-031-6/+6
| | | | | | | | | | | | | | | | | | | | | | Instead of exposing many different kinds of messages to the compositor that are routed through the constellation, expose a single message type which can be sent across IPC channels. In addition, this IPC channel and the route to the crossbeam channel with the compositor is created along with the `CompositorProxy`, simplifying what needs to be passed around during pipeline initialization. Previously, some image updates (from video) were sent over IPC with a special serialization routine and some were sent via crossbeam channels (canvas). Now all updates go over the IPC channel `IpcSharedMemory` is used to avoid serialization penalties. This should improve performance and reduce copies for video, but add a memory copy overhead for canvas. This will improve in the future when canvas renders directly into a texture. All-in-all this is a simplification which opens the path toward having a standard compositor API and reduces the number of duplicate messages and proxying that had to happen in libservo. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Create HttpStatus to safely deal with HTTP responses status. (#33581)webbeef2024-09-291-9/+8
| | | Signed-off-by: webbeef <me@webbeef.org>
* fonts: Use `IpcSharedMemory` to send font data (#33530)Martin Robinson2024-09-251-8/+8
| | | | | | | | | | | | | | | | | | | | | This changes modifes the way that font data is sent over IPC channels. Instead of serializing the data or sending it via IPC byte senders, font data is copied into shared memory and a copy of the handle is sent over the channel. There is also the idea of sending the file handle of the on disk data of system fonts. This could be implemented as a further followup once there is an abstraction in `ipc-channel` over file handles. To accomplish this, a `FontData` abstraction is added, which also allows caching an in-memory shared `Arc<Vec<u8>>` version of the data (neeeded by some APIs). This could also be a place for caching font tables in the future. Finally, the `FontCacheThread` is renamed to the `SystemFontService` while the proxy for this is now named `SystemFontServiceProxy`. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>