mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 10:27:35 +00:00
LibWeb: Expand shorthand properties in KeyframeEffect
This commit is contained in:
parent
9e0ff9c140
commit
ee63c729e5
1 changed files with 5 additions and 2 deletions
|
@ -9,6 +9,7 @@
|
|||
#include <LibWeb/Animations/Animation.h>
|
||||
#include <LibWeb/Animations/KeyframeEffect.h>
|
||||
#include <LibWeb/CSS/Parser/Parser.h>
|
||||
#include <LibWeb/CSS/StyleComputer.h>
|
||||
#include <LibWeb/WebIDL/ExceptionOr.h>
|
||||
|
||||
namespace Web::Animations {
|
||||
|
@ -825,8 +826,10 @@ WebIDL::ExceptionOr<void> KeyframeEffect::set_keyframes(Optional<JS::Handle<JS::
|
|||
auto key = static_cast<u64>(keyframe.computed_offset.value() * 100 * AnimationKeyFrameKeyScaleFactor);
|
||||
|
||||
for (auto const& [property_id, property_value] : keyframe.parsed_properties()) {
|
||||
m_target_properties.set(property_id);
|
||||
resolved_keyframe.resolved_properties.set(property_id, property_value);
|
||||
CSS::StyleComputer::for_each_property_expanding_shorthands(property_id, property_value, [&](CSS::PropertyID shorthand_id, CSS::StyleValue const& shorthand_value) {
|
||||
m_target_properties.set(shorthand_id);
|
||||
resolved_keyframe.resolved_properties.set(shorthand_id, NonnullRefPtr<CSS::StyleValue const> { shorthand_value });
|
||||
});
|
||||
}
|
||||
|
||||
keyframe_set->keyframes_by_key.insert(key, resolved_keyframe);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue