1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02: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

@ -86,8 +86,8 @@ protected:
float preferred_minimum_width { 0 };
};
static float tentative_width_for_replaced_element(LayoutState const&, ReplacedBox const&, CSS::LengthPercentage const& computed_width);
static float tentative_height_for_replaced_element(LayoutState const&, ReplacedBox const&, CSS::LengthPercentage const& computed_height);
static float tentative_width_for_replaced_element(LayoutState const&, ReplacedBox const&, CSS::Size const& computed_width);
static float tentative_height_for_replaced_element(LayoutState const&, ReplacedBox const&, CSS::Size const& computed_height);
static float compute_auto_height_for_block_formatting_context_root(LayoutState const&, BlockContainer const&);
static float compute_auto_height_for_block_level_element(LayoutState const&, Box const&);