mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-15 23:09:05 +00:00
LibWeb: Verify that value is not saturated in set_content_width/height
Checking if CSSPixels contains a finite value is no longer makes sense after converting to fixed-point arithmetics. Instead there should assertion that used value is not saturated.
This commit is contained in:
parent
8ee71a9920
commit
e5dcfe3905
Notes:
sideshowbarker
2024-07-17 08:38:37 +09:00
Author: https://github.com/kalenikaliaksandr
Commit: e5dcfe3905
Pull-request: https://github.com/SerenityOS/serenity/pull/20208
Reviewed-by: https://github.com/awesomekling
1 changed files with 2 additions and 2 deletions
|
@ -334,7 +334,7 @@ void LayoutState::UsedValues::set_node(NodeWithStyleAndBoxModelMetrics& node, Us
|
|||
|
||||
void LayoutState::UsedValues::set_content_width(CSSPixels width)
|
||||
{
|
||||
VERIFY(isfinite(width.to_double()));
|
||||
VERIFY(!width.might_be_saturated());
|
||||
if (width < 0) {
|
||||
// Negative widths are not allowed in CSS. We have a bug somewhere! Clamp to 0 to avoid doing too much damage.
|
||||
dbgln_if(LIBWEB_CSS_DEBUG, "FIXME: Layout calculated a negative width for {}: {}", m_node->debug_description(), width);
|
||||
|
@ -346,7 +346,7 @@ void LayoutState::UsedValues::set_content_width(CSSPixels width)
|
|||
|
||||
void LayoutState::UsedValues::set_content_height(CSSPixels height)
|
||||
{
|
||||
VERIFY(isfinite(height.to_double()));
|
||||
VERIFY(!height.might_be_saturated());
|
||||
if (height < 0) {
|
||||
// Negative heights are not allowed in CSS. We have a bug somewhere! Clamp to 0 to avoid doing too much damage.
|
||||
dbgln_if(LIBWEB_CSS_DEBUG, "FIXME: Layout calculated a negative height for {}: {}", m_node->debug_description(), height);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue