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

LibWeb: Forbid using CSS::Length as reference value in resolved()

CSSPixels should not be wrapped into CSS::Length before being passed
to resolved() to end up resolving percentages without losing
precision.

Fixes thrashing layout when 33.3333% width is used together with
"box-sizing: border-box".
This commit is contained in:
Aliaksandr Kalenik 2024-01-07 01:09:09 +01:00 committed by Andreas Kling
parent f2cd120fd3
commit 4bc38300ad
10 changed files with 40 additions and 17 deletions

View file

@ -46,7 +46,6 @@ public:
bool is_none() const { return m_type == Type::None; }
// FIXME: This is a stopgap API that will go away once all layout code is aware of CSS::Size.
CSS::Length resolved(Layout::Node const&, Length const& reference_value) const;
CSS::Length resolved(Layout::Node const&, CSSPixels reference_value) const;
[[nodiscard]] CSSPixels to_px(Layout::Node const&, CSSPixels reference_value) const;