Fix type mismatches in Router::add_route calls (#33882)

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
Simon Wülker 2024-10-17 15:09:48 +02:00 committed by GitHub
parent 595aab10dc
commit 4a58616770
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -1084,14 +1084,14 @@ impl HTMLImageElement {
// Return the image via a message to the script thread, which marks // Return the image via a message to the script thread, which marks
// the element as dirty and triggers a reflow. // the element as dirty and triggers a reflow.
let element = trusted_node.clone(); let element = trusted_node.clone();
let image = message.to().unwrap(); let image: PendingImageResponse = message.to().unwrap();
let selected_source_clone = selected_source.clone(); let selected_source_clone = selected_source.clone();
let _ = task_source.queue_with_canceller( let _ = task_source.queue_with_canceller(
task!(process_image_response_for_environment_change: move || { task!(process_image_response_for_environment_change: move || {
let element = element.root(); let element = element.root();
// Ignore any image response for a previous request that has been discarded. // Ignore any image response for a previous request that has been discarded.
if generation == element.generation.get() { if generation == element.generation.get() {
element.process_image_response_for_environment_change(image, element.process_image_response_for_environment_change(image.response,
USVString::from(selected_source_clone), generation, USVString::from(selected_source_clone), generation,
selected_pixel_density, can_gc); selected_pixel_density, can_gc);
} }

View file

@ -36,14 +36,14 @@ pub fn generate_cache_listener_for_element<
responder_receiver.to_opaque(), responder_receiver.to_opaque(),
Box::new(move |message| { Box::new(move |message| {
let element = trusted_node.clone(); let element = trusted_node.clone();
let image = message.to().unwrap(); let image: PendingImageResponse = message.to().unwrap();
debug!("Got image {:?}", image); debug!("Got image {:?}", image);
let _ = task_source.queue_with_canceller( let _ = task_source.queue_with_canceller(
task!(process_image_response: move || { task!(process_image_response: move || {
let element = element.root(); let element = element.root();
// Ignore any image response for a previous request that has been discarded. // Ignore any image response for a previous request that has been discarded.
if generation == element.generation_id() { if generation == element.generation_id() {
element.process_image_response(image, CanGc::note()); element.process_image_response(image.response, CanGc::note());
} }
}), }),
&canceller, &canceller,