mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 09:45:06 +02:00
LibWeb: Allow comma- or space-separated StyleValueLists
This lets us produce valid CSS in its to_string() method, instead of always adding commas as before. :^) Also, finally added a Formatter for StyleValues.
This commit is contained in:
committed by
Andreas Kling
parent
f71db4afd8
commit
5826fe094f
Notes:
sideshowbarker
2024-07-17 19:52:19 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/5826fe094f8 Pull-request: https://github.com/SerenityOS/serenity/pull/12262
@@ -83,7 +83,7 @@ static RefPtr<StyleValue> style_value_for_display(CSS::Display display)
|
||||
break;
|
||||
}
|
||||
|
||||
return StyleValueList::create(move(values));
|
||||
return StyleValueList::create(move(values), StyleValueList::Separator::Space);
|
||||
}
|
||||
|
||||
if (display.is_internal()) {
|
||||
@@ -550,7 +550,7 @@ RefPtr<StyleValue> ResolvedCSSStyleDeclaration::style_value_for_property(Layout:
|
||||
values.append(style_value_for_length_percentage(margin.right));
|
||||
values.append(style_value_for_length_percentage(margin.bottom));
|
||||
values.append(style_value_for_length_percentage(margin.left));
|
||||
return StyleValueList::create(move(values));
|
||||
return StyleValueList::create(move(values), StyleValueList::Separator::Space);
|
||||
}
|
||||
case CSS::PropertyID::MarginTop:
|
||||
return style_value_for_length_percentage(layout_node.computed_values().margin().top);
|
||||
@@ -567,7 +567,7 @@ RefPtr<StyleValue> ResolvedCSSStyleDeclaration::style_value_for_property(Layout:
|
||||
values.append(style_value_for_length_percentage(padding.right));
|
||||
values.append(style_value_for_length_percentage(padding.bottom));
|
||||
values.append(style_value_for_length_percentage(padding.left));
|
||||
return StyleValueList::create(move(values));
|
||||
return StyleValueList::create(move(values), StyleValueList::Separator::Space);
|
||||
}
|
||||
case CSS::PropertyID::PaddingTop:
|
||||
return style_value_for_length_percentage(layout_node.computed_values().padding().top);
|
||||
|
||||
Reference in New Issue
Block a user