LibWeb: Store custom properties in an OrderedHashMap

We are expected to preserve their order within a style declaration, so
let's do that. Passes 1 tracked WPT subtest.
This commit is contained in:
Sam Atkins 2025-09-18 11:44:56 +01:00 committed by Jelle Raaijmakers
parent 2674bd428e
commit 95aceb6ec9
Notes: github-actions[bot] 2025-09-18 13:00:16 +00:00
11 changed files with 30 additions and 31 deletions

View file

@ -325,7 +325,7 @@ void ConnectionFromClient::debug_request(u64 page_id, ByteString request, ByteSt
}
if (request == "dump-all-resolved-styles") {
auto dump_style = [](String const& title, Web::CSS::ComputedProperties const& style, HashMap<FlyString, Web::CSS::StyleProperty> const& custom_properties) {
auto dump_style = [](String const& title, Web::CSS::ComputedProperties const& style, OrderedHashMap<FlyString, Web::CSS::StyleProperty> const& custom_properties) {
dbgln("+ {}", title);
for (size_t i = to_underlying(Web::CSS::first_longhand_property_id); i < to_underlying(Web::CSS::last_longhand_property_id); ++i) {
dbgln("| {} = {}", Web::CSS::string_from_property_id(static_cast<Web::CSS::PropertyID>(i)), style.property(static_cast<Web::CSS::PropertyID>(i)).to_string(Web::CSS::SerializationMode::Normal));