1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 09:37:44 +00:00

LibWeb: Serialize StringStyleValue with quotes

In order to access the string's contents, use the new
`StringStyleValue::string_value()` method.

I think I found all the existing places that relied on
`StringStyleValue::to_string()` returning an unquoted string, but it's
hard to know for sure until things break.
This commit is contained in:
Sam Atkins 2023-09-12 11:33:11 +01:00 committed by Sam Atkins
parent 77ae510319
commit ff02de4ad0
5 changed files with 28 additions and 9 deletions

View file

@ -660,7 +660,7 @@ CSS::ContentData StyleProperties::content() const
StringBuilder builder;
for (auto const& item : content_style_value.content().values()) {
if (item->is_string()) {
builder.append(item->to_string());
builder.append(item->as_string().string_value());
} else {
// TODO: Implement quotes, counters, images, and other things.
}
@ -672,7 +672,7 @@ CSS::ContentData StyleProperties::content() const
StringBuilder alt_text_builder;
for (auto const& item : content_style_value.alt_text()->values()) {
if (item->is_string()) {
alt_text_builder.append(item->to_string());
alt_text_builder.append(item->as_string().string_value());
} else {
// TODO: Implement counters
}
@ -951,7 +951,7 @@ Vector<Vector<String>> StyleProperties::grid_template_areas() const
String StyleProperties::grid_area() const
{
auto value = property(CSS::PropertyID::GridArea);
return value->as_string().to_string();
return value->as_string().string_value();
}
Optional<CSS::ObjectFit> StyleProperties::object_fit() const