LibWeb: Store parsed shorthands in canonical order

This commit is contained in:
Callum Law 2025-09-14 14:16:37 +12:00 committed by Tim Ledbetter
commit a6812e1005
Notes: github-actions[bot] 2025-09-15 14:25:37 +00:00
2 changed files with 5 additions and 5 deletions

View file

@ -848,7 +848,7 @@ Parser::ParseErrorOr<NonnullRefPtr<StyleValue const>> Parser::parse_css_value(Pr
auto stream = TokenStream { component_values }; auto stream = TokenStream { component_values };
HashMap<UnderlyingType<PropertyID>, Vector<ValueComparingNonnullRefPtr<StyleValue const>>> assigned_values; OrderedHashMap<UnderlyingType<PropertyID>, Vector<ValueComparingNonnullRefPtr<StyleValue const>>> assigned_values;
while (stream.has_next_token() && !unassigned_properties.is_empty()) { while (stream.has_next_token() && !unassigned_properties.is_empty()) {
auto property_and_value = parse_css_value_for_properties(unassigned_properties, stream); auto property_and_value = parse_css_value_for_properties(unassigned_properties, stream);

View file

@ -2,15 +2,15 @@ Harness status: OK
Found 20 tests Found 20 tests
15 Pass 17 Pass
5 Fail 3 Fail
Pass The serialization of border: 1px; border-top: 1px; should be canonical. Pass The serialization of border: 1px; border-top: 1px; should be canonical.
Pass The serialization of border: 1px solid red; should be canonical. Pass The serialization of border: 1px solid red; should be canonical.
Pass The serialization of border: 1px red; should be canonical. Pass The serialization of border: 1px red; should be canonical.
Pass The serialization of border: red; should be canonical. Pass The serialization of border: red; should be canonical.
Pass The serialization of border-top: 1px; border-right: 1px; border-bottom: 1px; border-left: 1px; border-image: none; should be canonical. Pass The serialization of border-top: 1px; border-right: 1px; border-bottom: 1px; border-left: 1px; border-image: none; should be canonical.
Fail The serialization of border-top: 1px; border-right: 1px; border-bottom: 1px; border-left: 1px; should be canonical. Pass The serialization of border-top: 1px; border-right: 1px; border-bottom: 1px; border-left: 1px; should be canonical.
Fail The serialization of border-top: 1px; border-right: 2px; border-bottom: 3px; border-left: 4px; should be canonical. Pass The serialization of border-top: 1px; border-right: 2px; border-bottom: 3px; border-left: 4px; should be canonical.
Fail The serialization of border: 1px; border-top: 2px; should be canonical. Fail The serialization of border: 1px; border-top: 2px; should be canonical.
Fail The serialization of border: 1px; border-top: 1px !important; should be canonical. Fail The serialization of border: 1px; border-top: 1px !important; should be canonical.
Fail The serialization of border: 1px; border-top-color: red; should be canonical. Fail The serialization of border: 1px; border-top-color: red; should be canonical.