mirror of
https://github.com/servo/servo
synced 2026-04-26 01:25:32 +02:00
libservo: Add ContextMenuElementInformation to for the context menu API (#40607)
This new data structure allows passing more information when popping up context menus. It's possible in the future that it will be adapted into a more generic "hit test result" type API ala WebKit, but for now, this is probably enough. Testing: This change includes new API test assertions. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
@@ -1439,6 +1439,15 @@ impl HTMLImageElement {
|
||||
self.current_request.borrow_mut().image = Some(Image::Raster(broken_image_icon));
|
||||
self.upcast::<Node>().dirty(NodeDamage::Other);
|
||||
}
|
||||
|
||||
/// Get the full URL of the current image of this `<img>` element, returning `None` if the URL
|
||||
/// could not be joined with the `Document` URL.
|
||||
pub(crate) fn full_image_url_for_user_interface(&self) -> Option<ServoUrl> {
|
||||
self.owner_document()
|
||||
.base_url()
|
||||
.join(&self.CurrentSrc())
|
||||
.ok()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(JSTraceable, MallocSizeOf)]
|
||||
|
||||
Reference in New Issue
Block a user