Rewild Your Web

chore: update to Servo b590c6c8487d3d682005a6b3469124909103d4d0

+48 -41
+1 -1
Cargo.toml
··· 258 258 inherits = "release" 259 259 lto = true 260 260 codegen-units = 1 261 - opt-level = 3 261 + opt-level = 3 262 262 263 263 [profile.production-stripped] 264 264 inherits = "production"
+1 -1
forkme.lock
··· 1 - 217d76c83dc63f5ff91afcb80479ed638b6dce6e 1 + b590c6c8487d3d682005a6b3469124909103d4d0
+8 -8
patches/components/constellation/constellation.rs.patch
··· 184 184 ScriptToConstellationMessage::MediaSessionEvent(pipeline_id, event) => { 185 185 // Unlikely at this point, but we may receive events coming from 186 186 // different media sessions, so we set the active media session based 187 - @@ -2052,6 +2130,129 @@ 188 - ScriptToConstellationMessage::RespondToScreenshotReadinessRequest(response) => { 189 - self.handle_screenshot_readiness_response(source_pipeline_id, response); 187 + @@ -2057,6 +2135,129 @@ 188 + let _ = event_loop.send(ScriptThreadMessage::TriggerGarbageCollection); 189 + } 190 190 }, 191 191 + ScriptToConstellationMessage::EmbeddedWebViewNotification(event) => { 192 192 + self.handle_embedded_webview_notification(webview_id, event); ··· 314 314 } 315 315 } 316 316 317 - @@ -3164,6 +3365,13 @@ 317 + @@ -3169,6 +3370,13 @@ 318 318 /// <https://html.spec.whatwg.org/multipage/#destroy-a-top-level-traversable> 319 319 fn handle_close_top_level_browsing_context(&mut self, webview_id: WebViewId) { 320 320 debug!("{webview_id}: Closing"); ··· 328 328 let browsing_context_id = BrowsingContextId::from(webview_id); 329 329 // Step 5. Remove traversable from the user agent's top-level traversable set. 330 330 let browsing_context = 331 - @@ -3440,8 +3648,27 @@ 331 + @@ -3445,8 +3653,27 @@ 332 332 opener_webview_id, 333 333 opener_pipeline_id, 334 334 response_sender, ··· 356 356 let Some((webview_id_sender, webview_id_receiver)) = generic_channel::channel() else { 357 357 warn!("Failed to create channel"); 358 358 let _ = response_sender.send(None); 359 - @@ -3539,6 +3766,359 @@ 359 + @@ -3544,6 +3771,359 @@ 360 360 }); 361 361 } 362 362 ··· 716 716 #[servo_tracing::instrument(skip_all)] 717 717 fn handle_refresh_cursor(&self, pipeline_id: PipelineId) { 718 718 let Some(pipeline) = self.pipelines.get(&pipeline_id) else { 719 - @@ -4665,7 +5245,7 @@ 719 + @@ -4670,7 +5250,7 @@ 720 720 } 721 721 722 722 #[servo_tracing::instrument(skip_all)] ··· 725 725 // Send a flat projection of the history to embedder. 726 726 // The final vector is a concatenation of the URLs of the past 727 727 // entries, the current entry and the future entries. 728 - @@ -4768,9 +5348,23 @@ 728 + @@ -4773,9 +5353,23 @@ 729 729 ); 730 730 self.embedder_proxy.send(EmbedderMsg::HistoryChanged( 731 731 webview_id,
+2 -2
patches/components/constellation/tracing.rs.patch
··· 36 36 Self::ActivateDocument => target!("ActivateDocument"), 37 37 Self::SetDocumentState(..) => target!("SetDocumentState"), 38 38 Self::SetFinalUrl(..) => target!("SetFinalUrl"), 39 - @@ -185,6 +193,35 @@ 40 - Self::RespondToScreenshotReadinessRequest(..) => { 39 + @@ -186,6 +194,35 @@ 41 40 target!("RespondToScreenshotReadinessRequest") 42 41 }, 42 + Self::TriggerGarbageCollection => target!("TriggerGarbageCollection"), 43 43 + Self::EmbeddedWebViewNotification(..) => { 44 44 + target!("EmbeddedWebViewNotification") 45 45 + },
+1 -1
patches/components/script/dom/debuggerglobalscope.rs.patch
··· 1 1 --- original 2 2 +++ modified 3 - @@ -102,9 +102,11 @@ 3 + @@ -101,9 +101,11 @@ 4 4 None, 5 5 #[cfg(feature = "webgpu")] 6 6 gpu_id_hub,
+1 -1
patches/components/script/dom/globalscope.rs.patch
··· 35 35 unminified_js_dir: unminify_js.then(|| unminified_path("unminified-js")), 36 36 byte_length_queuing_strategy_size_function: OnceCell::new(), 37 37 count_queuing_strategy_size_function: OnceCell::new(), 38 - @@ -3101,6 +3115,16 @@ 38 + @@ -3107,6 +3121,16 @@ 39 39 self.inherited_secure_context 40 40 } 41 41
+1 -1
patches/components/script/dom/html/htmllinkelement.rs.patch
··· 1 1 --- original 2 2 +++ modified 3 - @@ -697,7 +697,7 @@ 3 + @@ -693,7 +693,7 @@ 4 4 if !window.is_top_level() { 5 5 return; 6 6 }
+4 -4
patches/components/script/dom/servointernals.rs.patch
··· 20 20 use crate::dom::globalscope::GlobalScope; 21 21 use crate::dom::promise::Promise; 22 22 use crate::realms::{AlreadyInRealm, InRealm}; 23 - @@ -132,22 +134,38 @@ 23 + @@ -141,22 +143,38 @@ 24 24 25 25 /// <https://servo.org/internal-no-spec> 26 26 fn GetBoolPreference(&self, name: USVString) -> Fallible<bool> { ··· 69 69 } 70 70 Err(Error::TypeMismatch(None)) 71 71 } 72 - @@ -154,11 +172,19 @@ 72 + @@ -163,11 +181,19 @@ 73 73 74 74 /// <https://servo.org/internal-no-spec> 75 75 fn GetStringPreference(&self, name: USVString) -> Fallible<USVString> { ··· 94 94 } 95 95 Err(Error::TypeMismatch(None)) 96 96 } 97 - @@ -165,23 +191,59 @@ 97 + @@ -174,23 +200,59 @@ 98 98 99 99 /// <https://servo.org/internal-no-spec> 100 100 fn SetBoolPreference(&self, name: USVString, value: bool) { ··· 163 163 } 164 164 } 165 165 166 - @@ -197,7 +259,10 @@ 166 + @@ -206,7 +268,10 @@ 167 167 /// The navigator.servo api is exposed to about: pages except about:blank, as 168 168 /// well as any URLs provided by embedders that register new protocol handlers. 169 169 #[expect(unsafe_code)]
+4 -4
patches/components/script/dom/window.rs.patch
··· 83 83 // Step 6: Let userPromptHandler be WebDriver BiDi user prompt opened with this, 84 84 // "prompt", and message. 85 85 // TODO: Add support for WebDriver BiDi. 86 - @@ -3030,9 +3058,33 @@ 86 + @@ -3027,9 +3055,33 @@ 87 87 &self, 88 88 input_event: &ConstellationInputEvent, 89 89 ) -> Option<HitTestResult> { ··· 120 120 } 121 121 122 122 #[expect(unsafe_code)] 123 - @@ -3051,8 +3103,25 @@ 123 + @@ -3048,8 +3100,25 @@ 124 124 // SAFETY: This is safe because `Window::query_elements_from_point` has ensured that 125 125 // layout has run and any OpaqueNodes that no longer refer to real nodes are gone. 126 126 let address = UntrustedNodeAddress(result.node.0 as *const c_void); ··· 147 147 cursor: result.cursor, 148 148 point_in_node: result.point_in_target, 149 149 point_in_frame, 150 - @@ -3733,6 +3802,8 @@ 150 + @@ -3730,6 +3799,8 @@ 151 151 player_context: WindowGLContext, 152 152 #[cfg(feature = "webgpu")] gpu_id_hub: Arc<IdentityHub>, 153 153 inherited_secure_context: Option<bool>, ··· 156 156 theme: Theme, 157 157 weak_script_thread: Weak<ScriptThread>, 158 158 ) -> DomRoot<Self> { 159 - @@ -3759,6 +3830,8 @@ 159 + @@ -3756,6 +3827,8 @@ 160 160 gpu_id_hub, 161 161 inherited_secure_context, 162 162 unminify_js,
+2 -2
patches/components/script/messaging.rs.patch
··· 1 1 --- original 2 2 +++ modified 3 - @@ -107,6 +107,8 @@ 4 - ScriptThreadMessage::AccessibilityTreeUpdate(..) => None, 3 + @@ -108,6 +108,8 @@ 5 4 ScriptThreadMessage::UpdatePinchZoomInfos(id, _) => Some(*id), 6 5 ScriptThreadMessage::SetAccessibilityActive(..) => None, 6 + ScriptThreadMessage::TriggerGarbageCollection => None, 7 7 + ScriptThreadMessage::DispatchEmbeddedWebViewEvent { parent, .. } => Some(*parent), 8 8 + ScriptThreadMessage::DispatchServoError(..) => None, 9 9 },
+10 -10
patches/components/script/script_thread.rs.patch
··· 59 59 }, 60 60 ScriptThreadMessage::ForwardKeyboardScroll(pipeline_id, scroll) => { 61 61 if let Some(document) = self.documents.borrow().find_document(pipeline_id) { 62 - @@ -1970,6 +1982,16 @@ 63 - ScriptThreadMessage::SetAccessibilityActive(active) => { 64 - self.set_accessibility_active(active); 62 + @@ -1973,6 +1985,16 @@ 63 + ScriptThreadMessage::TriggerGarbageCollection => unsafe { 64 + JS_GC(*GlobalScope::get_cx(), GCReason::API); 65 65 }, 66 66 + ScriptThreadMessage::DispatchEmbeddedWebViewEvent { 67 67 + target, ··· 76 76 } 77 77 } 78 78 79 - @@ -3012,6 +3034,9 @@ 79 + @@ -3015,6 +3037,9 @@ 80 80 .documents 81 81 .borrow() 82 82 .find_iframe(parent_pipeline_id, browsing_context_id); ··· 86 86 if let Some(frame_element) = frame_element { 87 87 frame_element.update_pipeline_id(new_pipeline_id, reason, cx); 88 88 } 89 - @@ -3031,6 +3056,7 @@ 89 + @@ -3034,6 +3059,7 @@ 90 90 // is no need to pass along existing opener information that 91 91 // will be discarded. 92 92 None, ··· 94 94 ); 95 95 } 96 96 } 97 - @@ -3307,6 +3333,44 @@ 97 + @@ -3310,6 +3336,44 @@ 98 98 } 99 99 } 100 100 ··· 139 139 fn ask_constellation_for_top_level_info( 140 140 &self, 141 141 sender_webview_id: WebViewId, 142 - @@ -3421,7 +3485,13 @@ 142 + @@ -3424,7 +3488,13 @@ 143 143 self.senders.pipeline_to_embedder_sender.clone(), 144 144 self.senders.constellation_sender.clone(), 145 145 incomplete.pipeline_id, ··· 154 154 incomplete.viewport_details, 155 155 origin.clone(), 156 156 final_url.clone(), 157 - @@ -3443,6 +3513,8 @@ 157 + @@ -3446,6 +3516,8 @@ 158 158 #[cfg(feature = "webgpu")] 159 159 self.gpu_id_hub.clone(), 160 160 incomplete.load_data.inherited_secure_context, ··· 163 163 incomplete.theme, 164 164 self.this.clone(), 165 165 ); 166 - @@ -3466,6 +3538,7 @@ 166 + @@ -3469,6 +3541,7 @@ 167 167 incomplete.webview_id, 168 168 incomplete.parent_info, 169 169 incomplete.opener, ··· 171 171 ); 172 172 if window_proxy.parent().is_some() { 173 173 // https://html.spec.whatwg.org/multipage/#navigating-across-documents:delaying-load-events-mode-2 174 - @@ -4197,6 +4270,24 @@ 174 + @@ -4206,6 +4279,24 @@ 175 175 document.event_handler().handle_refresh_cursor(); 176 176 } 177 177
+3 -3
patches/components/shared/constellation/from_script_message.rs.patch
··· 119 119 /// Mark a new document as active 120 120 ActivateDocument, 121 121 /// Set the document state for a pipeline (used by screenshot / reftests) 122 - @@ -724,6 +773,44 @@ 123 - ForwardKeyboardScroll(PipelineId, KeyboardScroll), 124 - /// Notify the Constellation of the screenshot readiness of a given pipeline. 122 + @@ -726,6 +775,44 @@ 125 123 RespondToScreenshotReadinessRequest(ScreenshotReadinessResponse), 124 + /// Request the constellation to force garbage collection in all `ScriptThread`'s. 125 + TriggerGarbageCollection, 126 126 + /// Notification from an embedded webview to be forwarded to its parent iframe element. 127 127 + /// The Constellation will forward this to the parent pipeline's script thread. 128 128 + EmbeddedWebViewNotification(EmbeddedWebViewEventType),
+3 -3
patches/components/shared/script/lib.rs.patch
··· 35 35 } 36 36 37 37 /// When a pipeline is closed, should its browsing context be discarded too? 38 - @@ -308,6 +316,19 @@ 39 - UpdatePinchZoomInfos(PipelineId, PinchZoomInfos), 40 - /// Activate or deactivate accessibility features. 38 + @@ -310,6 +318,19 @@ 41 39 SetAccessibilityActive(bool), 40 + /// Force a garbage collection in this script thread. 41 + TriggerGarbageCollection, 42 42 + /// Dispatch an event on an embedded webview's iframe element. 43 43 + /// This is sent from the constellation when it receives an `EmbeddedWebViewNotification` 44 44 + /// from an embedded webview's script thread.
+7
resources/about-memory.html
··· 154 154 } 155 155 156 156 function start() { 157 + window.gcButton.onclick = async () => { 158 + window.gcButton.disabled = true; 159 + navigator.servo.garbageCollectAllContexts(); 160 + window.gcButton.disabled = false; 161 + }; 162 + 157 163 window.startButton.onclick = async () => { 158 164 let content = await navigator.servo.reportMemory(); 159 165 let reports = JSON.parse(content); ··· 211 217 <body> 212 218 <h2>Memory Reports</h2> 213 219 <button id="startButton">Measure</button> 220 + <button id="gcButton">Force GC</button> 214 221 <div id="reports" class="hidden"></div> 215 222 </body> 216 223 </html>