mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 19:04:58 +00:00
LibWeb: Use CSSPixelFraction to represent aspect ratios
This allows us to retain perfect precision for aspect ratios derived from either the intrinsic sizes of replaced elements, or the `aspect-ratio` CSS property.
This commit is contained in:
@@ -140,7 +140,7 @@ Optional<CSSPixels> HTMLImageElement::intrinsic_height() const
|
||||
return {};
|
||||
}
|
||||
|
||||
Optional<float> HTMLImageElement::intrinsic_aspect_ratio() const
|
||||
Optional<CSSPixelFraction> HTMLImageElement::intrinsic_aspect_ratio() const
|
||||
{
|
||||
if (auto image_data = m_current_request->image_data())
|
||||
return image_data->intrinsic_aspect_ratio();
|
||||
|
||||
Reference in New Issue
Block a user