mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-16 04:59:23 +00:00
LibWeb: Collapse & trim whitespace when serializing UnresolvedStyleValue
This commit is contained in:
parent
a405d6df67
commit
9ee9be720c
Notes:
github-actions[bot]
2025-09-26 06:31:11 +00:00
Author: https://github.com/Calme1709
Commit: 9ee9be720c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6307
Reviewed-by: https://github.com/AtkinsSJ ✅
6 changed files with 202 additions and 9 deletions
|
@ -8,6 +8,7 @@
|
|||
#include <AK/Utf8View.h>
|
||||
#include <LibWeb/CSS/Parser/ComponentValue.h>
|
||||
#include <LibWeb/CSS/Serialize.h>
|
||||
#include <LibWeb/Infra/Strings.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
||||
|
@ -269,7 +270,7 @@ String serialize_a_series_of_component_values(ReadonlySpan<Parser::ComponentValu
|
|||
{
|
||||
// FIXME: There are special rules here where we should insert a comment between certain tokens. Do that!
|
||||
if (insert_whitespace == InsertWhitespace::Yes)
|
||||
return MUST(String::join(' ', component_values));
|
||||
return MUST(Infra::strip_and_collapse_whitespace(MUST(String::join(' ', component_values))));
|
||||
return MUST(String::join(""sv, component_values));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue