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

LibWeb: Treat percentage width/height as "auto" more consistently in BFC

Since we can't resolve percentage sizes against an indefinitely-sized
containing block, treat the sizes as "auto" in all these cases.
This commit is contained in:
Andreas Kling 2022-09-13 10:47:44 +02:00
parent 71ca857b67
commit 54e0e85581
2 changed files with 45 additions and 14 deletions

View file

@ -49,6 +49,19 @@ public:
void layout_block_level_box(Box const&, BlockContainer const&, LayoutMode, float& bottom_of_lowest_margin_box);
static bool should_treat_width_as_auto(Box const&, LayoutState const&);
static bool should_treat_height_as_auto(Box const&, LayoutState const&);
bool should_treat_width_as_auto(Box const& box) const
{
return should_treat_width_as_auto(box, m_state);
}
bool should_treat_height_as_auto(Box const& box) const
{
return should_treat_height_as_auto(box, m_state);
}
private:
virtual bool is_block_formatting_context() const final { return true; }