mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-29 14:14:45 +03:00
LibWeb: Expand shorthand properties in KeyframeEffect
This commit is contained in:
parent
9e0ff9c140
commit
ee63c729e5
Notes:
sideshowbarker
2024-07-17 16:42:19 +09:00
Author: https://github.com/mattco98 Commit: https://github.com/SerenityOS/serenity/commit/ee63c729e5 Pull-request: https://github.com/SerenityOS/serenity/pull/23332
@ -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…
Reference in New Issue
Block a user