mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-06 08:10:02 +00:00
LibWeb/CSS: Add the TransitionEvent type
This commit is contained in:
parent
56e6d4f42d
commit
55b4a983a7
Notes:
github-actions[bot]
2024-12-25 16:15:39 +00:00
Author: https://github.com/LucasChollet
Commit: 55b4a983a7
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3024
8 changed files with 379 additions and 0 deletions
43
Libraries/LibWeb/CSS/TransitionEvent.cpp
Normal file
43
Libraries/LibWeb/CSS/TransitionEvent.cpp
Normal file
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Lucas Chollet <lucas.chollet@serenityos.org>.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include "TransitionEvent.h"
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/Bindings/TransitionEventPrototype.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
||||
GC_DEFINE_ALLOCATOR(TransitionEvent);
|
||||
|
||||
GC::Ref<TransitionEvent> TransitionEvent::create(JS::Realm& realm, FlyString const& type, TransitionEventInit const& event_init)
|
||||
{
|
||||
auto event = realm.create<TransitionEvent>(realm, type, event_init);
|
||||
event->set_is_trusted(true);
|
||||
return event;
|
||||
}
|
||||
|
||||
GC::Ref<TransitionEvent> TransitionEvent::construct_impl(JS::Realm& realm, FlyString const& type, TransitionEventInit const& event_init)
|
||||
{
|
||||
return realm.create<TransitionEvent>(realm, type, event_init);
|
||||
}
|
||||
|
||||
TransitionEvent::TransitionEvent(JS::Realm& realm, FlyString const& type, TransitionEventInit const& event_init)
|
||||
: DOM::Event(realm, type, event_init)
|
||||
, m_property_name(event_init.property_name)
|
||||
, m_elapsed_time(event_init.elapsed_time)
|
||||
, m_pseudo_element(event_init.pseudo_element)
|
||||
{
|
||||
}
|
||||
|
||||
TransitionEvent::~TransitionEvent() = default;
|
||||
|
||||
void TransitionEvent::initialize(JS::Realm& realm)
|
||||
{
|
||||
Base::initialize(realm);
|
||||
WEB_SET_PROTOTYPE_FOR_INTERFACE(TransitionEvent);
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue