mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibWeb/CSS: Insert whitespace between tokens in serialized UnresolvedSV
Otherwise, `margin: var(--foo) var(--bar)` would be wrongly serialized as `margin: var(--foo)var(--bar)`
This commit is contained in:
committed by
Andreas Kling
parent
bf3e6daedb
commit
6e68e8f3c9
@@ -6,3 +6,4 @@ attr(foo string)
|
|||||||
attr( foo string )
|
attr( foo string )
|
||||||
attr(foo string, "fallback")
|
attr(foo string, "fallback")
|
||||||
attr( foo string , "fallback" )
|
attr( foo string , "fallback" )
|
||||||
|
attr(foo) attr(bar) attr(baz)
|
||||||
|
|||||||
@@ -18,5 +18,6 @@
|
|||||||
serialize('attr(foo string, "fallback")');
|
serialize('attr(foo string, "fallback")');
|
||||||
// FIXME: This should produce `attr(foo string, "fallback")` but doesn't yet.
|
// FIXME: This should produce `attr(foo string, "fallback")` but doesn't yet.
|
||||||
serialize('attr( foo string , "fallback" )');
|
serialize('attr( foo string , "fallback" )');
|
||||||
|
serialize(' attr(foo) attr(bar) attr(baz) ');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -17,10 +17,7 @@ String UnresolvedStyleValue::to_string() const
|
|||||||
if (m_original_source_text.has_value())
|
if (m_original_source_text.has_value())
|
||||||
return *m_original_source_text;
|
return *m_original_source_text;
|
||||||
|
|
||||||
StringBuilder builder;
|
return MUST(String::join(' ', m_values));
|
||||||
for (auto& value : m_values)
|
|
||||||
builder.append(value.to_string());
|
|
||||||
return MUST(builder.to_string());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool UnresolvedStyleValue::equals(CSSStyleValue const& other) const
|
bool UnresolvedStyleValue::equals(CSSStyleValue const& other) const
|
||||||
|
|||||||
Reference in New Issue
Block a user