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

LibWeb: Implement CSS fit-content algorithm precisely as spec says

We were using the available space in place of the stretch-fit size.
This was an oversight, and this patch fixes that. It's very possible
that this will uncover broken behavior elsewhere.
This commit is contained in:
Andreas Kling 2022-10-14 15:09:40 +02:00
parent d7d8e3c78b
commit 27a7c5ef40
2 changed files with 40 additions and 28 deletions

View file

@ -70,7 +70,8 @@ public:
float compute_box_y_position_with_respect_to_siblings(Box const&) const;
float calculate_stretch_fit_width(Box const&, AvailableSize const&) const;
[[nodiscard]] float calculate_stretch_fit_width(Box const&, AvailableSize const&) const;
[[nodiscard]] float calculate_stretch_fit_height(Box const&, AvailableSize const&) const;
virtual bool can_determine_size_of_child() const { return false; }
virtual void determine_width_of_child(Box const&, AvailableSpace const&) { }