LibWeb/DOM: Add StorageEvent and DragEvent to Document.createEvent

We have since implemented these interfaces.
This commit is contained in:
Shannon Booth 2025-07-11 01:18:14 +12:00 committed by Jelle Raaijmakers
commit 05ddf5c718
Notes: github-actions[bot] 2025-07-11 06:23:57 +00:00
2 changed files with 12 additions and 10 deletions

View file

@ -91,6 +91,7 @@
#include <LibWeb/HTML/CustomElements/CustomElementReactionNames.h> #include <LibWeb/HTML/CustomElements/CustomElementReactionNames.h>
#include <LibWeb/HTML/CustomElements/CustomElementRegistry.h> #include <LibWeb/HTML/CustomElements/CustomElementRegistry.h>
#include <LibWeb/HTML/DocumentState.h> #include <LibWeb/HTML/DocumentState.h>
#include <LibWeb/HTML/DragEvent.h>
#include <LibWeb/HTML/EventLoop/EventLoop.h> #include <LibWeb/HTML/EventLoop/EventLoop.h>
#include <LibWeb/HTML/EventNames.h> #include <LibWeb/HTML/EventNames.h>
#include <LibWeb/HTML/Focus.h> #include <LibWeb/HTML/Focus.h>
@ -134,6 +135,7 @@
#include <LibWeb/HTML/Scripting/WindowEnvironmentSettingsObject.h> #include <LibWeb/HTML/Scripting/WindowEnvironmentSettingsObject.h>
#include <LibWeb/HTML/SharedResourceRequest.h> #include <LibWeb/HTML/SharedResourceRequest.h>
#include <LibWeb/HTML/Storage.h> #include <LibWeb/HTML/Storage.h>
#include <LibWeb/HTML/StorageEvent.h>
#include <LibWeb/HTML/TraversableNavigable.h> #include <LibWeb/HTML/TraversableNavigable.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
#include <LibWeb/HTML/WindowProxy.h> #include <LibWeb/HTML/WindowProxy.h>
@ -2226,7 +2228,7 @@ WebIDL::ExceptionOr<GC::Ref<Event>> Document::create_event(StringView interface)
} else if (interface.equals_ignoring_ascii_case("deviceorientationevent"sv)) { } else if (interface.equals_ignoring_ascii_case("deviceorientationevent"sv)) {
event = Event::create(realm, FlyString {}); // FIXME: Create DeviceOrientationEvent event = Event::create(realm, FlyString {}); // FIXME: Create DeviceOrientationEvent
} else if (interface.equals_ignoring_ascii_case("dragevent"sv)) { } else if (interface.equals_ignoring_ascii_case("dragevent"sv)) {
event = Event::create(realm, FlyString {}); // FIXME: Create DragEvent event = HTML::DragEvent::create(realm, FlyString {});
} else if (interface.equals_ignoring_ascii_case("event"sv) } else if (interface.equals_ignoring_ascii_case("event"sv)
|| interface.equals_ignoring_ascii_case("events"sv)) { || interface.equals_ignoring_ascii_case("events"sv)) {
event = Event::create(realm, FlyString {}); event = Event::create(realm, FlyString {});
@ -2244,7 +2246,7 @@ WebIDL::ExceptionOr<GC::Ref<Event>> Document::create_event(StringView interface)
|| interface.equals_ignoring_ascii_case("mouseevents"sv)) { || interface.equals_ignoring_ascii_case("mouseevents"sv)) {
event = UIEvents::MouseEvent::create(realm, FlyString {}); event = UIEvents::MouseEvent::create(realm, FlyString {});
} else if (interface.equals_ignoring_ascii_case("storageevent"sv)) { } else if (interface.equals_ignoring_ascii_case("storageevent"sv)) {
event = Event::create(realm, FlyString {}); // FIXME: Create StorageEvent event = HTML::StorageEvent::create(realm, FlyString {});
} else if (interface.equals_ignoring_ascii_case("svgevents"sv)) { } else if (interface.equals_ignoring_ascii_case("svgevents"sv)) {
event = Event::create(realm, FlyString {}); event = Event::create(realm, FlyString {});
} else if (interface.equals_ignoring_ascii_case("textevent"sv)) { } else if (interface.equals_ignoring_ascii_case("textevent"sv)) {

View file

@ -2,8 +2,8 @@ Harness status: OK
Found 279 tests Found 279 tests
261 Pass 267 Pass
12 Fail 6 Fail
6 Optional Feature Unsupported 6 Optional Feature Unsupported
Pass BeforeUnloadEvent should be an alias for BeforeUnloadEvent. Pass BeforeUnloadEvent should be an alias for BeforeUnloadEvent.
Pass createEvent('BeforeUnloadEvent') should be initialized correctly. Pass createEvent('BeforeUnloadEvent') should be initialized correctly.
@ -40,11 +40,11 @@ Pass createEvent('deviceorientationevent') should be initialized correctly.
Fail DEVICEORIENTATIONEVENT should be an alias for DeviceOrientationEvent. Fail DEVICEORIENTATIONEVENT should be an alias for DeviceOrientationEvent.
Pass createEvent('DEVICEORIENTATIONEVENT') should be initialized correctly. Pass createEvent('DEVICEORIENTATIONEVENT') should be initialized correctly.
Pass Should throw NOT_SUPPORTED_ERR for pluralized legacy event interface "DeviceOrientationEvents" Pass Should throw NOT_SUPPORTED_ERR for pluralized legacy event interface "DeviceOrientationEvents"
Fail DragEvent should be an alias for DragEvent. Pass DragEvent should be an alias for DragEvent.
Pass createEvent('DragEvent') should be initialized correctly. Pass createEvent('DragEvent') should be initialized correctly.
Fail dragevent should be an alias for DragEvent. Pass dragevent should be an alias for DragEvent.
Pass createEvent('dragevent') should be initialized correctly. Pass createEvent('dragevent') should be initialized correctly.
Fail DRAGEVENT should be an alias for DragEvent. Pass DRAGEVENT should be an alias for DragEvent.
Pass createEvent('DRAGEVENT') should be initialized correctly. Pass createEvent('DRAGEVENT') should be initialized correctly.
Pass Should throw NOT_SUPPORTED_ERR for pluralized legacy event interface "DragEvents" Pass Should throw NOT_SUPPORTED_ERR for pluralized legacy event interface "DragEvents"
Pass Event should be an alias for Event. Pass Event should be an alias for Event.
@ -105,11 +105,11 @@ Pass mouseevents should be an alias for MouseEvent.
Pass createEvent('mouseevents') should be initialized correctly. Pass createEvent('mouseevents') should be initialized correctly.
Pass MOUSEEVENTS should be an alias for MouseEvent. Pass MOUSEEVENTS should be an alias for MouseEvent.
Pass createEvent('MOUSEEVENTS') should be initialized correctly. Pass createEvent('MOUSEEVENTS') should be initialized correctly.
Fail StorageEvent should be an alias for StorageEvent. Pass StorageEvent should be an alias for StorageEvent.
Pass createEvent('StorageEvent') should be initialized correctly. Pass createEvent('StorageEvent') should be initialized correctly.
Fail storageevent should be an alias for StorageEvent. Pass storageevent should be an alias for StorageEvent.
Pass createEvent('storageevent') should be initialized correctly. Pass createEvent('storageevent') should be initialized correctly.
Fail STORAGEEVENT should be an alias for StorageEvent. Pass STORAGEEVENT should be an alias for StorageEvent.
Pass createEvent('STORAGEEVENT') should be initialized correctly. Pass createEvent('STORAGEEVENT') should be initialized correctly.
Pass Should throw NOT_SUPPORTED_ERR for pluralized legacy event interface "StorageEvents" Pass Should throw NOT_SUPPORTED_ERR for pluralized legacy event interface "StorageEvents"
Pass SVGEvents should be an alias for Event. Pass SVGEvents should be an alias for Event.