mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-28 05:07:35 +00:00
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.
This commit is contained in:
parent
d821af1f24
commit
4a1740f299
Notes:
github-actions[bot]
2025-08-03 15:34:20 +00:00
Author: https://github.com/tcl3
Commit: 4a1740f299
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5692
Reviewed-by: https://github.com/gmta ✅
1 changed files with 1 additions and 1 deletions
|
@ -547,7 +547,7 @@ EventResult EventHandler::handle_mouseup(CSSPixelPoint viewport_position, CSSPix
|
|||
} else if (button == UIEvents::MouseButton::Secondary) {
|
||||
if (is<HTML::HTMLImageElement>(*node)) {
|
||||
auto& image_element = as<HTML::HTMLImageElement>(*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<Gfx::Bitmap const*> bitmap;
|
||||
if (image_element.immutable_bitmap())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue