LibWeb: Put ResolvedCSSStyleDeclaration debug spam behind a macro

Blowing up the debug console with a fajillion FIXME's whenever you
navigate in the web inspector is no fun.
This commit is contained in:
Andreas Kling 2022-02-06 14:17:42 +01:00
parent 3caac65cc8
commit 5dd4b3eaaa
Notes: sideshowbarker 2024-07-17 19:43:02 +09:00
3 changed files with 9 additions and 3 deletions

View File

@ -250,6 +250,10 @@
#cmakedefine01 LEXER_DEBUG
#endif
#ifndef LIBWEB_CSS_DEBUG
#cmakedefine01 LIBWEB_CSS_DEBUG
#endif
#ifndef LINE_EDITOR_DEBUG
#cmakedefine01 LINE_EDITOR_DEBUG
#endif

View File

@ -100,6 +100,7 @@ set(KEYBOARD_SHORTCUTS_DEBUG ON)
set(KMALLOC_DEBUG ON)
set(LANGUAGE_SERVER_DEBUG ON)
set(LEXER_DEBUG ON)
set(LIBWEB_CSS_DEBUG ON)
set(LINE_EDITOR_DEBUG ON)
set(LOCAL_SOCKET_DEBUG ON)
set(LOCK_DEBUG ON)

View File

@ -1,10 +1,11 @@
/*
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2021-2022, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2021, Tobias Christiansen <tobyase@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/Debug.h>
#include <AK/NonnullRefPtr.h>
#include <LibWeb/CSS/ResolvedCSSStyleDeclaration.h>
#include <LibWeb/CSS/StyleComputer.h>
@ -698,10 +699,10 @@ RefPtr<StyleValue> ResolvedCSSStyleDeclaration::style_value_for_property(Layout:
case CSS::PropertyID::Invalid:
return IdentifierStyleValue::create(CSS::ValueID::Invalid);
case CSS::PropertyID::Custom:
dbgln("Computed style for custom properties was requested (?)");
dbgln_if(LIBWEB_CSS_DEBUG, "Computed style for custom properties was requested (?)");
return {};
default:
dbgln("FIXME: Computed style for the '{}' property was requested", string_from_property_id(property_id));
dbgln_if(LIBWEB_CSS_DEBUG, "FIXME: Computed style for the '{}' property was requested", string_from_property_id(property_id));
return {};
}
}