From 2687b86763c87ec22c17c97a547484a0d433e9bb Mon Sep 17 00:00:00 2001 From: webbeef Date: Thu, 5 Feb 2026 19:28:54 -0800 Subject: [PATCH] chore: update to Servo be6a2f99a1e80060228f41280fd7d2178983e7ed --- Cargo.lock | 38 ++++++++++++++----- Cargo.toml | 4 ++ forkme.lock | 2 +- .../constellation/constellation.rs.patch | 18 ++++----- .../components/layout/layout_impl.rs.patch | 8 ++-- .../script/dom/globalscope.rs.patch | 8 ++-- patches/components/script/dom/mod.rs.patch | 4 +- patches/components/script/dom/window.rs.patch | 16 ++++---- .../dom/workers/workerglobalscope.rs.patch | 2 +- .../components/script/script_thread.rs.patch | 24 ++++++------ patches/components/script/timers.rs.patch | 8 ++-- .../shared/constellation/lib.rs.patch | 10 +++-- 12 files changed, 84 insertions(+), 58 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a6877bc..d87c865 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -254,9 +254,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.100" +version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" +checksum = "5f0e0fee31ef5ed1ba1316088939cea399010ed7731dba877ed44aeb407a75ea" [[package]] name = "app_units" @@ -2522,9 +2522,6 @@ dependencies = [ "bitflags 2.10.0", "byteorder", "content-security-policy", - "core-foundation 0.9.4", - "core-graphics", - "core-text", "dwrote", "euclid", "fonts_traits", @@ -2538,6 +2535,10 @@ dependencies = [ "memmap2", "net_traits", "num-traits", + "objc2 0.6.3", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-core-text", "paint_api", "parking_lot", "profile_traits", @@ -6016,7 +6017,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" dependencies = [ "bitflags 2.10.0", + "block2 0.6.2", "dispatch2", + "libc", "objc2 0.6.3", ] @@ -6027,10 +6030,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e022c9d066895efa1345f8e33e584b9f958da2fd4cd116792e15e07e4720a807" dependencies = [ "bitflags 2.10.0", + "block2 0.6.2", "dispatch2", + "libc", "objc2 0.6.3", "objc2-core-foundation", "objc2-io-surface", + "objc2-metal 0.3.2", ] [[package]] @@ -6057,6 +6063,20 @@ dependencies = [ "objc2-foundation 0.2.2", ] +[[package]] +name = "objc2-core-text" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cde0dfb48d25d2b4862161a4d5fcc0e3c24367869ad306b0c9ec0073bfed92d" +dependencies = [ + "bitflags 2.10.0", + "block2 0.6.2", + "libc", + "objc2 0.6.3", + "objc2-core-foundation", + "objc2-core-graphics", +] + [[package]] name = "objc2-core-video" version = "0.3.2" @@ -11452,18 +11472,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.38" +version = "0.8.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57cf3aa6855b23711ee9852dfc97dfaa51c45feaba5b645d0c777414d494a961" +checksum = "db6d35d663eadb6c932438e763b262fe1a70987f9ae936e60158176d710cae4a" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.38" +version = "0.8.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a616990af1a287837c4fe6596ad77ef57948f787e46ce28e166facc0cc1cb75" +checksum = "4122cd3169e94605190e77839c9a40d40ed048d305bfdc146e7df40ab0f3e517" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index efcc6ca..e38a6e5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -121,6 +121,10 @@ num-derive = "0.4.2" num-traits = "0.2" num_cpus = "1.17.0" ocb3 = "0.1.0" +objc2 = "0.6.3" +objc2-core-foundation = "0.3.2" +objc2-core-graphics = "0.3.2" +objc2-core-text = "0.3.2" openxr = "0.20" paint_api = { path = "source/components/shared/paint" } p256 = { version = "0.13", features = ["ecdh"] } diff --git a/forkme.lock b/forkme.lock index 1a9755f..e53487e 100644 --- a/forkme.lock +++ b/forkme.lock @@ -1 +1 @@ -b7afca1214e76024ca465c5dba1b07fc98a839c0 +be6a2f99a1e80060228f41280fd7d2178983e7ed diff --git a/patches/components/constellation/constellation.rs.patch b/patches/components/constellation/constellation.rs.patch index fd41fb7..4bf2c5c 100644 --- a/patches/components/constellation/constellation.rs.patch +++ b/patches/components/constellation/constellation.rs.patch @@ -129,7 +129,7 @@ } } -@@ -1732,6 +1776,12 @@ +@@ -1773,6 +1817,12 @@ self.broadcast_channels .remove_broadcast_channel_router(router_id); }, @@ -142,7 +142,7 @@ ScriptToConstellationMessage::ScheduleBroadcast(router_id, message) => { if self .check_origin_against_pipeline(&source_pipeline_id, &message.origin) -@@ -1762,6 +1812,12 @@ +@@ -1803,6 +1853,12 @@ ScriptToConstellationMessage::CreateAuxiliaryWebView(load_info) => { self.handle_script_new_auxiliary(load_info); }, @@ -155,7 +155,7 @@ ScriptToConstellationMessage::ChangeRunningAnimationsState(animation_state) => { self.handle_change_running_animations_state(source_pipeline_id, animation_state) }, -@@ -1928,6 +1984,23 @@ +@@ -1969,6 +2025,23 @@ new_value, ); }, @@ -179,7 +179,7 @@ ScriptToConstellationMessage::MediaSessionEvent(pipeline_id, event) => { // Unlikely at this point, but we may receive events coming from // different media sessions, so we set the active media session based -@@ -1996,6 +2069,129 @@ +@@ -2037,6 +2110,129 @@ ScriptToConstellationMessage::RespondToScreenshotReadinessRequest(response) => { self.handle_screenshot_readiness_response(source_pipeline_id, response); }, @@ -309,7 +309,7 @@ } } -@@ -3094,6 +3290,13 @@ +@@ -3135,6 +3331,13 @@ /// fn handle_close_top_level_browsing_context(&mut self, webview_id: WebViewId) { debug!("{webview_id}: Closing"); @@ -323,7 +323,7 @@ let browsing_context_id = BrowsingContextId::from(webview_id); // Step 5. Remove traversable from the user agent's top-level traversable set. let browsing_context = -@@ -3370,8 +3573,27 @@ +@@ -3411,8 +3614,27 @@ opener_webview_id, opener_pipeline_id, response_sender, @@ -351,7 +351,7 @@ let Some((webview_id_sender, webview_id_receiver)) = generic_channel::channel() else { warn!("Failed to create channel"); let _ = response_sender.send(None); -@@ -3469,6 +3691,359 @@ +@@ -3510,6 +3732,359 @@ }); } @@ -711,7 +711,7 @@ #[servo_tracing::instrument(skip_all)] fn handle_refresh_cursor(&self, pipeline_id: PipelineId) { let Some(pipeline) = self.pipelines.get(&pipeline_id) else { -@@ -4591,7 +5166,7 @@ +@@ -4632,7 +5207,7 @@ } #[servo_tracing::instrument(skip_all)] @@ -720,7 +720,7 @@ // Send a flat projection of the history to embedder. // The final vector is a concatenation of the URLs of the past // entries, the current entry and the future entries. -@@ -4694,9 +5269,23 @@ +@@ -4735,9 +5310,23 @@ ); self.embedder_proxy.send(EmbedderMsg::HistoryChanged( webview_id, diff --git a/patches/components/layout/layout_impl.rs.patch b/patches/components/layout/layout_impl.rs.patch index eff7f24..4876cb2 100644 --- a/patches/components/layout/layout_impl.rs.patch +++ b/patches/components/layout/layout_impl.rs.patch @@ -1,6 +1,6 @@ --- original +++ modified -@@ -206,6 +206,10 @@ +@@ -210,6 +210,10 @@ /// The collector for calculating Largest Contentful Paint lcp_candidate_collector: RefCell>, @@ -11,7 +11,7 @@ } pub struct LayoutFactoryImpl(); -@@ -246,12 +250,25 @@ +@@ -250,12 +254,25 @@ fn set_viewport_details(&mut self, viewport_details: ViewportDetails) -> bool { let device = self.stylist.device_mut(); let device_pixel_ratio = Scale::new(viewport_details.hidpi_scale_factor.get()); @@ -41,10 +41,10 @@ device.set_viewport_size(viewport_details.size); device.set_device_pixel_ratio(device_pixel_ratio); self.device_has_changed = true; -@@ -765,6 +782,7 @@ - debug: opts::get().debug.clone(), +@@ -770,6 +787,7 @@ previously_highlighted_dom_node: Cell::new(None), lcp_candidate_collector: Default::default(), + user_stylesheets: config.user_stylesheets, + page_zoom_for_rendering: Cell::new(config.viewport_details.page_zoom_for_rendering), } } diff --git a/patches/components/script/dom/globalscope.rs.patch b/patches/components/script/dom/globalscope.rs.patch index 8433a51..816f94f 100644 --- a/patches/components/script/dom/globalscope.rs.patch +++ b/patches/components/script/dom/globalscope.rs.patch @@ -1,6 +1,6 @@ --- original +++ modified -@@ -376,6 +376,16 @@ +@@ -369,6 +369,16 @@ /// Is considered in a secure context inherited_secure_context: Option, @@ -17,7 +17,7 @@ /// Directory to store unminified scripts for this window if unminify-js /// opt is enabled. unminified_js_dir: Option, -@@ -776,6 +786,8 @@ +@@ -769,6 +779,8 @@ #[cfg(feature = "webgpu")] gpu_id_hub: Arc, inherited_secure_context: Option, unminify_js: bool, @@ -26,7 +26,7 @@ font_context: Option>, ) -> Self { Self { -@@ -819,6 +831,8 @@ +@@ -812,6 +824,8 @@ console_group_stack: DomRefCell::new(Vec::new()), console_count_map: Default::default(), inherited_secure_context, @@ -35,7 +35,7 @@ unminified_js_dir: unminify_js.then(|| unminified_path("unminified-js")), byte_length_queuing_strategy_size_function: OnceCell::new(), count_queuing_strategy_size_function: OnceCell::new(), -@@ -3123,6 +3137,16 @@ +@@ -3116,6 +3130,16 @@ self.inherited_secure_context } diff --git a/patches/components/script/dom/mod.rs.patch b/patches/components/script/dom/mod.rs.patch index cf4b7c1..e4d9ed3 100644 --- a/patches/components/script/dom/mod.rs.patch +++ b/patches/components/script/dom/mod.rs.patch @@ -8,7 +8,7 @@ pub(crate) mod errorevent; pub(crate) mod event; pub(crate) mod eventsource; -@@ -318,6 +319,7 @@ +@@ -319,6 +320,7 @@ pub(crate) mod inputevent; pub(crate) mod intersectionobserver; pub(crate) mod intersectionobserverentry; @@ -16,7 +16,7 @@ pub(crate) mod keyboardevent; pub(crate) mod location; pub(crate) mod media; -@@ -345,6 +347,8 @@ +@@ -346,6 +348,8 @@ pub(crate) mod pagetransitionevent; pub(crate) mod paintsize; pub(crate) mod paintworkletglobalscope; diff --git a/patches/components/script/dom/window.rs.patch b/patches/components/script/dom/window.rs.patch index 363a1e2..cdb70d3 100644 --- a/patches/components/script/dom/window.rs.patch +++ b/patches/components/script/dom/window.rs.patch @@ -9,7 +9,7 @@ }; use euclid::default::Rect as UntypedRect; use euclid::{Point2D, Rect, Scale, Size2D, Vector2D}; -@@ -1134,12 +1134,22 @@ +@@ -1133,12 +1133,22 @@ let (sender, receiver) = ProfiledGenericChannel::channel(self.global().time_profiler_chan().clone()).unwrap(); @@ -33,7 +33,7 @@ receiver.recv().unwrap_or_else(|_| { // If the receiver is closed, we assume the dialog was cancelled. debug!("Alert dialog was cancelled or failed to show."); -@@ -1167,13 +1177,22 @@ +@@ -1166,13 +1176,22 @@ // the user to respond with a positive or negative response. let (sender, receiver) = ProfiledGenericChannel::channel(self.global().time_profiler_chan().clone()).unwrap(); @@ -57,7 +57,7 @@ // Step 5: Let userPromptHandler be WebDriver BiDi user prompt opened with this, // "confirm", and message. // -@@ -1218,6 +1237,7 @@ +@@ -1217,6 +1236,7 @@ // defaulted to the value given by default. let (sender, receiver) = ProfiledGenericChannel::channel(self.global().time_profiler_chan().clone()).unwrap(); @@ -65,7 +65,7 @@ let dialog = SimpleDialogRequest::Prompt { id: self.Document().embedder_controls().next_control_id(), message: message.to_string(), -@@ -1224,8 +1244,16 @@ +@@ -1223,8 +1243,16 @@ default: default.to_string(), response_sender: sender, }; @@ -83,7 +83,7 @@ // Step 6: Let userPromptHandler be WebDriver BiDi user prompt opened with this, // "prompt", and message. // TODO: Add support for WebDriver BiDi. -@@ -3043,9 +3071,33 @@ +@@ -3049,9 +3077,33 @@ &self, input_event: &ConstellationInputEvent, ) -> Option { @@ -120,7 +120,7 @@ } #[expect(unsafe_code)] -@@ -3064,8 +3116,25 @@ +@@ -3070,8 +3122,25 @@ // SAFETY: This is safe because `Window::query_elements_from_point` has ensured that // layout has run and any OpaqueNodes that no longer refer to real nodes are gone. let address = UntrustedNodeAddress(result.node.0 as *const c_void); @@ -147,7 +147,7 @@ cursor: result.cursor, point_in_node: result.point_in_target, point_in_frame, -@@ -3747,6 +3816,8 @@ +@@ -3753,6 +3822,8 @@ player_context: WindowGLContext, #[cfg(feature = "webgpu")] gpu_id_hub: Arc, inherited_secure_context: Option, @@ -156,7 +156,7 @@ theme: Theme, weak_script_thread: Weak, ) -> DomRoot { -@@ -3773,6 +3844,8 @@ +@@ -3779,6 +3850,8 @@ gpu_id_hub, inherited_secure_context, unminify_js, diff --git a/patches/components/script/dom/workers/workerglobalscope.rs.patch b/patches/components/script/dom/workers/workerglobalscope.rs.patch index c9d1c20..f883582 100644 --- a/patches/components/script/dom/workers/workerglobalscope.rs.patch +++ b/patches/components/script/dom/workers/workerglobalscope.rs.patch @@ -1,6 +1,6 @@ --- original +++ modified -@@ -370,6 +370,8 @@ +@@ -371,6 +371,8 @@ gpu_id_hub, init.inherited_secure_context, init.unminify_js, diff --git a/patches/components/script/script_thread.rs.patch b/patches/components/script/script_thread.rs.patch index 3c0f33a..c93f48b 100644 --- a/patches/components/script/script_thread.rs.patch +++ b/patches/components/script/script_thread.rs.patch @@ -14,7 +14,7 @@ use crossbeam_channel::unbounded; use data_url::mime::Mime; @@ -54,8 +54,8 @@ - use embedder_traits::user_contents::{UserContentManagerId, UserContents}; + use embedder_traits::user_contents::{UserContentManagerId, UserContents, UserScript}; use embedder_traits::{ EmbedderControlId, EmbedderControlResponse, EmbedderMsg, FocusSequenceNumber, - JavaScriptEvaluationError, JavaScriptEvaluationId, MediaSessionActionType, Theme, @@ -24,15 +24,15 @@ }; use encoding_rs::Encoding; use fonts::{FontContext, SystemFontServiceProxy}; -@@ -91,6 +91,7 @@ - NewPipelineInfo, Painter, ProgressiveWebMetricType, ScriptThreadMessage, +@@ -92,6 +92,7 @@ UpdatePipelineIdReason, }; + use servo_arc::Arc as ServoArc; +use servo_config::pref_util::PrefValue; use servo_config::{opts, prefs}; use servo_url::{ImmutableOrigin, MutableOrigin, OriginSnapshot, ServoUrl}; use storage_traits::StorageThreads; -@@ -1899,11 +1900,22 @@ +@@ -1940,11 +1941,22 @@ self.handle_refresh_cursor(pipeline_id); }, ScriptThreadMessage::PreferencesUpdated(updates) => { @@ -59,7 +59,7 @@ }, ScriptThreadMessage::ForwardKeyboardScroll(pipeline_id, scroll) => { if let Some(document) = self.documents.borrow().find_document(pipeline_id) { -@@ -1938,6 +1950,16 @@ +@@ -1979,6 +1991,16 @@ ScriptThreadMessage::UpdatePinchZoomInfos(id, pinch_zoom_infos) => { self.handle_update_pinch_zoom_infos(id, pinch_zoom_infos, CanGc::from_cx(cx)); }, @@ -76,7 +76,7 @@ } } -@@ -2884,6 +2906,9 @@ +@@ -2925,6 +2947,9 @@ .documents .borrow() .find_iframe(parent_pipeline_id, browsing_context_id); @@ -86,7 +86,7 @@ if let Some(frame_element) = frame_element { frame_element.update_pipeline_id(new_pipeline_id, reason, can_gc); } -@@ -2902,6 +2927,7 @@ +@@ -2943,6 +2968,7 @@ // is no need to pass along existing opener information that // will be discarded. None, @@ -94,7 +94,7 @@ ); } } -@@ -3181,6 +3207,44 @@ +@@ -3222,6 +3248,44 @@ } } @@ -139,7 +139,7 @@ fn ask_constellation_for_top_level_info( &self, sender_webview_id: WebViewId, -@@ -3287,7 +3351,13 @@ +@@ -3334,7 +3398,13 @@ self.senders.pipeline_to_embedder_sender.clone(), self.senders.constellation_sender.clone(), incomplete.pipeline_id, @@ -154,7 +154,7 @@ incomplete.viewport_details, origin.clone(), final_url.clone(), -@@ -3309,6 +3379,8 @@ +@@ -3356,6 +3426,8 @@ #[cfg(feature = "webgpu")] self.gpu_id_hub.clone(), incomplete.load_data.inherited_secure_context, @@ -163,7 +163,7 @@ incomplete.theme, self.this.clone(), ); -@@ -3330,6 +3402,7 @@ +@@ -3377,6 +3449,7 @@ incomplete.webview_id, incomplete.parent_info, incomplete.opener, @@ -171,7 +171,7 @@ ); if window_proxy.parent().is_some() { // https://html.spec.whatwg.org/multipage/#navigating-across-documents:delaying-load-events-mode-2 -@@ -4037,6 +4110,24 @@ +@@ -4084,6 +4157,24 @@ document.event_handler().handle_refresh_cursor(); } diff --git a/patches/components/script/timers.rs.patch b/patches/components/script/timers.rs.patch index 9b38ff2..4e7e3e1 100644 --- a/patches/components/script/timers.rs.patch +++ b/patches/components/script/timers.rs.patch @@ -6,9 +6,9 @@ use crate::dom::document::RefreshRedirectDue; +use crate::dom::document_event_handler::LongPressContextMenuCallback; use crate::dom::eventsource::EventSourceTimeoutCallback; - use crate::dom::globalscope::{ErrorReporting, GlobalScope, RethrowErrors}; - #[cfg(feature = "testbinding")] -@@ -126,6 +127,7 @@ + use crate::dom::global_scope_script_execution::{ErrorReporting, RethrowErrors}; + use crate::dom::globalscope::GlobalScope; +@@ -127,6 +128,7 @@ #[cfg(feature = "testbinding")] TestBindingCallback(TestBindingCallback), RefreshRedirectDue(RefreshRedirectDue), @@ -16,7 +16,7 @@ /// RunStepsAfterTimeout { /// Step 1. timerKey -@@ -150,6 +152,7 @@ +@@ -151,6 +153,7 @@ #[cfg(feature = "testbinding")] OneshotTimerCallback::TestBindingCallback(callback) => callback.invoke(), OneshotTimerCallback::RefreshRedirectDue(callback) => callback.invoke(can_gc), diff --git a/patches/components/shared/constellation/lib.rs.patch b/patches/components/shared/constellation/lib.rs.patch index 6581f13..fc61988 100644 --- a/patches/components/shared/constellation/lib.rs.patch +++ b/patches/components/shared/constellation/lib.rs.patch @@ -1,13 +1,15 @@ --- original +++ modified -@@ -16,13 +16,14 @@ +@@ -16,15 +16,16 @@ use std::time::Duration; use base::cross_process_instant::CrossProcessInstant; -use base::generic_channel::GenericCallback; +use base::generic_channel::{GenericCallback, GenericSharedMemory}; use base::id::{MessagePortId, PipelineId, ScriptEventLoopId, WebViewId}; - use embedder_traits::user_contents::{UserContentManagerId, UserScript}; + use embedder_traits::user_contents::{ + UserContentManagerId, UserScript, UserScriptId, UserStyleSheet, UserStyleSheetId, + }; use embedder_traits::{ - EmbedderControlId, EmbedderControlResponse, InputEventAndId, JavaScriptEvaluationId, - MediaSessionActionType, NewWebViewDetails, PaintHitTestResult, Theme, TraversalId, @@ -19,7 +21,7 @@ }; pub use from_script_message::*; use malloc_size_of_derive::MallocSizeOf; -@@ -35,9 +36,70 @@ +@@ -37,9 +38,70 @@ use servo_url::{ImmutableOrigin, ServoUrl}; pub use structured_data::*; use strum::IntoStaticStr; @@ -91,7 +93,7 @@ /// Messages to the Constellation from the embedding layer, whether from `ServoRenderer` or /// from `libservo` itself. #[derive(IntoStaticStr)] -@@ -115,6 +177,9 @@ +@@ -117,6 +179,9 @@ UserContentManagerAction(UserContentManagerId, UserContentManagerAction), /// Update pinch zoom details stored in the top level window UpdatePinchZoomInfos(PipelineId, PinchZoomInfos), -- 2.51.2