LibWeb: Make CSS/Properties.json "logical-aliases-for" an array
This allows us to specify all aliases properties instead of just one.
This commit is contained in:
parent
970a3ef4d8
commit
941092e3ad
Notes:
sideshowbarker
2024-07-17 02:39:10 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/941092e3ad Pull-request: https://github.com/SerenityOS/serenity/pull/19281
2 changed files with 14 additions and 7 deletions
|
@ -56,9 +56,12 @@ ErrorOr<void> replace_logical_aliases(JsonObject& properties)
|
|||
properties.for_each_member([&](auto& name, auto& value) {
|
||||
VERIFY(value.is_object());
|
||||
const auto& value_as_object = value.as_object();
|
||||
const auto logical_alias_for = value_as_object.get_deprecated_string("logical-alias-for"sv);
|
||||
const auto logical_alias_for = value_as_object.get_array("logical-alias-for"sv);
|
||||
if (logical_alias_for.has_value()) {
|
||||
logical_aliases.set(name, logical_alias_for.value());
|
||||
auto const& aliased_properties = logical_alias_for.value();
|
||||
for (auto const& aliased_property : aliased_properties.values()) {
|
||||
logical_aliases.set(name, aliased_property.to_deprecated_string());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -1336,8 +1336,10 @@
|
|||
]
|
||||
},
|
||||
"max-inline-size": {
|
||||
"logical-alias-for": "max-width",
|
||||
"__comment": "Also a logical alias for max-height",
|
||||
"logical-alias-for": [
|
||||
"max-width",
|
||||
"max-height"
|
||||
],
|
||||
"initial": "none"
|
||||
},
|
||||
"max-width": {
|
||||
|
@ -1373,8 +1375,10 @@
|
|||
]
|
||||
},
|
||||
"min-inline-size": {
|
||||
"logical-alias-for": "min-width",
|
||||
"__comment": "Also a logical alias for min-height",
|
||||
"logical-alias-for": [
|
||||
"min-width",
|
||||
"min-height"
|
||||
],
|
||||
"initial": "0"
|
||||
},
|
||||
"min-width": {
|
||||
|
@ -1767,7 +1771,7 @@
|
|||
"inherited": false,
|
||||
"initial": "0s",
|
||||
"valid-types": [
|
||||
"time"
|
||||
"time"
|
||||
]
|
||||
},
|
||||
"user-select": {
|
||||
|
|
Loading…
Add table
Reference in a new issue