Rewild Your Web
web browser dweb

chore: update Servo to 36aa8e9c739e6e4beb8f96e488202aaaf77d3b6a

+51 -51
+1 -1
forkme.lock
··· 1 - c6fbaf33e2bdb9b7c7bcf2a03486f0c6b8ebf308
··· 1 + 36aa8e9c739e6e4beb8f96e488202aaaf77d3b6a
+1 -1
htmlshell/Cargo.toml
··· 6 edition.workspace = true 7 8 [features] 9 - default = ["libservo/clipboard", "js_jit", "max_log_level", "media-gstreamer", "native-bluetooth", "webgpu"] 10 gamepad = ["libservo/gamepad"] 11 global-hotkeys = ["dep:global-hotkey"] 12 crown = ["libservo/crown"]
··· 6 edition.workspace = true 7 8 [features] 9 + default = ["libservo/clipboard", "js_jit", "max_log_level", "media-gstreamer", "native-bluetooth", "webgpu"] 10 gamepad = ["libservo/gamepad"] 11 global-hotkeys = ["dep:global-hotkey"] 12 crown = ["libservo/crown"]
+6 -6
patches/components/layout/display_list/mod.rs.patch
··· 4 use style::values::specified::text::TextDecorationLine; 5 use style_traits::{CSSPixel as StyloCSSPixel, DevicePixel as StyloDevicePixel}; 6 use webrender_api::units::{ 7 - - DeviceIntSize, DevicePixel, LayoutPixel, LayoutRect, LayoutSideOffsets, LayoutSize, 8 + DeviceIntSize, DevicePixel, LayoutPixel, LayoutPoint, LayoutRect, LayoutSideOffsets, 9 + LayoutSize, LayoutTransform, 10 }; 11 use webrender_api::{ 12 self as wr, BorderDetails, BorderRadius, BorderSide, BoxShadowClipMode, BuiltDisplayList, 13 - - ClipChainId, ClipMode, ColorF, CommonItemProperties, ComplexClipRegion, NinePatchBorder, 14 - - NinePatchBorderSource, NormalBorder, PrimitiveFlags, PropertyBinding, SpatialId, 15 - - SpatialTreeItemKey, units, 16 + ClipChainId, ClipMode, ColorF, CommonItemProperties, ComplexClipRegion, ExternalScrollId, 17 - + NinePatchBorder, NinePatchBorderSource, NormalBorder, PrimitiveFlags, PropertyBinding, 18 - + ReferenceFrameKind, SpatialId, SpatialTreeItemKey, TransformStyle, units, 19 }; 20 use wr::units::LayoutVector2D; 21
··· 4 use style::values::specified::text::TextDecorationLine; 5 use style_traits::{CSSPixel as StyloCSSPixel, DevicePixel as StyloDevicePixel}; 6 use webrender_api::units::{ 7 + - DeviceIntSize, DevicePixel, LayoutPixel, LayoutPoint, LayoutRect, LayoutSideOffsets, LayoutSize, 8 + DeviceIntSize, DevicePixel, LayoutPixel, LayoutPoint, LayoutRect, LayoutSideOffsets, 9 + LayoutSize, LayoutTransform, 10 }; 11 use webrender_api::{ 12 self as wr, BorderDetails, BorderRadius, BorderSide, BoxShadowClipMode, BuiltDisplayList, 13 + - ClipChainId, ClipMode, ColorF, CommonItemProperties, ComplexClipRegion, GlyphInstance, 14 + - NinePatchBorder, NinePatchBorderSource, NormalBorder, PrimitiveFlags, PropertyBinding, 15 + - SpatialId, SpatialTreeItemKey, units, 16 + ClipChainId, ClipMode, ColorF, CommonItemProperties, ComplexClipRegion, ExternalScrollId, 17 + + GlyphInstance, NinePatchBorder, NinePatchBorderSource, NormalBorder, PrimitiveFlags, 18 + + PropertyBinding, ReferenceFrameKind, SpatialId, SpatialTreeItemKey, TransformStyle, units, 19 }; 20 use wr::units::LayoutVector2D; 21
+11 -11
patches/components/script/dom/document.rs.patch
··· 25 use fonts::WebFontDocumentContext; 26 use html5ever::{LocalName, Namespace, QualName, local_name, ns}; 27 use hyper_serde::Serde; 28 - @@ -611,6 +614,9 @@ 29 #[ignore_malloc_size_of = "TODO: unimplemented on Image"] 30 favicon: RefCell<Option<Image>>, 31 ··· 35 /// All websockets created that are associated with this document. 36 websockets: DOMTracker<WebSocket>, 37 38 - @@ -843,6 +849,12 @@ 39 40 // Set the document's activity level, reflow if necessary, and suspend or resume timers. 41 self.activity.set(activity); ··· 48 let media = ServoMedia::get(); 49 let pipeline_id = self.window().pipeline_id(); 50 let client_context_id = 51 - @@ -856,6 +868,7 @@ 52 53 self.title_changed(); 54 self.notify_embedder_favicon(); ··· 56 self.dirty_all_nodes(); 57 self.window().resume(can_gc); 58 media.resume(&client_context_id); 59 - @@ -1248,6 +1261,9 @@ 60 LoadStatus::Started, 61 )); 62 self.send_to_embedder(EmbedderMsg::Status(self.webview_id(), None)); ··· 66 } 67 }, 68 DocumentReadyState::Complete => { 69 - @@ -1256,6 +1272,9 @@ 70 self.webview_id(), 71 LoadStatus::Complete, 72 )); ··· 76 } 77 update_with_current_instant(&self.dom_complete); 78 }, 79 - @@ -1664,7 +1683,13 @@ 80 let window = self.window(); 81 if window.is_top_level() { 82 let title = self.title().map(String::from); ··· 91 } 92 } 93 94 - @@ -1673,6 +1698,18 @@ 95 window.send_to_embedder(msg); 96 } 97 ··· 110 pub(crate) fn dirty_all_nodes(&self) { 111 let root = match self.GetDocumentElement() { 112 Some(root) => root, 113 - @@ -3158,9 +3195,59 @@ 114 current_rendering_epoch, 115 ); 116 ··· 170 pub(crate) fn handle_no_longer_waiting_on_asynchronous_image_updates(&self) { 171 self.waiting_on_canvas_image_updates.set(false); 172 } 173 - @@ -3893,6 +3980,7 @@ 174 active_sandboxing_flag_set: Cell::new(SandboxingFlagSet::empty()), 175 creation_sandboxing_flag_set: Cell::new(creation_sandboxing_flag_set), 176 favicon: RefCell::new(None), ··· 178 websockets: DOMTracker::new(), 179 details_name_groups: Default::default(), 180 protocol_handler_automation_mode: Default::default(), 181 - @@ -4992,6 +5080,36 @@ 182 183 pub(crate) fn notify_embedder_favicon(&self) { 184 if let Some(ref image) = *self.favicon.borrow() { ··· 215 self.send_to_embedder(EmbedderMsg::NewFavicon(self.webview_id(), image.clone())); 216 } 217 } 218 - @@ -5000,6 +5118,20 @@ 219 *self.favicon.borrow_mut() = Some(favicon); 220 self.notify_embedder_favicon(); 221 }
··· 25 use fonts::WebFontDocumentContext; 26 use html5ever::{LocalName, Namespace, QualName, local_name, ns}; 27 use hyper_serde::Serde; 28 + @@ -613,6 +616,9 @@ 29 #[ignore_malloc_size_of = "TODO: unimplemented on Image"] 30 favicon: RefCell<Option<Image>>, 31 ··· 35 /// All websockets created that are associated with this document. 36 websockets: DOMTracker<WebSocket>, 37 38 + @@ -845,6 +851,12 @@ 39 40 // Set the document's activity level, reflow if necessary, and suspend or resume timers. 41 self.activity.set(activity); ··· 48 let media = ServoMedia::get(); 49 let pipeline_id = self.window().pipeline_id(); 50 let client_context_id = 51 + @@ -858,6 +870,7 @@ 52 53 self.title_changed(); 54 self.notify_embedder_favicon(); ··· 56 self.dirty_all_nodes(); 57 self.window().resume(can_gc); 58 media.resume(&client_context_id); 59 + @@ -1262,6 +1275,9 @@ 60 LoadStatus::Started, 61 )); 62 self.send_to_embedder(EmbedderMsg::Status(self.webview_id(), None)); ··· 66 } 67 }, 68 DocumentReadyState::Complete => { 69 + @@ -1270,6 +1286,9 @@ 70 self.webview_id(), 71 LoadStatus::Complete, 72 )); ··· 76 } 77 update_with_current_instant(&self.dom_complete); 78 }, 79 + @@ -1678,7 +1697,13 @@ 80 let window = self.window(); 81 if window.is_top_level() { 82 let title = self.title().map(String::from); ··· 91 } 92 } 93 94 + @@ -1687,6 +1712,18 @@ 95 window.send_to_embedder(msg); 96 } 97 ··· 110 pub(crate) fn dirty_all_nodes(&self) { 111 let root = match self.GetDocumentElement() { 112 Some(root) => root, 113 + @@ -3172,9 +3209,59 @@ 114 current_rendering_epoch, 115 ); 116 ··· 170 pub(crate) fn handle_no_longer_waiting_on_asynchronous_image_updates(&self) { 171 self.waiting_on_canvas_image_updates.set(false); 172 } 173 + @@ -3908,6 +3995,7 @@ 174 active_sandboxing_flag_set: Cell::new(SandboxingFlagSet::empty()), 175 creation_sandboxing_flag_set: Cell::new(creation_sandboxing_flag_set), 176 favicon: RefCell::new(None), ··· 178 websockets: DOMTracker::new(), 179 details_name_groups: Default::default(), 180 protocol_handler_automation_mode: Default::default(), 181 + @@ -5007,6 +5095,36 @@ 182 183 pub(crate) fn notify_embedder_favicon(&self) { 184 if let Some(ref image) = *self.favicon.borrow() { ··· 215 self.send_to_embedder(EmbedderMsg::NewFavicon(self.webview_id(), image.clone())); 216 } 217 } 218 + @@ -5015,6 +5133,20 @@ 219 *self.favicon.borrow_mut() = Some(favicon); 220 self.notify_embedder_favicon(); 221 }
+7 -12
patches/components/script/dom/html/htmlformelement.rs.patch
··· 1 --- original 2 +++ modified 3 - @@ -857,8 +857,11 @@ 4 - 5 - // Step 19 6 let source = doc.browsing_context().unwrap(); 7 - - let (maybe_chosen, _new) = source 8 - - .choose_browsing_context(target_attribute_value.unwrap_or(DOMString::new()), noopener); 9 - + let (maybe_chosen, _new) = source.choose_browsing_context( 10 - + target_attribute_value.unwrap_or(DOMString::new()), 11 - + noopener, 12 - + None, 13 - + ); 14 15 - // Step 20 16 - let chosen = match maybe_chosen {
··· 1 --- original 2 +++ modified 3 + @@ -868,7 +868,7 @@ 4 + // form's node navigable, and noopener. 5 let source = doc.browsing_context().unwrap(); 6 + let (maybe_chosen, _new) = 7 + - source.choose_browsing_context(target.unwrap_or_default(), noopener); 8 + + source.choose_browsing_context(target.unwrap_or_default(), noopener, None); 9 10 + let Some(chosen) = maybe_chosen else { 11 + // Step 23. If targetNavigable is null, then return.
+23 -18
patches/components/script/dom/html/htmliframeelement.rs.patch
··· 69 #[dom_struct] 70 pub(crate) struct HTMLIFrameElement { 71 htmlelement: HTMLElement, 72 - @@ -93,6 +105,30 @@ 73 - /// while script at this point(when the flag is set) 74 - /// expects those to run only for the navigated documented. 75 - pending_navigation: Cell<bool>, 76 + /// Whether this iframe is in "embed" mode (hosting a top-level webview). 77 + is_embedded_webview: Cell<bool>, 78 + /// The embedded webview ID when in embed mode. ··· 100 } 101 102 impl HTMLIFrameElement { 103 - @@ -229,6 +265,8 @@ 104 viewport_details, 105 user_content_manager_id: None, 106 theme: window.theme(), ··· 109 }; 110 111 self.pipeline_id.set(Some(new_pipeline_id)); 112 - @@ -443,6 +481,143 @@ 113 ); 114 } 115 116 + /// Create an embedded webview for this iframe when the "embed" attribute is present. 117 + /// This creates a new top-level WebView instead of a nested browsing context. 118 + fn create_embedded_webview(&self) { 119 - + let url = self.get_url(); 120 + let document = self.owner_document(); 121 + let window = self.owner_window(); 122 + ··· 253 fn destroy_nested_browsing_context(&self) { 254 self.pipeline_id.set(None); 255 self.pending_pipeline_id.set(None); 256 - @@ -502,6 +677,13 @@ 257 - throttled: Cell::new(false), 258 script_window_proxies: ScriptThread::window_proxies(), 259 pending_navigation: Default::default(), 260 + is_embedded_webview: Cell::new(false), 261 + embedded_webview_id: Cell::new(None), 262 + embedded_history: DomRefCell::new(Vec::new()), ··· 267 } 268 } 269 270 - @@ -537,7 +719,150 @@ 271 self.webview_id.get() 272 } 273 ··· 353 + 354 + /// Get the effective webview ID, taking into account embedded webview mode. 355 + /// Returns the embedded webview ID if in embed mode, otherwise the parent webview ID. 356 - #[inline] 357 + pub(crate) fn embedded_webview_id(&self) -> Option<WebViewId> { 358 + if self.is_embedded_webview.get() { 359 + self.embedded_webview_id.get() ··· 414 + self.page_zoom.set(zoom); 415 + } 416 + 417 - + #[inline] 418 pub(crate) fn sandboxing_flag_set(&self) -> SandboxingFlagSet { 419 self.sandboxing_flag_set 420 - .get() 421 - @@ -871,6 +1196,85 @@ 422 // This is specified as reflecting the name content attribute of the 423 // element, not the name of the child browsing context. 424 make_getter!(Name, "name"); ··· 504 } 505 506 impl VirtualMethods for HTMLIFrameElement { 507 - @@ -922,8 +1326,34 @@ 508 // is in a document tree and has a browsing context, which is what causes 509 // the child browsing context to be created. 510 if self.upcast::<Node>().is_connected_with_browsing_context() { ··· 514 + // processing iframe attributes (which is for regular nested iframes). 515 + if self.is_embedded_webview.get() { 516 + if let Some(webview_id) = self.embedded_webview_id.get() { 517 - + let url = self.get_url(); 518 + let window = self.owner_window(); 519 + window 520 + .as_global_scope() ··· 541 } 542 }, 543 _ => {}, 544 - @@ -967,6 +1397,23 @@ 545 546 debug!("<iframe> running post connection steps"); 547 ··· 565 // Step 1. Create a new child navigable for insertedNode. 566 self.create_nested_browsing_context(can_gc); 567 568 - @@ -989,8 +1436,22 @@ 569 fn unbind_from_tree(&self, context: &UnbindContext, can_gc: CanGc) { 570 self.super_type().unwrap().unbind_from_tree(context, can_gc); 571
··· 69 #[dom_struct] 70 pub(crate) struct HTMLIFrameElement { 71 htmlelement: HTMLElement, 72 + @@ -97,6 +109,30 @@ 73 + /// an empty iframe is attached. In that case, we shouldn't fire a 74 + /// subsequent asynchronous load event. 75 + already_fired_synchronous_load_event: Cell<bool>, 76 + /// Whether this iframe is in "embed" mode (hosting a top-level webview). 77 + is_embedded_webview: Cell<bool>, 78 + /// The embedded webview ID when in embed mode. ··· 100 } 101 102 impl HTMLIFrameElement { 103 + @@ -255,6 +291,8 @@ 104 viewport_details, 105 user_content_manager_id: None, 106 theme: window.theme(), ··· 109 }; 110 111 self.pipeline_id.set(Some(new_pipeline_id)); 112 + @@ -484,6 +522,147 @@ 113 ); 114 } 115 116 + /// Create an embedded webview for this iframe when the "embed" attribute is present. 117 + /// This creates a new top-level WebView instead of a nested browsing context. 118 + fn create_embedded_webview(&self) { 119 + + let Some(url) = self.shared_attribute_processing_steps_for_iframe_and_frame_elements() 120 + + else { 121 + + error!("Can't create embedded webview without url"); 122 + + return; 123 + + }; 124 + let document = self.owner_document(); 125 + let window = self.owner_window(); 126 + ··· 257 fn destroy_nested_browsing_context(&self) { 258 self.pipeline_id.set(None); 259 self.pending_pipeline_id.set(None); 260 + @@ -544,6 +723,13 @@ 261 script_window_proxies: ScriptThread::window_proxies(), 262 pending_navigation: Default::default(), 263 + already_fired_synchronous_load_event: Default::default(), 264 + is_embedded_webview: Cell::new(false), 265 + embedded_webview_id: Cell::new(None), 266 + embedded_history: DomRefCell::new(Vec::new()), ··· 271 } 272 } 273 274 + @@ -579,6 +765,149 @@ 275 self.webview_id.get() 276 } 277 ··· 357 + 358 + /// Get the effective webview ID, taking into account embedded webview mode. 359 + /// Returns the embedded webview ID if in embed mode, otherwise the parent webview ID. 360 + + #[inline] 361 + pub(crate) fn embedded_webview_id(&self) -> Option<WebViewId> { 362 + if self.is_embedded_webview.get() { 363 + self.embedded_webview_id.get() ··· 418 + self.page_zoom.set(zoom); 419 + } 420 + 421 + #[inline] 422 pub(crate) fn sandboxing_flag_set(&self) -> SandboxingFlagSet { 423 self.sandboxing_flag_set 424 + @@ -917,6 +1246,85 @@ 425 // This is specified as reflecting the name content attribute of the 426 // element, not the name of the child browsing context. 427 make_getter!(Name, "name"); ··· 507 } 508 509 impl VirtualMethods for HTMLIFrameElement { 510 + @@ -968,8 +1376,36 @@ 511 // is in a document tree and has a browsing context, which is what causes 512 // the child browsing context to be created. 513 if self.upcast::<Node>().is_connected_with_browsing_context() { ··· 517 + // processing iframe attributes (which is for regular nested iframes). 518 + if self.is_embedded_webview.get() { 519 + if let Some(webview_id) = self.embedded_webview_id.get() { 520 + + let url = self 521 + + .shared_attribute_processing_steps_for_iframe_and_frame_elements() 522 + + .expect("Failed to get embedding iframe url"); 523 + let window = self.owner_window(); 524 + window 525 + .as_global_scope() ··· 546 } 547 }, 548 _ => {}, 549 + @@ -1013,6 +1449,23 @@ 550 551 debug!("<iframe> running post connection steps"); 552 ··· 570 // Step 1. Create a new child navigable for insertedNode. 571 self.create_nested_browsing_context(can_gc); 572 573 + @@ -1035,8 +1488,22 @@ 574 fn unbind_from_tree(&self, context: &UnbindContext, can_gc: CanGc) { 575 self.super_type().unwrap().unbind_from_tree(context, can_gc); 576
+1 -1
patches/components/script/links.rs.patch
··· 1 --- original 2 +++ modified 3 - @@ -386,7 +386,7 @@ 4 let source = document.browsing_context().unwrap(); 5 let (maybe_chosen, history_handling) = match target_attribute_value { 6 Some(name) => {
··· 1 --- original 2 +++ modified 3 + @@ -434,7 +434,7 @@ 4 let source = document.browsing_context().unwrap(); 5 let (maybe_chosen, history_handling) = match target_attribute_value { 6 Some(name) => {
+1 -1
patches/components/script_bindings/codegen/Bindings.conf.patch
··· 1 --- original 2 +++ modified 3 - @@ -253,6 +253,10 @@ 4 'canGc': ['CheckValidity', 'GetLabels', 'GetValidity', 'SetValidity', 'ReportValidity', 'States'], 5 }, 6
··· 1 --- original 2 +++ modified 3 + @@ -257,6 +257,10 @@ 4 'canGc': ['CheckValidity', 'GetLabels', 'GetValidity', 'SetValidity', 'ReportValidity', 'States'], 5 }, 6