mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-11 17:37:33 +02:00
Previously we were inconsistent by generating code for enum definitions but not generating code for dictionaries. With future changes to the IDL generator to expose helpers to convert to and from IDL values this produced circular depdendencies. To solve this problem, also generate the dictionary definitions in bindings headers.
46 lines
1.5 KiB
C++
46 lines
1.5 KiB
C++
/*
|
|
* Copyright (c) 2024, Matthew Olsson <mattco@serenityos.org>.
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWeb/Bindings/AnimationEvent.h>
|
|
#include <LibWeb/Bindings/PlatformObject.h>
|
|
#include <LibWeb/DOM/Event.h>
|
|
|
|
namespace Web::CSS {
|
|
|
|
// https://www.w3.org/TR/css-animations-1/#animationevent
|
|
class AnimationEvent : public DOM::Event {
|
|
WEB_PLATFORM_OBJECT(AnimationEvent, DOM::Event);
|
|
GC_DECLARE_ALLOCATOR(AnimationEvent);
|
|
|
|
public:
|
|
[[nodiscard]] static GC::Ref<AnimationEvent> create(JS::Realm&, FlyString const& type, Bindings::AnimationEventInit const& event_init = {});
|
|
static WebIDL::ExceptionOr<GC::Ref<AnimationEvent>> construct_impl(JS::Realm&, FlyString const& type, Bindings::AnimationEventInit const& event_init);
|
|
|
|
virtual ~AnimationEvent() override = default;
|
|
|
|
FlyString const& animation_name() const { return m_animation_name; }
|
|
double elapsed_time() const { return m_elapsed_time; }
|
|
FlyString const& pseudo_element() const { return m_pseudo_element; }
|
|
|
|
private:
|
|
AnimationEvent(JS::Realm&, FlyString const& type, Bindings::AnimationEventInit const& event_init);
|
|
|
|
virtual void initialize(JS::Realm&) override;
|
|
|
|
// https://www.w3.org/TR/css-animations-1/#dom-animationevent-animationname
|
|
FlyString m_animation_name {};
|
|
|
|
// https://www.w3.org/TR/css-animations-1/#dom-animationevent-elapsedtime
|
|
double m_elapsed_time { 0.0 };
|
|
|
|
// https://www.w3.org/TR/css-animations-1/#dom-animationevent-pseudoelement
|
|
FlyString m_pseudo_element {};
|
|
};
|
|
|
|
}
|