mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 22:28:11 +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:
parent
f2cd120fd3
commit
4bc38300ad
10 changed files with 40 additions and 17 deletions
|
@ -16,12 +16,7 @@ Size::Size(Type type, LengthPercentage length_percentage)
|
|||
|
||||
CSSPixels Size::to_px(Layout::Node const& node, CSSPixels reference_value) const
|
||||
{
|
||||
return m_length_percentage.resolved(node, CSS::Length::make_px(reference_value)).to_px(node);
|
||||
}
|
||||
|
||||
CSS::Length Size::resolved(Layout::Node const& node, Length const& reference_value) const
|
||||
{
|
||||
return m_length_percentage.resolved(node, reference_value);
|
||||
return m_length_percentage.resolved(node, reference_value).to_px(node);
|
||||
}
|
||||
|
||||
CSS::Length Size::resolved(Layout::Node const& node, CSSPixels reference_value) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue