From 4a1740f2996a3896db9a8c07fbb5ee2396cd06fe Mon Sep 17 00:00:00 2001 From: Tim Ledbetter Date: Sun, 3 Aug 2025 16:03:16 +0100 Subject: [PATCH] LibWeb: Ensure image context menu uses the correct image source Previously, the value of the `src` tag would always be used as the image source URL when requesting an image context menu, which may not be correct if an image uses a `srcset` or has a parent picture tag. --- Libraries/LibWeb/Page/EventHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/LibWeb/Page/EventHandler.cpp b/Libraries/LibWeb/Page/EventHandler.cpp index 631a749e247..453a9cdd78c 100644 --- a/Libraries/LibWeb/Page/EventHandler.cpp +++ b/Libraries/LibWeb/Page/EventHandler.cpp @@ -547,7 +547,7 @@ EventResult EventHandler::handle_mouseup(CSSPixelPoint viewport_position, CSSPix } else if (button == UIEvents::MouseButton::Secondary) { if (is(*node)) { auto& image_element = as(*node); - auto image_url = image_element.document().encoding_parse_url(image_element.src()); + auto image_url = image_element.document().encoding_parse_url(image_element.current_src()); if (image_url.has_value()) { Optional bitmap; if (image_element.immutable_bitmap())