mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-12 19:19:30 +00:00
LibWeb: Add mode flag to CSSStyleValue::to_string()
This will be used to differentiate between serialization for resolved style (i.e window.getComputedStyle()) and serialization for all other purposes.
This commit is contained in:
parent
c1b29e7cc4
commit
e85c3c97fb
Notes:
github-actions[bot]
2024-12-07 08:32:08 +00:00
Author: https://github.com/awesomekling
Commit: e85c3c97fb
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2820
Reviewed-by: https://github.com/AtkinsSJ ✅
112 changed files with 217 additions and 208 deletions
|
@ -354,7 +354,7 @@ void ConnectionFromClient::debug_request(u64 page_id, ByteString const& request,
|
|||
dbgln("+ Element {}", element->debug_description());
|
||||
for (size_t i = 0; i < Web::CSS::StyleProperties::number_of_properties; ++i) {
|
||||
auto property = styles.maybe_null_property(static_cast<Web::CSS::PropertyID>(i));
|
||||
dbgln("| {} = {}", Web::CSS::string_from_property_id(static_cast<Web::CSS::PropertyID>(i)), property ? property->to_string() : ""_string);
|
||||
dbgln("| {} = {}", Web::CSS::string_from_property_id(static_cast<Web::CSS::PropertyID>(i)), property ? property->to_string(Web::CSS::CSSStyleValue::SerializationMode::Normal) : ""_string);
|
||||
}
|
||||
dbgln("---");
|
||||
}
|
||||
|
@ -516,7 +516,7 @@ void ConnectionFromClient::inspect_dom_node(u64 page_id, Web::UniqueNodeID const
|
|||
|
||||
auto serializer = MUST(JsonObjectSerializer<>::try_create(builder));
|
||||
properties.for_each_property([&](auto property_id, auto& value) {
|
||||
MUST(serializer.add(Web::CSS::string_from_property_id(property_id), value.to_string().to_byte_string()));
|
||||
MUST(serializer.add(Web::CSS::string_from_property_id(property_id), value.to_string(Web::CSS::CSSStyleValue::SerializationMode::Normal).to_byte_string()));
|
||||
});
|
||||
MUST(serializer.finish());
|
||||
|
||||
|
@ -533,7 +533,7 @@ void ConnectionFromClient::inspect_dom_node(u64 page_id, Web::UniqueNodeID const
|
|||
for (auto const& property : element_to_check->custom_properties(pseudo_element)) {
|
||||
if (!seen_properties.contains(property.key)) {
|
||||
seen_properties.set(property.key);
|
||||
MUST(serializer.add(property.key, property.value.value->to_string()));
|
||||
MUST(serializer.add(property.key, property.value.value->to_string(Web::CSS::CSSStyleValue::SerializationMode::Normal)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue