mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:17:34 +00:00
LibWeb: Implement AnimationEffect's active_boundary time getters
This commit is contained in:
parent
baf5220212
commit
6a9c03482f
2 changed files with 17 additions and 0 deletions
|
@ -200,6 +200,20 @@ double AnimationEffect::active_duration() const
|
||||||
return m_iteration_duration.get<double>() * m_iteration_count;
|
return m_iteration_duration.get<double>() * m_iteration_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://www.w3.org/TR/web-animations-1/#before-active-boundary-time
|
||||||
|
double AnimationEffect::before_active_boundary_time() const
|
||||||
|
{
|
||||||
|
// max(min(start delay, end time), 0)
|
||||||
|
return max(min(m_start_delay, end_time()), 0.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// https://www.w3.org/TR/web-animations-1/#active-after-boundary-time
|
||||||
|
double AnimationEffect::after_active_boundary_time() const
|
||||||
|
{
|
||||||
|
// max(min(start delay + active duration, end time), 0)
|
||||||
|
return max(min(m_start_delay + active_duration(), end_time()), 0.0);
|
||||||
|
}
|
||||||
|
|
||||||
AnimationEffect::AnimationEffect(JS::Realm& realm)
|
AnimationEffect::AnimationEffect(JS::Realm& realm)
|
||||||
: Bindings::PlatformObject(realm)
|
: Bindings::PlatformObject(realm)
|
||||||
{
|
{
|
||||||
|
|
|
@ -98,6 +98,9 @@ public:
|
||||||
Optional<double> local_time() const;
|
Optional<double> local_time() const;
|
||||||
double active_duration() const;
|
double active_duration() const;
|
||||||
|
|
||||||
|
double before_active_boundary_time() const;
|
||||||
|
double after_active_boundary_time() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
AnimationEffect(JS::Realm&);
|
AnimationEffect(JS::Realm&);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue