mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-28 04:09:00 +00:00
LibWeb: Set timestamp for DOM Events
This commit is contained in:
parent
51a52a867c
commit
ccd16c847e
Notes:
sideshowbarker
2024-07-17 08:27:05 +09:00
Author: https://github.com/shannonbooth
Commit: ccd16c847e
Pull-request: https://github.com/SerenityOS/serenity/pull/23935
2 changed files with 6 additions and 2 deletions
|
@ -1661,10 +1661,9 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Event>> Document::create_event(StringView i
|
||||||
// NOTE: These are done in the if-chain above
|
// NOTE: These are done in the if-chain above
|
||||||
// 5. Let event be the result of creating an event given constructor.
|
// 5. Let event be the result of creating an event given constructor.
|
||||||
// 6. Initialize event’s type attribute to the empty string.
|
// 6. Initialize event’s type attribute to the empty string.
|
||||||
|
// 7. Initialize event’s timeStamp attribute to the result of calling current high resolution time with this’s relevant global object.
|
||||||
// NOTE: This is handled by each constructor.
|
// NOTE: This is handled by each constructor.
|
||||||
|
|
||||||
// FIXME: 7. Initialize event’s timeStamp attribute to the result of calling current high resolution time with this’s relevant global object.
|
|
||||||
|
|
||||||
// 8. Initialize event’s isTrusted attribute to false.
|
// 8. Initialize event’s isTrusted attribute to false.
|
||||||
event->set_is_trusted(false);
|
event->set_is_trusted(false);
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include <LibWeb/DOM/Event.h>
|
#include <LibWeb/DOM/Event.h>
|
||||||
#include <LibWeb/DOM/Node.h>
|
#include <LibWeb/DOM/Node.h>
|
||||||
#include <LibWeb/DOM/ShadowRoot.h>
|
#include <LibWeb/DOM/ShadowRoot.h>
|
||||||
|
#include <LibWeb/HighResolutionTime/TimeOrigin.h>
|
||||||
|
|
||||||
namespace Web::DOM {
|
namespace Web::DOM {
|
||||||
|
|
||||||
|
@ -26,13 +27,16 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Event>> Event::construct_impl(JS::Realm& re
|
||||||
return create(realm, event_name, event_init);
|
return create(realm, event_name, event_init);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://dom.spec.whatwg.org/#inner-event-creation-steps
|
||||||
Event::Event(JS::Realm& realm, FlyString const& type)
|
Event::Event(JS::Realm& realm, FlyString const& type)
|
||||||
: PlatformObject(realm)
|
: PlatformObject(realm)
|
||||||
, m_type(type)
|
, m_type(type)
|
||||||
, m_initialized(true)
|
, m_initialized(true)
|
||||||
|
, m_time_stamp(HighResolutionTime::current_high_resolution_time(HTML::relevant_global_object(*this)))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://dom.spec.whatwg.org/#inner-event-creation-steps
|
||||||
Event::Event(JS::Realm& realm, FlyString const& type, EventInit const& event_init)
|
Event::Event(JS::Realm& realm, FlyString const& type, EventInit const& event_init)
|
||||||
: PlatformObject(realm)
|
: PlatformObject(realm)
|
||||||
, m_type(type)
|
, m_type(type)
|
||||||
|
@ -40,6 +44,7 @@ Event::Event(JS::Realm& realm, FlyString const& type, EventInit const& event_ini
|
||||||
, m_cancelable(event_init.cancelable)
|
, m_cancelable(event_init.cancelable)
|
||||||
, m_composed(event_init.composed)
|
, m_composed(event_init.composed)
|
||||||
, m_initialized(true)
|
, m_initialized(true)
|
||||||
|
, m_time_stamp(HighResolutionTime::current_high_resolution_time(HTML::relevant_global_object(*this)))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue