summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2023-05-31 11:47:26 +0200
committerAndreas Kling <kling@serenityos.org>2023-06-01 07:34:37 +0200
commitc62c71476444c7d3058abb033eba8328728a2690 (patch)
tree390a1c83adf9ec07961801696156ea321f60751e /Userland
parent827936cf7ba0e1d80a19f722dfd8d2f3e6b9631f (diff)
downloadserenity-c62c71476444c7d3058abb033eba8328728a2690.zip
LibWeb: Put debug spam about negative content sizes behind a flag
We already clamp these values to zero, so it's actually pretty harmless when this happens. If someone wants to investigate these issues deeper and see if they can be fixed earlier in the layout pipeline, they can enable the spam locally.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibWeb/Layout/LayoutState.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/LayoutState.cpp b/Userland/Libraries/LibWeb/Layout/LayoutState.cpp
index 83375389a5..1cb6c6b770 100644
--- a/Userland/Libraries/LibWeb/Layout/LayoutState.cpp
+++ b/Userland/Libraries/LibWeb/Layout/LayoutState.cpp
@@ -1,9 +1,10 @@
/*
- * Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
+ * Copyright (c) 2022-2023, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
+#include <AK/Debug.h>
#include <LibWeb/Layout/AvailableSpace.h>
#include <LibWeb/Layout/BlockContainer.h>
#include <LibWeb/Layout/LayoutState.h>
@@ -242,7 +243,7 @@ void LayoutState::UsedValues::set_content_width(CSSPixels width)
{
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("FIXME: Layout calculated a negative width for {}: {}", m_node->debug_description(), width);
+ dbgln_if(LIBWEB_CSS_DEBUG, "FIXME: Layout calculated a negative width for {}: {}", m_node->debug_description(), width);
width = 0;
}
m_content_width = width;
@@ -253,7 +254,7 @@ void LayoutState::UsedValues::set_content_height(CSSPixels height)
{
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("FIXME: Layout calculated a negative height for {}: {}", m_node->debug_description(), height);
+ dbgln_if(LIBWEB_CSS_DEBUG, "FIXME: Layout calculated a negative height for {}: {}", m_node->debug_description(), height);
height = 0;
}
m_content_height = height;