mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-04 15:19:42 +00:00
LibWeb/CSS: Extract SerializationMode into its own header
Prep for using this to serialize dimension types, and perhaps other things in the future.
This commit is contained in:
parent
2748522924
commit
eec4365542
Notes:
github-actions[bot]
2025-05-17 06:54:49 +00:00
Author: https://github.com/AtkinsSJ
Commit: eec4365542
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4783
Reviewed-by: https://github.com/tcl3 ✅
26 changed files with 112 additions and 99 deletions
|
@ -426,7 +426,7 @@ void dump_tree(StringBuilder& builder, Layout::Node const& layout_node, bool sho
|
|||
};
|
||||
Vector<NameAndValue> properties;
|
||||
as<DOM::Element>(*layout_node.dom_node()).computed_properties()->for_each_property([&](auto property_id, auto& value) {
|
||||
properties.append({ CSS::string_from_property_id(property_id), value.to_string(CSS::CSSStyleValue::SerializationMode::Normal) });
|
||||
properties.append({ CSS::string_from_property_id(property_id), value.to_string(CSS::SerializationMode::Normal) });
|
||||
});
|
||||
quick_sort(properties, [](auto& a, auto& b) { return a.name < b.name; });
|
||||
|
||||
|
@ -827,14 +827,14 @@ void dump_style_properties(StringBuilder& builder, CSS::CSSStyleProperties const
|
|||
builder.appendff("Declarations ({}):\n", declaration.length());
|
||||
for (auto& property : declaration.properties()) {
|
||||
indent(builder, indent_levels);
|
||||
builder.appendff(" {}: '{}'", CSS::string_from_property_id(property.property_id), property.value->to_string(CSS::CSSStyleValue::SerializationMode::Normal));
|
||||
builder.appendff(" {}: '{}'", CSS::string_from_property_id(property.property_id), property.value->to_string(CSS::SerializationMode::Normal));
|
||||
if (property.important == CSS::Important::Yes)
|
||||
builder.append(" \033[31;1m!important\033[0m"sv);
|
||||
builder.append('\n');
|
||||
}
|
||||
for (auto& property : declaration.custom_properties()) {
|
||||
indent(builder, indent_levels);
|
||||
builder.appendff(" {}: '{}'", property.key, property.value.value->to_string(CSS::CSSStyleValue::SerializationMode::Normal));
|
||||
builder.appendff(" {}: '{}'", property.key, property.value.value->to_string(CSS::SerializationMode::Normal));
|
||||
if (property.value.important == CSS::Important::Yes)
|
||||
builder.append(" \033[31;1m!important\033[0m"sv);
|
||||
builder.append('\n');
|
||||
|
@ -847,7 +847,7 @@ void dump_descriptors(StringBuilder& builder, CSS::CSSDescriptors const& descrip
|
|||
builder.appendff("Declarations ({}):\n", descriptors.length());
|
||||
for (auto const& descriptor : descriptors.descriptors()) {
|
||||
indent(builder, indent_levels);
|
||||
builder.appendff(" {}: '{}'", CSS::to_string(descriptor.descriptor_id), descriptor.value->to_string(CSS::CSSStyleValue::SerializationMode::Normal));
|
||||
builder.appendff(" {}: '{}'", CSS::to_string(descriptor.descriptor_id), descriptor.value->to_string(CSS::SerializationMode::Normal));
|
||||
builder.append('\n');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue