diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index b25551180a7..009efb50b48 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -1661,10 +1661,9 @@ WebIDL::ExceptionOr> Document::create_event(StringView i // NOTE: These are done in the if-chain above // 5. Let event be the result of creating an event given constructor. // 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. - // 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. event->set_is_trusted(false); diff --git a/Userland/Libraries/LibWeb/DOM/Event.cpp b/Userland/Libraries/LibWeb/DOM/Event.cpp index 192c54df142..2e275c1a7c9 100644 --- a/Userland/Libraries/LibWeb/DOM/Event.cpp +++ b/Userland/Libraries/LibWeb/DOM/Event.cpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace Web::DOM { @@ -26,13 +27,16 @@ WebIDL::ExceptionOr> Event::construct_impl(JS::Realm& re return create(realm, event_name, event_init); } +// https://dom.spec.whatwg.org/#inner-event-creation-steps Event::Event(JS::Realm& realm, FlyString const& type) : PlatformObject(realm) , m_type(type) , 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) : PlatformObject(realm) , 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_composed(event_init.composed) , m_initialized(true) + , m_time_stamp(HighResolutionTime::current_high_resolution_time(HTML::relevant_global_object(*this))) { }