mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +00:00
LibWeb: Use GCPtr in MediaQueryList
This commit is contained in:
parent
4dd14d812f
commit
213155ad7d
Notes:
github-actions[bot]
2024-11-13 14:00:16 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/213155ad7d2 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2313 Reviewed-by: https://github.com/gmta ✅
2 changed files with 4 additions and 4 deletions
|
@ -80,7 +80,7 @@ bool MediaQueryList::evaluate()
|
|||
}
|
||||
|
||||
// https://www.w3.org/TR/cssom-view/#dom-mediaquerylist-addlistener
|
||||
void MediaQueryList::add_listener(DOM::IDLEventListener* listener)
|
||||
void MediaQueryList::add_listener(JS::GCPtr<DOM::IDLEventListener> listener)
|
||||
{
|
||||
// 1. If listener is null, terminate these steps.
|
||||
if (!listener)
|
||||
|
@ -94,7 +94,7 @@ void MediaQueryList::add_listener(DOM::IDLEventListener* listener)
|
|||
}
|
||||
|
||||
// https://www.w3.org/TR/cssom-view/#dom-mediaquerylist-removelistener
|
||||
void MediaQueryList::remove_listener(DOM::IDLEventListener* listener)
|
||||
void MediaQueryList::remove_listener(JS::GCPtr<DOM::IDLEventListener> listener)
|
||||
{
|
||||
// 1. Remove an event listener from the associated list of event listeners, whose type is change, callback is listener, and capture is false.
|
||||
// NOTE: While the spec doesn't technically use remove_event_listener and instead manipulates the list directly, every major engine uses remove_event_listener.
|
||||
|
|
|
@ -26,8 +26,8 @@ public:
|
|||
bool matches() const;
|
||||
bool evaluate();
|
||||
|
||||
void add_listener(DOM::IDLEventListener*);
|
||||
void remove_listener(DOM::IDLEventListener*);
|
||||
void add_listener(JS::GCPtr<DOM::IDLEventListener>);
|
||||
void remove_listener(JS::GCPtr<DOM::IDLEventListener>);
|
||||
|
||||
void set_onchange(WebIDL::CallbackType*);
|
||||
WebIDL::CallbackType* onchange();
|
||||
|
|
Loading…
Reference in a new issue