LibWeb/CSS: Move "serialize a CSS declaration" to Serialize.{h,cpp}

We need this in other places, so make it available for reuse. Also,
update step 4 which now only appends `value` if it contains
non-whitespace.
This commit is contained in:
Sam Atkins 2025-03-26 16:20:55 +00:00
commit 2b67cb5f98
Notes: github-actions[bot] 2025-03-27 11:54:13 +00:00
3 changed files with 33 additions and 51 deletions

View file

@ -12,6 +12,7 @@
#include <AK/Vector.h>
#include <LibGfx/Color.h>
#include <LibGfx/Font/UnicodeRange.h>
#include <LibWeb/CSS/StyleProperty.h>
namespace Web::CSS {
@ -44,4 +45,6 @@ void serialize_a_comma_separated_list(StringBuilder& builder, Vector<T> const& i
}
}
String serialize_a_css_declaration(StringView property, StringView value, Important = Important::No);
}