1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 00:27:43 +00:00

LibWeb: Use CSS::Size for computed size and max-size values

This patch changes the *computed* representation of the following CSS
properties to use CSS::Size:

- width, min-width, max-width
- height, min-height, max-height

A few things had to change in order for things to keep working,
but I tried to keep the diff to a minimum.

The main trouble was that `min-width` and `max-width` can't actually be
`auto`, but they *can* be `none`. We previously treated `auto` as a
valid value (and it behaved mostly like `none`).
This commit is contained in:
Andreas Kling 2022-09-25 15:48:23 +02:00
parent 844321d89f
commit 0843960235
9 changed files with 144 additions and 109 deletions

View file

@ -107,15 +107,15 @@ private:
Optional<float> specified_size_suggestion(FlexItem const&) const;
Optional<float> transferred_size_suggestion(FlexItem const&) const;
float content_size_suggestion(FlexItem const&) const;
CSS::LengthPercentage const& computed_main_size(Box const&) const;
CSS::LengthPercentage const& computed_main_min_size(Box const&) const;
CSS::LengthPercentage const& computed_main_max_size(Box const&) const;
CSS::LengthPercentage const& computed_cross_size(Box const&) const;
CSS::LengthPercentage const& computed_cross_min_size(Box const&) const;
CSS::LengthPercentage const& computed_cross_max_size(Box const&) const;
CSS::Size const& computed_main_size(Box const&) const;
CSS::Size const& computed_main_min_size(Box const&) const;
CSS::Size const& computed_main_max_size(Box const&) const;
CSS::Size const& computed_cross_size(Box const&) const;
CSS::Size const& computed_cross_min_size(Box const&) const;
CSS::Size const& computed_cross_max_size(Box const&) const;
float get_pixel_width(Box const& box, Optional<CSS::LengthPercentage> const& length_percentage) const;
float get_pixel_height(Box const& box, Optional<CSS::LengthPercentage> const& length_percentage) const;
float get_pixel_width(Box const& box, Optional<CSS::Size> const& length_percentage) const;
float get_pixel_height(Box const& box, Optional<CSS::Size> const& length_percentage) const;
bool flex_item_is_stretched(FlexItem const&) const;