LibWeb: Remove special handling of all property for animations

There were a couple places that we had special handling for the `all`
property but since d31a58a was merged we can treat it the same as any
other shorthand
This commit is contained in:
Callum Law 2025-10-30 20:28:25 +13:00 committed by Alexander Kalenik
parent 56e2ac8a9d
commit ed0b741a26
Notes: github-actions[bot] 2025-11-02 22:55:35 +00:00
4 changed files with 17 additions and 35 deletions

View file

@ -152,30 +152,21 @@ static WebIDL::ExceptionOr<KeyframeType<AL>> process_a_keyframe_like_object(JS::
auto input_properties = TRY(keyframe_object.enumerable_own_property_names(JS::Object::PropertyKind::Key));
Vector<String> animation_properties;
Optional<JS::Value> all_value;
for (auto const& input_property : input_properties) {
if (!input_property.is_string())
continue;
auto name = input_property.as_string().utf8_string();
if (name == "all"sv) {
all_value = TRY(keyframe_object.get(vm.names.all));
for (auto i = to_underlying(CSS::first_longhand_property_id); i <= to_underlying(CSS::last_longhand_property_id); ++i) {
auto property = static_cast<CSS::PropertyID>(i);
if (CSS::is_animatable_property(property))
animation_properties.append(String { CSS::string_from_property_id(property) });
}
} else {
// Handle the two special cases
if (name == "cssFloat"sv || name == "cssOffset"sv) {
// Handle the two special cases
if (name == "cssFloat"sv || name == "cssOffset"sv) {
animation_properties.append(name);
} else if (name == "float"sv || name == "offset"sv) {
// Ignore these property names
} else if (auto property = CSS::property_id_from_camel_case_string(name); property.has_value()) {
if (CSS::is_animatable_property(property.value()))
animation_properties.append(name);
} else if (name == "float"sv || name == "offset"sv) {
// Ignore these property names
} else if (auto property = CSS::property_id_from_camel_case_string(name); property.has_value()) {
if (CSS::is_animatable_property(property.value()))
animation_properties.append(name);
}
}
}
@ -188,7 +179,7 @@ static WebIDL::ExceptionOr<KeyframeType<AL>> process_a_keyframe_like_object(JS::
// as the property key and keyframe input as the receiver.
// 2. Check the completion record of raw value.
JS::PropertyKey key { Utf16FlyString::from_utf8(property_name), JS::PropertyKey::StringMayBeNumber::No };
auto raw_value = TRY(keyframe_object.has_property(key)) ? TRY(keyframe_object.get(key)) : *all_value;
auto raw_value = TRY(keyframe_object.get(key));
using PropertyValuesType = Conditional<AL == AllowLists::Yes, Vector<String>, String>;
PropertyValuesType property_values;