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

LibWeb: Replace to_px() with to_px_or_zero() in InlineFormattingContext

to_px() usage should be avoided because it might leak saturated
(infinite) values into layout calculations.
This commit is contained in:
Aliaksandr Kalenik 2023-08-12 18:30:18 +02:00 committed by Andreas Kling
parent 4646867a9f
commit fce4801460
7 changed files with 29 additions and 21 deletions

View file

@ -37,7 +37,7 @@ public:
return false;
}
CSSPixels available_width_for_current_line() const { return m_available_width_for_current_line; }
AvailableSize available_width_for_current_line() const { return m_available_width_for_current_line; }
void update_last_line();
@ -61,7 +61,7 @@ private:
InlineFormattingContext& m_context;
LayoutState& m_layout_state;
LayoutState::UsedValues& m_containing_block_state;
CSSPixels m_available_width_for_current_line { 0 };
AvailableSize m_available_width_for_current_line { AvailableSize::make_indefinite() };
CSSPixels m_current_y { 0 };
CSSPixels m_max_height_on_current_line { 0 };
CSSPixels m_text_indent { 0 };