Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LibWeb/CSS: Create a MediaQueryListEvent when calling MQLE::create() #3015

Merged
merged 1 commit into from
Dec 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Libraries/LibWeb/CSS/MediaQueryListEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ namespace Web::CSS {

GC_DEFINE_ALLOCATOR(MediaQueryListEvent);

GC::Ref<MediaQueryListEvent> MediaQueryListEvent::create(JS::Realm& realm, FlyString const& event_name, MediaQueryListEventInit const& event_init)
{
auto event = realm.create<MediaQueryListEvent>(realm, event_name, event_init);
event->set_is_trusted(true);
return event;
}

GC::Ref<MediaQueryListEvent> MediaQueryListEvent::construct_impl(JS::Realm& realm, FlyString const& event_name, MediaQueryListEventInit const& event_init)
{
return realm.create<MediaQueryListEvent>(realm, event_name, event_init);
Expand Down
1 change: 1 addition & 0 deletions Libraries/LibWeb/CSS/MediaQueryListEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class MediaQueryListEvent final : public DOM::Event {
GC_DECLARE_ALLOCATOR(MediaQueryListEvent);

public:
[[nodiscard]] static GC::Ref<MediaQueryListEvent> create(JS::Realm&, FlyString const& event_name, MediaQueryListEventInit const& = {});
[[nodiscard]] static GC::Ref<MediaQueryListEvent> construct_impl(JS::Realm&, FlyString const& event_name, MediaQueryListEventInit const& = {});

virtual ~MediaQueryListEvent() override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ Harness status: OK

Found 6 tests

3 Pass
3 Fail
Fail calls handleEvent method of event listener
4 Pass
2 Fail
Pass calls handleEvent method of event listener
Pass looks up handleEvent method on every event dispatch
Pass doesn't look up handleEvent method on callable event listeners
Pass rethrows errors when getting handleEvent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ Harness status: OK

Found 8 tests

7 Pass
1 Fail
8 Pass
Pass EventListener parameter is optional
Fail listeners are called when <iframe> is resized
Pass listeners are called when <iframe> is resized
Pass listeners are called correct number of times
Pass listeners are called in order they were added
Pass listener that was added twice is called only once
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ Harness status: OK

Found 7 tests

6 Pass
1 Fail
Fail onchange adds listener
7 Pass
Pass onchange adds listener
Pass onchange removes listener
Pass listeners for "change" type are called
Pass listeners with different type are not called
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ Harness status: OK

Found 6 tests

3 Pass
3 Fail
6 Pass
Pass type can be different from "change"
Pass init dictionary default values
Pass init dictionary overrides
Fail argument of addListener
Fail argument of onchange
Fail constructor of "change" event
Pass argument of addListener
Pass argument of onchange
Pass constructor of "change" event
Loading