Rewild Your Web

Apply clippy recommendations

Signed-off-by: webbeef <me@webbeef.org>

+134 -132
+13 -15
crates/beaver_p2p/src/lib.rs
··· 6 6 mod pairing_protocol; 7 7 mod state; 8 8 9 - use iroh::SecretKey; 10 - use packet::PostcardPacket; 11 9 use std::sync::Arc; 12 - use tokio::task::AbortHandle; 10 + use std::sync::mpsc::Sender; 13 11 14 - use crate::packet::BasePacket; 15 12 use iroh::address_lookup::UserData; 16 13 use iroh::address_lookup::mdns::MdnsAddressLookup; 17 14 use iroh::endpoint::{ClosedStream, ConnectError, ConnectionError, WriteError}; 18 - use iroh::{Endpoint, EndpointId, RelayMode, protocol::Router}; 15 + use iroh::protocol::Router; 16 + use iroh::{Endpoint, EndpointId, RelayMode, SecretKey}; 19 17 use log::{error, info}; 20 18 use n0_future::StreamExt; 21 - use std::sync::mpsc::Sender; 19 + use packet::PostcardPacket; 22 20 use thiserror::Error; 23 21 use tokio::sync::Mutex; 22 + use tokio::task::AbortHandle; 24 23 24 + use crate::packet::BasePacket; 25 25 use crate::pairing_hook::{MESSAGE_ALPN, PAIRING_ALPN}; 26 - pub use crate::state::EndpointStatus; 27 - pub use crate::state::PeerEvent; 28 26 use crate::state::{EndpointDescription, PairingCommand, SharedState, State}; 27 + pub use crate::state::{EndpointStatus, PeerEvent}; 29 28 30 29 #[derive(Debug, Error)] 31 30 pub enum PairingError { ··· 175 174 PairingCommand::Request => { 176 175 error!("Unexpected Request in response to a pairing request"); 177 176 return Err(PairingError::InvalidState); 178 - } 177 + }, 179 178 PairingCommand::Ack => { 180 179 error!("Unexpected Ack in response to a pairing request"); 181 180 return Err(PairingError::InvalidState); 182 - } 181 + }, 183 182 }; 184 183 185 184 // Send Ack ··· 255 254 .await; 256 255 println!("accept_pairing ok 3"); 257 256 let mut state = inner.state.lock().await; 258 - let res = res.map(|_| { 257 + res.map(|_| { 259 258 // Add the endpoint to the set of pending acks if successfully sending. 260 259 state.set_pending_ack(from); 261 - }); 262 - res 260 + }) 263 261 } 264 262 265 263 // Reject a pairing request ··· 333 331 .lock() 334 332 .await 335 333 .notify(PeerEvent::Message(remote_id, payload)); 336 - } 334 + }, 337 335 Err(err) => { 338 336 error!("Error reading message packet: {err}"); 339 337 break; 340 - } 338 + }, 341 339 } 342 340 } 343 341 });
+11 -10
crates/beaver_p2p/src/main.rs
··· 1 + use std::sync::mpsc::channel; 2 + 3 + use beaver_p2p::{PairingManager, PeerEvent}; 1 4 use iroh::address_lookup::DiscoveryEvent; 2 5 use log::info; 3 - use beaver_p2p::{PairingManager, PeerEvent}; 4 - use std::sync::mpsc::channel; 5 6 6 7 #[tokio::main] 7 8 async fn main() { ··· 30 31 if start_pairing { 31 32 let _ = manager.request_pairing(&endpoint_info.endpoint_id).await; 32 33 } 33 - } 34 + }, 34 35 PeerEvent::Discovery(DiscoveryEvent::Expired { endpoint_id }) => { 35 36 info!("MDNS expired: {endpoint_id}"); 36 - } 37 + }, 37 38 PeerEvent::PairingRequest(endpoint_id) => { 38 39 info!("Accepting pairing request from {endpoint_id}"); 39 40 manager 40 41 .accept_pairing(&endpoint_id) 41 42 .await 42 43 .expect("Failed to accept"); 43 - } 44 + }, 44 45 PeerEvent::PairingAccepted(endpoint_id) => { 45 46 info!("Pairing accepted from {endpoint_id}"); 46 - } 47 + }, 47 48 PeerEvent::PairingRejected(endpoint_id) => { 48 49 info!("Pairing rejected from {endpoint_id}"); 49 - } 50 + }, 50 51 PeerEvent::PairingFailed(endpoint_id) => { 51 52 info!("Pairing failed with {endpoint_id}"); 52 - } 53 + }, 53 54 PeerEvent::Message(endpoint_id, payload) => { 54 55 info!("Message of {} bytes from {}", payload.len(), endpoint_id); 55 - } 56 + }, 56 57 }, 57 58 Err(err) => { 58 59 println!("Channel closed: {err}"); 59 60 break; 60 - } 61 + }, 61 62 } 62 63 } 63 64 }
+7 -7
crates/beaver_p2p/src/message_protocol.rs
··· 1 1 /* SPDX Id: AGPL-3.0-or-later */ 2 2 3 - use iroh::{ 4 - endpoint::Connection, 5 - protocol::{AcceptError, ProtocolHandler}, 6 - }; 3 + use iroh::endpoint::Connection; 4 + use iroh::protocol::{AcceptError, ProtocolHandler}; 7 5 use log::{error, info}; 8 6 9 - use crate::{PeerEvent, packet::BasePacket, state::SharedState}; 7 + use crate::PeerEvent; 8 + use crate::packet::BasePacket; 9 + use crate::state::SharedState; 10 10 11 11 #[derive(Debug)] 12 12 pub(crate) struct MessageProtocol { ··· 48 48 .lock() 49 49 .await 50 50 .notify(PeerEvent::Message(remote_id, payload)); 51 - } 51 + }, 52 52 Err(err) => { 53 53 error!("Error reading message packet: {err}"); 54 54 break; 55 - } 55 + }, 56 56 } 57 57 } 58 58
+3 -4
crates/beaver_p2p/src/pairing_hook.rs
··· 3 3 use iroh::endpoint::{AfterHandshakeOutcome, ConnectionInfo, EndpointHooks, Side}; 4 4 use log::info; 5 5 6 - use crate::state::EndpointStatus; 7 - use crate::state::SharedState; 6 + use crate::state::{EndpointStatus, SharedState}; 8 7 9 8 pub(crate) static PAIRING_ALPN: &[u8] = b"beaver-web/pairing/1"; 10 9 pub(crate) static MESSAGE_ALPN: &[u8] = b"beaver-web/message/1"; ··· 40 39 ); 41 40 42 41 // For message protocol, only allow PairedConnected endpoints. 43 - if conn.alpn() == MESSAGE_ALPN 44 - && !self 42 + if conn.alpn() == MESSAGE_ALPN && 43 + !self 45 44 .state 46 45 .lock() 47 46 .await
+4 -5
crates/beaver_p2p/src/pairing_protocol.rs
··· 6 6 use iroh::endpoint::Connection; 7 7 use iroh::protocol::{AcceptError, ProtocolHandler}; 8 8 use log::{error, info}; 9 - 10 9 use tokio::sync::mpsc::channel as tokio_channel; 11 10 12 11 use crate::packet::PostcardPacket; ··· 76 75 .lock() 77 76 .await 78 77 .notify(PeerEvent::PairingRequest(remote_id)); 79 - } 78 + }, 80 79 _ => { 81 80 error!("Unexpected command: {command:?}"); 82 81 return Err(AcceptError::from(n0_error::AnyError::from(format!( 83 82 "Unexpected command: {command:?}" 84 83 )))); 85 - } 84 + }, 86 85 } 87 86 88 87 let (tokio_sender, mut tokio_receiver) = tokio_channel(2); ··· 121 120 } 122 121 } 123 122 let _ = ack_sender.send(true).await; 124 - } 123 + }, 125 124 _ => { 126 125 self.state 127 126 .lock() ··· 132 131 return Err(AcceptError::from(n0_error::AnyError::from(format!( 133 132 "Unexpected command: {command:?}" 134 133 )))); 135 - } 134 + }, 136 135 } 137 136 138 137 Ok(())
+10 -11
crates/beaver_p2p/src/state.rs
··· 1 1 /* SPDX Id: AGPL-3.0-or-later */ 2 2 3 - use std::{ 4 - collections::{HashMap, HashSet}, 5 - sync::Arc, 6 - }; 3 + use std::collections::{HashMap, HashSet}; 4 + use std::sync::Arc; 5 + use std::sync::mpsc::Sender; 7 6 8 - use iroh::{EndpointAddr, EndpointId, address_lookup::DiscoveryEvent, endpoint::SendStream}; 9 - 7 + use iroh::address_lookup::DiscoveryEvent; 8 + use iroh::endpoint::SendStream; 9 + use iroh::{EndpointAddr, EndpointId}; 10 10 use log::{info, warn}; 11 11 use serde::{Deserialize, Serialize}; 12 - use std::sync::mpsc::Sender; 13 12 use tokio::sync::Mutex; 14 13 use tokio::sync::mpsc::{Receiver as TokioReceiver, Sender as TokioSender}; 15 14 ··· 52 51 } 53 52 54 53 pub(crate) fn is_paired(&self) -> bool { 55 - self.status == EndpointStatus::PairedConnected 56 - || self.status == EndpointStatus::PairedDisconnected 54 + self.status == EndpointStatus::PairedConnected || 55 + self.status == EndpointStatus::PairedDisconnected 57 56 } 58 57 } 59 58 ··· 241 240 self.endpoints 242 241 .insert(endpoint_info.endpoint_id, description); 243 242 self.notify(PeerEvent::Discovery(event.clone())); 244 - } 243 + }, 245 244 DiscoveryEvent::Expired { endpoint_id } => { 246 245 // PairedConnected -> PairedDisconnected 247 246 // Discovered -> removed ··· 257 256 } 258 257 self.notify(PeerEvent::Discovery(event.clone())); 259 258 } 260 - } 259 + }, 261 260 } 262 261 } 263 262 }
+50 -48
crates/beaver_p2p/tests/pairing.rs
··· 1 - use iroh::{EndpointId, address_lookup::DiscoveryEvent}; 2 - use p2p_beaver::{EndpointStatus, MessageError, PairingError, PairingManager, PeerEvent}; 3 - use parking_lot::Mutex; 4 1 use std::sync::Arc; 5 2 use std::sync::mpsc::{Receiver, channel}; 3 + 4 + use iroh::EndpointId; 5 + use iroh::address_lookup::DiscoveryEvent; 6 + use p2p_beaver::{EndpointStatus, MessageError, PairingError, PairingManager, PeerEvent}; 7 + use parking_lot::Mutex; 6 8 7 9 type PairingReceiver = Receiver<PeerEvent>; 8 10 ··· 29 31 Ok(event) => match event { 30 32 PeerEvent::Discovery(DiscoveryEvent::Discovered { endpoint_info, .. }) => { 31 33 return endpoint_info.endpoint_id; 32 - } 33 - _ => {} 34 + }, 35 + _ => {}, 34 36 }, 35 37 Err(err) => { 36 38 panic!("Should not error! {err:?}"); 37 - } 39 + }, 38 40 } 39 41 } 40 42 }); ··· 45 47 Ok(event) => match event { 46 48 PeerEvent::Discovery(DiscoveryEvent::Discovered { endpoint_info, .. }) => { 47 49 return endpoint_info.endpoint_id; 48 - } 49 - _ => {} 50 + }, 51 + _ => {}, 50 52 }, 51 53 Err(err) => { 52 54 panic!("Should not error! {err:?}"); 53 - } 55 + }, 54 56 } 55 57 } 56 58 }); ··· 65 67 macro_rules! assert_pairing { 66 68 ($observed:expr, $expected:pat) => { 67 69 match $observed.err().unwrap() { 68 - $expected => {} 70 + $expected => {}, 69 71 _ => panic!("expected: {{$expected}} but got {{$observed}}"), 70 72 } 71 73 }; ··· 85 87 let endpoint_name = format!("{}", endpoint_info.user_data().unwrap()); 86 88 assert_eq!(endpoint_name, "test-2"); 87 89 break; 88 - } 89 - _ => {} 90 + }, 91 + _ => {}, 90 92 }, 91 93 Err(_err) => { 92 94 break; 93 - } 95 + }, 94 96 } 95 97 } 96 98 }); ··· 103 105 let endpoint_name = format!("{}", endpoint_info.user_data().unwrap()); 104 106 assert_eq!(endpoint_name, "test-1"); 105 107 break; 106 - } 107 - _ => {} 108 + }, 109 + _ => {}, 108 110 }, 109 111 Err(_err) => { 110 112 break; 111 - } 113 + }, 112 114 } 113 115 } 114 116 }); ··· 145 147 }) => { 146 148 let endpoint_name = format!("{}", endpoint_info.user_data().unwrap()); 147 149 assert_eq!(endpoint_name, "test-2"); 148 - } 150 + }, 149 151 PeerEvent::Discovery(DiscoveryEvent::Expired { endpoint_id }) => { 150 152 assert_eq!(endpoint_id, endpoint2); 151 153 break; 152 - } 153 - _ => {} 154 + }, 155 + _ => {}, 154 156 } 155 - } 157 + }, 156 158 Err(_err) => { 157 159 break; 158 - } 160 + }, 159 161 } 160 162 } 161 163 }); ··· 191 193 PeerEvent::PairingRejected(endpoint) => { 192 194 assert_eq!(endpoint, endpoint1); 193 195 break; 194 - } 195 - _ => {} 196 + }, 197 + _ => {}, 196 198 } 197 - } 199 + }, 198 200 Err(_err) => { 199 201 break; 200 - } 202 + }, 201 203 } 202 204 } 203 205 }); ··· 222 224 .await 223 225 .expect("failed to reject pairing"); 224 226 }); 225 - } 227 + }, 226 228 PeerEvent::PairingRejected(endpoint) => { 227 229 assert_eq!(endpoint, endpoint2); 228 230 break; 229 - } 230 - _ => {} 231 + }, 232 + _ => {}, 231 233 } 232 - } 234 + }, 233 235 Err(_err) => { 234 236 break; 235 - } 237 + }, 236 238 } 237 239 } 238 240 }); ··· 271 273 PeerEvent::PairingAccepted(endpoint) => { 272 274 assert_eq!(endpoint, endpoint1); 273 275 break; 274 - } 275 - _ => {} 276 + }, 277 + _ => {}, 276 278 } 277 - } 279 + }, 278 280 Err(_err) => { 279 281 break; 280 - } 282 + }, 281 283 } 282 284 } 283 285 }); ··· 302 304 .await 303 305 .expect("failed to accept pairing"); 304 306 }); 305 - } 307 + }, 306 308 PeerEvent::PairingAccepted(endpoint) => { 307 309 assert_eq!(endpoint, endpoint2); 308 310 break; 309 - } 310 - _ => {} 311 + }, 312 + _ => {}, 311 313 } 312 - } 314 + }, 313 315 Err(_err) => { 314 316 break; 315 - } 317 + }, 316 318 } 317 319 } 318 320 }); ··· 349 351 let result = manager1.send_message(&endpoint1, b"Hello").await; 350 352 assert!(result.is_err()); 351 353 match result { 352 - Err(MessageError::Unpaired) => {} 354 + Err(MessageError::Unpaired) => {}, 353 355 _ => panic!("Unexpected error: {result:?}"), 354 356 } 355 357 ··· 389 391 assert_eq!(endpoint, endpoint1); 390 392 assert_eq!(data, b"World"); 391 393 break; 392 - } 393 - _ => {} 394 + }, 395 + _ => {}, 394 396 } 395 - } 397 + }, 396 398 Err(_err) => { 397 399 break; 398 - } 400 + }, 399 401 } 400 402 } 401 403 }); ··· 421 423 }); 422 424 423 425 break; 424 - } 425 - _ => {} 426 + }, 427 + _ => {}, 426 428 } 427 - } 429 + }, 428 430 Err(_err) => { 429 431 break; 430 - } 432 + }, 431 433 } 432 434 } 433 435 });
+3 -6
crates/beaver_shell/src/main.rs
··· 351 351 } 352 352 353 353 fn window_if_system_webview(&self, webview: &WebView) -> Option<Rc<BrowserWindow>> { 354 - let Some(ref window) = self.window_for_webview_id(webview.id()) else { 355 - return None; 356 - }; 354 + let binding = self.window_for_webview_id(webview.id()); 355 + let window = binding.as_ref()?; 357 356 358 - let Some(system_webview_id) = window.system_webview_id.get() else { 359 - return None; 360 - }; 357 + let system_webview_id = window.system_webview_id.get()?; 361 358 362 359 if webview.id() != system_webview_id { 363 360 return None;
+1 -1
patches/components/constellation/constellation.rs.patch
··· 334 334 + ScriptToConstellationMessage::EmbeddedWebViewSetPageZoom(embedded_webview_id, zoom) => { 335 335 + // Validate this is a known embedded webview 336 336 + let ctx_id = BrowsingContextId::from(embedded_webview_id); 337 - + if self.browsing_contexts.get(&ctx_id).is_none() { 337 + + if !self.browsing_contexts.contains_key(&ctx_id) { 338 338 + return warn!( 339 339 + "EmbeddedWebViewSetPageZoom for unknown browsing context {:?}", 340 340 + embedded_webview_id
+1 -2
patches/components/constellation/pairing.rs.patch
··· 1 1 --- original 2 2 +++ modified 3 - @@ -0,0 +1,256 @@ 3 + @@ -0,0 +1,255 @@ 4 4 +// SPDX-License-Identifier: AGPL-3.0-or-later 5 5 + 6 6 +//! P2P pairing service integration with the constellation. ··· 15 15 +use base::generic_channel::GenericCallback; 16 16 +use beaver_p2p::{EndpointStatus, PairingManager, PeerEvent}; 17 17 +use constellation_traits::{LocalPeerInfo, PairingEvent, PeerInfo, PeerStatus}; 18 - +use crossbeam_channel; 19 18 +use iroh::address_lookup::DiscoveryEvent; 20 19 +use log::{info, warn}; 21 20 +use tokio::sync::Mutex;
+1 -1
patches/components/layout/display_list/mod.rs.patch
··· 138 138 + 139 139 + let root_scroll_spatial_id = self.wr().define_scroll_frame( 140 140 + zoom_spatial_id, 141 - + ExternalScrollId(0, pipeline_id.into()), 141 + + ExternalScrollId(0, pipeline_id), 142 142 + content_rect, 143 143 + clip_rect, 144 144 + LayoutVector2D::zero(), /* external_scroll_offset */
+24 -16
patches/components/paint/webview_renderer.rs.patch
··· 64 64 /// Returns the [`PipelineDetails`] for the given [`PipelineId`], creating it if needed. 65 65 pub(crate) fn ensure_pipeline_details( 66 66 &mut self, 67 - @@ -364,10 +391,9 @@ 67 + @@ -359,16 +386,14 @@ 68 + .map(|point| point.as_device_point(self.device_pixels_per_page_pixel())); 69 + let hit_test_result = match event_point { 70 + Some(point) => { 71 + - let hit_test_result = match event.event { 72 + + // Even if WebRender hit test returns empty, we still send the event to 73 + + // the script thread for DOM hit testing. The script thread will use the 74 + + // original event point for DOM hit testing when hit_test_result is None. 75 + + match event.event { 76 + InputEvent::Touch(_) => self.touch_handler.get_hit_test_result_cache_value(), 68 77 _ => None, 69 78 } 70 - .or_else(|| self.hit_test(render_api, point).into_iter().nth(0)); 79 + - .or_else(|| self.hit_test(render_api, point).into_iter().nth(0)); 71 80 - if hit_test_result.is_none() { 72 81 - warn!("Empty hit test result for input event, ignoring."); 73 82 - return false; 74 83 - } 75 - + // Even if WebRender hit test returns empty, we still send the event to 76 - + // the script thread for DOM hit testing. The script thread will use the 77 - + // original event point for DOM hit testing when hit_test_result is None. 78 - hit_test_result 84 + - hit_test_result 85 + + .or_else(|| self.hit_test(render_api, point).into_iter().nth(0)) 79 86 }, 80 87 None => None, 81 - @@ -699,6 +725,88 @@ 88 + }; 89 + @@ -699,6 +724,88 @@ 82 90 self.on_scroll_window_event(scroll, point); 83 91 } 84 92 ··· 167 175 fn on_scroll_window_event(&mut self, scroll: Scroll, cursor: DevicePoint) { 168 176 self.pending_scroll_zoom_events 169 177 .push(ScrollZoomEvent::Scroll(ScrollEvent { 170 - @@ -708,18 +816,25 @@ 178 + @@ -708,18 +815,25 @@ 171 179 })); 172 180 } 173 181 ··· 198 206 } 199 207 200 208 // Batch up all scroll events and changes to pinch zoom into a single change, or 201 - @@ -773,15 +888,24 @@ 209 + @@ -773,15 +887,24 @@ 202 210 } 203 211 } 204 212 ··· 229 237 230 238 let scroll_result = combined_scroll_event.and_then(|combined_event| { 231 239 self.scroll_node_at_device_point( 232 - @@ -790,6 +914,21 @@ 240 + @@ -790,6 +913,21 @@ 233 241 combined_event.scroll, 234 242 ) 235 243 }); ··· 251 259 if let Some(ref scroll_result) = scroll_result { 252 260 self.send_scroll_positions_to_layout_for_pipeline( 253 261 scroll_result.hit_test_result.pipeline_id, 254 - @@ -805,7 +944,11 @@ 262 + @@ -805,7 +943,11 @@ 255 263 self.send_pinch_zoom_infos_to_script(); 256 264 } 257 265 ··· 264 272 } 265 273 266 274 /// Perform a hit test at the given [`DevicePoint`] and apply the [`Scroll`] 267 - @@ -812,7 +955,7 @@ 275 + @@ -812,7 +954,7 @@ 268 276 /// scrolling to the applicable scroll node under that point. If a scroll was 269 277 /// performed, returns the hit test result contains [`PipelineId`] of the node 270 278 /// scrolled, the id, and the final scroll delta. ··· 273 281 &mut self, 274 282 render_api: &RenderApi, 275 283 cursor: DevicePoint, 276 - @@ -840,7 +983,10 @@ 284 + @@ -840,7 +982,10 @@ 277 285 // its ancestor pipelines. 278 286 let mut previous_pipeline_id = None; 279 287 for hit_test_result in hit_test_results { ··· 285 293 if previous_pipeline_id.replace(hit_test_result.pipeline_id) != 286 294 Some(hit_test_result.pipeline_id) 287 295 { 288 - @@ -867,7 +1013,11 @@ 296 + @@ -867,7 +1012,11 @@ 289 297 } 290 298 } 291 299 } ··· 298 306 } 299 307 300 308 /// Scroll the viewport (root pipeline, root scroll node) of this WebView, but first 301 - @@ -1006,20 +1156,45 @@ 309 + @@ -1006,20 +1155,45 @@ 302 310 } 303 311 304 312 fn send_window_size_message(&self) { ··· 356 364 } 357 365 358 366 /// Set the `hidpi_scale_factor` for this renderer, returning `true` if the value actually changed. 359 - @@ -1085,8 +1260,21 @@ 367 + @@ -1085,8 +1259,21 @@ 360 368 if let Some(wheel_event) = self.pending_wheel_events.remove(&id) { 361 369 if !result.contains(InputEventResult::DefaultPrevented) { 362 370 // A scroll delta for a wheel event is the inverse of the wheel delta.
+4 -4
patches/components/script/dom/document_event_handler.rs.patch
··· 182 182 + 183 183 + // Convert iframe position from document coords to viewport coords by subtracting scroll offset. 184 184 + let scroll_offset = self.window.scroll_offset(); 185 - + let iframe_viewport_x = iframe_border_box.origin.x.to_f32_px() - scroll_offset.x as f32; 186 - + let iframe_viewport_y = iframe_border_box.origin.y.to_f32_px() - scroll_offset.y as f32; 185 + + let iframe_viewport_x = iframe_border_box.origin.x.to_f32_px() - scroll_offset.x; 186 + + let iframe_viewport_y = iframe_border_box.origin.y.to_f32_px() - scroll_offset.y; 187 187 + 188 188 + // Get device pixel ratio for converting between CSS and device pixels 189 189 + let device_pixel_ratio = self.window.device_pixel_ratio().get(); ··· 300 300 + 301 301 + // Convert iframe position from document coords to viewport coords 302 302 + let scroll_offset = self.window.scroll_offset(); 303 - + let iframe_viewport_x = iframe_border_box.origin.x.to_f32_px() - scroll_offset.x as f32; 304 - + let iframe_viewport_y = iframe_border_box.origin.y.to_f32_px() - scroll_offset.y as f32; 303 + + let iframe_viewport_x = iframe_border_box.origin.x.to_f32_px() - scroll_offset.x; 304 + + let iframe_viewport_y = iframe_border_box.origin.y.to_f32_px() - scroll_offset.y; 305 305 + 306 306 + // Get device pixel ratio for coordinate conversion 307 307 + let device_pixel_ratio = self.window.device_pixel_ratio().get();
+1 -1
patches/components/script/dom/pairingpeerevent.rs.patch
··· 79 79 + init: &PairingPeerEventInit, 80 80 + ) -> Fallible<DomRoot<PairingPeerEvent>> { 81 81 + Ok(PairingPeerEvent::new_with_proto( 82 - + &window.upcast::<GlobalScope>(), 82 + + window.upcast::<GlobalScope>(), 83 83 + proto, 84 84 + Atom::from(type_), 85 85 + init.parent.bubbles,
+1 -1
patches/components/script/dom/window.rs.patch
··· 129 129 + // Verify the node belongs to this window's document 130 130 + let node_doc = node.owner_doc(); 131 131 + let our_doc = self.Document(); 132 - + if &*node_doc != &*our_doc { 132 + + if *node_doc != *our_doc { 133 133 + warn!( 134 134 + "hit_test_from_point_in_viewport: node {:?} belongs to different document! \ 135 135 + Node doc URL: {:?}, Our doc URL: {:?}",