mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-02 17:28:48 +00:00
LibWeb: Make ImageBox ask ImageProvider for intrinsic size and ratio
This paves the way for ImageProvider to have something vector-based underneath. :^)
This commit is contained in:
parent
4ee1e5b224
commit
8d3240d633
Notes:
sideshowbarker
2024-07-17 05:00:08 +09:00
Author: https://github.com/awesomekling
Commit: 8d3240d633
Pull-request: https://github.com/SerenityOS/serenity/pull/18943
Reviewed-by: https://github.com/winfr34k
9 changed files with 71 additions and 18 deletions
|
@ -111,6 +111,27 @@ RefPtr<Gfx::Bitmap const> HTMLImageElement::bitmap() const
|
|||
return current_image_bitmap();
|
||||
}
|
||||
|
||||
Optional<CSSPixels> HTMLImageElement::intrinsic_width() const
|
||||
{
|
||||
if (auto image_data = m_current_request->image_data())
|
||||
return image_data->intrinsic_width();
|
||||
return {};
|
||||
}
|
||||
|
||||
Optional<CSSPixels> HTMLImageElement::intrinsic_height() const
|
||||
{
|
||||
if (auto image_data = m_current_request->image_data())
|
||||
return image_data->intrinsic_height();
|
||||
return {};
|
||||
}
|
||||
|
||||
Optional<float> HTMLImageElement::intrinsic_aspect_ratio() const
|
||||
{
|
||||
if (auto image_data = m_current_request->image_data())
|
||||
return image_data->intrinsic_aspect_ratio();
|
||||
return {};
|
||||
}
|
||||
|
||||
RefPtr<Gfx::Bitmap const> HTMLImageElement::current_image_bitmap() const
|
||||
{
|
||||
if (auto data = m_current_request->image_data())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue