Luce packages
LuceLuce BaseLuciaOS

dymokomi/luce-browser-engine

Source of release 0.6.1

0.6.1 / src / web / css / animation_event.lucb

#==============================================================================================
#
#   animation_event - CSS::AnimationEvent: animationstart, animationend, animationiteration
#                     and animationcancel
#
#   DESCRIPTION:
#       Port of Libraries/LibWeb/CSS/AnimationEvent.cpp (lines 1-43) with the inline members of
#       AnimationEvent.h, by region p4a: an Event carrying the animation's name, the elapsed
#       time and the pseudo-element. The prototype (WEB_SET_PROTOTYPE_FOR_INTERFACE) waits for
#       the bindings (phase 3).
#
#       Copyright (c) 2024, Matthew Olsson <mattco@serenityos.org>
#       SPDX-License-Identifier: BSD-2-Clause
#
#==============================================================================================

## Ported from Libraries/LibWeb/CSS/AnimationEvent.cpp:15 Web::CSS::AnimationEvent::create.
pub func css_animation_event_create(realm: Realm*, type_: ak.FlyString, event_init: const CssAnimationEventInit*) -> CssAnimationEvent*:
    return realm_create_css_animation_event(realm, realm, type_, event_init)

## Ported from Libraries/LibWeb/CSS/AnimationEvent.cpp:20 Web::CSS::AnimationEvent::construct_impl.
pub func css_animation_event_construct_impl(realm: Realm*, type_: ak.FlyString, event_init: const CssAnimationEventInit*) -> CssAnimationEvent*!:
    return css_animation_event_create(realm, type_, event_init)

## Ported from Libraries/LibWeb/CSS/AnimationEvent.cpp:25 Web::CSS::AnimationEvent::AnimationEvent (private).
func css_animation_event_construct(this: CssAnimationEvent*, realm: Realm*, type_: ak.FlyString, event_init: const CssAnimationEventInit*):
    dom_event_construct_dom_event_init(this.dom_event(), realm, type_, event_init.event_init)
    this.m_animation_name = event_init.animation_name
    this.m_elapsed_time = event_init.elapsed_time
    this.m_pseudo_element = event_init.pseudo_element

## Ported from Libraries/LibWeb/CSS/AnimationEvent.cpp:33 Web::CSS::AnimationEvent::initialize (override).
func css_animation_event_initialize_impl(base: JsCell*, realm: Realm*):
    web_set_prototype_for_interface(base, realm, BindInterfaceName.animation_event)
    dom_event_initialize_impl(base, realm)

## Ported from Libraries/LibWeb/CSS/AnimationEvent.h:30 Web::CSS::AnimationEvent::animation_name.
pub func css_animation_event_animation_name(this: CssAnimationEvent*) -> ak.FlyString:
    return this.m_animation_name

## Ported from Libraries/LibWeb/CSS/AnimationEvent.h:31 Web::CSS::AnimationEvent::elapsed_time.
pub func css_animation_event_elapsed_time(this: CssAnimationEvent*) -> f64:
    return this.m_elapsed_time

## Ported from Libraries/LibWeb/CSS/AnimationEvent.h:32 Web::CSS::AnimationEvent::pseudo_element.
pub func css_animation_event_pseudo_element(this: CssAnimationEvent*) -> ak.FlyString:
    return this.m_pseudo_element