mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 15:54: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:
parent
4fb209d25f
commit
34c5043cbe
22 changed files with 57 additions and 55 deletions
|
@ -381,7 +381,7 @@ Optional<CSSPixels> HTMLObjectElement::intrinsic_height() const
|
|||
return {};
|
||||
}
|
||||
|
||||
Optional<float> HTMLObjectElement::intrinsic_aspect_ratio() const
|
||||
Optional<CSSPixelFraction> HTMLObjectElement::intrinsic_aspect_ratio() const
|
||||
{
|
||||
if (auto image_data = this->image_data())
|
||||
return image_data->intrinsic_aspect_ratio();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue