Commit Graph

66 Commits

Author SHA1 Message Date
Matthew Olsson
1e37ba5515 LibWeb: Expose Animation::is_finished()
This will be required to handle forward-fill state in StyleComputer
2024-02-21 19:52:35 +01:00
Matthew Olsson
5eea53f27a LibWeb: Keep track of associated AnimationEffects in Animatable 2024-02-21 19:52:35 +01:00
Matthew Olsson
2ade834655 LibWeb: Add Animation::is_replaceable() 2024-02-21 19:52:35 +01:00
Matthew Olsson
4e6c74dcf6 LibWeb: Define the composite order between two animations 2024-02-21 19:52:35 +01:00
Matthew Olsson
ceb9d0f8dc LibWeb: Record position of Animations in global animation list
"position of an Animation in the global animation list" is a fancy way
of saying "which animation object was created first"
2024-02-21 19:52:35 +01:00
Matthew Olsson
c3b689488e LibWeb: Implement animation class-specific composite order
This is a part of determining the composite order of two animations
2024-02-21 19:52:35 +01:00
Matthew Olsson
cac11ac891 LibWeb: Use [ExplicitNull] in Animation.idl 2024-02-19 14:51:56 -05:00
Matthew Olsson
1d98f812af LibWeb: Generate KeyframeSet in KeyframeEffect::set_keyframes
This is similar to the logic used in StyleComputer (except a bit closer
to the spec), and will eventually be shared between the two.
2024-02-19 12:21:48 +01:00
Matthew Olsson
1735f3d9aa LibWeb: Add keyframe state to KeyframeEffect
This was taken from StyleComputer, and will eventually be removed from
StyleComputer once we transition to using Web animations.
2024-02-19 12:21:48 +01:00
Matthew Olsson
7d5e17eddd LibWeb: Implement Animatable::animate() 2024-02-19 12:21:48 +01:00
Matthew Olsson
3a87c000c4 LibWeb: Add the CSSAnimation IDL object 2024-02-16 12:02:11 -07:00
Matthew Olsson
3721a1a81c LibWeb: Run update_finished_state when setting AnimationEffect's timing
This will need to a necessary style invalidation
2024-02-16 12:02:11 -07:00
Matthew Olsson
6d25bf3aac LibWeb: Invalidate element when setting AnimationEffect's animation 2024-02-16 12:02:11 -07:00
Matthew Olsson
ce99636cd0 LibWeb: Fix check for missing argument in Animation constructor
Receiving a null argument has a different result than not passing an
argument at all.
2024-02-16 12:02:11 -07:00
Matthew Olsson
727a9a6472 LibWeb: Run pending play tasks when the timeline time changes
Note that the timeline time changes every animation frame when the
Document sends out animation events
2024-02-15 12:34:19 +01:00
Matthew Olsson
daaaaec2d0 LibWeb: Add the Animatable IDL object 2024-02-15 12:34:19 +01:00
Matthew Olsson
4792dc294b LibWeb: Implement Animation::play 2024-02-15 12:34:19 +01:00
Matthew Olsson
88518c29ca LibWeb: Combine "pending" and "ASAP" animation task states
It seems that the difference between pending and ASAP in the spec is
only to allow the implementation to perform implementation-defined
operations between the two states. We don't need to distinguish the two
states, so lets just combine them for now.
2024-02-15 12:34:19 +01:00
Matthew Olsson
3c9c134d71 LibWeb: Implement KeyframeEffect::{get,set}_keyframes 2024-02-13 19:44:44 +01:00
Matthew Olsson
38c67ba17c LibWeb: Implement parsing a monolithic keyframes-like argument
See the last commit for a more in-depth explanation
2024-02-13 19:44:44 +01:00
Matthew Olsson
7d69fa0ccf LibWeb: Partially implement the "process a keyframes argument" procedure
Keyframes can be given in two separate forms:

- As an array of separate keyframe objects, where the keys of each
  keyframe represent CSS properties, and their values represents the
  values that those CSS properties should take

  e.x.:
  [{ color: 'red', offset: 0.3 }, { color: 'blue', offset: 0.7 }]

- As a single monolithic keyframe object, where the keys of each
  keyframe represent CSS properties, and their values are arrays of
  values, where each index k represents the value of the given
  property at the k'th frame.

  e.x.:
  { color: ['red', 'blue'], offset: [0.3, 0.7] }

This commit only implements the first option, as it is much simpler. See
the next commit for the implementation of the second option.
2024-02-13 19:44:44 +01:00
Matthew Olsson
9f404ed9c1 LibWeb: Implement the "compute missing keyframe offsets" procedure 2024-02-13 19:44:44 +01:00
Matthew Olsson
38153b47d6 LibWeb: Implement the "process a keyframe-like object" procedure 2024-02-13 19:44:44 +01:00
Matthew Olsson
c732e03ea0 LibWeb: Add missing implementation of method in AnimationTimeline 2024-02-06 08:42:07 +01:00
Matthew Olsson
df4be9a479 LibWeb: Add missing virtual destructor in AnimationEffect 2024-02-06 08:42:07 +01:00
Matthew Olsson
154b4d4196 LibWeb: Invalidate style of animation targets in update_finished_state 2024-02-06 08:42:07 +01:00
Matthew Olsson
a7727215a6 LibWeb: Implement missing members of AnimationEffect.getComputedTiming() 2024-02-06 08:42:07 +01:00
Matthew Olsson
360082544c LibWeb: Fix incorrect Animation active_time in the after phase 2024-02-06 08:42:07 +01:00
Matthew Olsson
16a21a503d LibWeb: Fix incorrect comparison in Animation::update_finished_state 2024-02-06 08:42:07 +01:00
Matthew Olsson
2e29b0d700 LibWeb: Rename confusing parameter in AnimationPlaybackEvent 2024-02-06 08:42:07 +01:00
Matthew Olsson
8c80d0ee02 LibWeb: Fix typo (original_relative_time -> origin_relative_time) 2024-02-06 08:42:07 +01:00
Matthew Olsson
a27dd03dcc LibWeb: Avoid slicing struct in KeyframeEffect::construct_impl 2024-02-06 08:42:07 +01:00
Bastiaan van der Plaat
5f5ac48908 LibWeb: Format all .idl files to use four space indentation 2024-01-18 14:00:06 +01:00
Bastiaan van der Plaat
cf69fd0a09 LibWeb: Add input element valueAsDate property 2024-01-06 09:59:30 -07:00
Andreas Kling
f4fa37afd2 LibJS+LibWeb: Add missing JS_DEFINE_ALLOCATOR() for a bunch of classes 2023-12-23 23:02:10 +01:00
Shannon Booth
96af80acd1 LibWeb: Port Intrinsics from DeprecatedString 2023-11-28 17:15:27 -05:00
Andreas Kling
bfd354492e LibWeb: Put most LibWeb GC objects in type-specific heap blocks
With this change, we now have ~1200 CellAllocators across both LibJS and
LibWeb in a normal WebContent instance.

This gives us a minimum heap size of 4.7 MiB in the scenario where we
only have one cell allocated per type. Of course, in practice there will
be many more of each type, so the effective overhead is quite a bit
smaller than that in practice.

I left a few types unconverted to this mechanism because I got tired of
doing this. :^)
2023-11-19 22:00:48 +01:00
Matthew Olsson
536596632b LibWeb: Implement Animation::update_finished_state 2023-11-19 18:54:37 +01:00
Matthew Olsson
8053d40fd5 LibWeb: Add Animation helpers needed for update_finished_state 2023-11-19 18:54:37 +01:00
Matthew Olsson
95d62822bf LibWeb: Implement KeyframeEffect::set_pseudo_element 2023-11-14 10:12:02 +01:00
Matthew Olsson
5824916f8c LibWeb: Add KeyframeEffect IDL objects 2023-11-14 10:12:02 +01:00
Matthew Olsson
43dc9dfb69 LibWeb: Add the AnimationPlaybackEvent IDL object 2023-11-11 22:45:16 +01:00
Matthew Olsson
fe40bdfc01 LibWeb: Implement Animation::play_state 2023-11-11 22:45:16 +01:00
Matthew Olsson
8039fe78cd LibWeb: Implement Animation::set_playback_rate 2023-11-11 22:45:16 +01:00
Matthew Olsson
749462f3df LibWeb: Implement Animation::set_current_time 2023-11-11 22:45:16 +01:00
Matthew Olsson
f898b49c8e LibWeb: Implement Animation::current_time 2023-11-11 22:45:16 +01:00
Matthew Olsson
9802995de8 LibWeb: Track an Animation's play/pause task state
This only tracks whether the relevant steps should be executed at some
future (but very soon) time. This time will eventually be whenever the
"update animations and send events" procedure is invoked.
2023-11-11 22:45:16 +01:00
Matthew Olsson
422f43f4fc LibWeb: Implement Animation::set_start_time 2023-11-11 22:45:16 +01:00
Matthew Olsson
4889f53880 LibWeb: Implement Animation::set_timeline 2023-11-11 22:45:16 +01:00
Matthew Olsson
4efbb10a36 LibWeb: Keep track of associated Animations in AnimationTimeline
This allows the timeline to propagate changes in time to any relevant
animation objects.
2023-11-11 08:58:08 +01:00