mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
LibWeb: Implement MediaQueryList.onchange
This commit is contained in:
parent
61e9e80232
commit
46686f7f94
Notes:
sideshowbarker
2024-07-18 03:15:59 +09:00
Author: https://github.com/Lubrsi Commit: https://github.com/SerenityOS/serenity/commit/46686f7f94a Pull-request: https://github.com/SerenityOS/serenity/pull/10288 Reviewed-by: https://github.com/linusg ✅
@ -9,6 +9,7 @@
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/DOM/EventDispatcher.h>
|
||||
#include <LibWeb/DOM/EventListener.h>
|
||||
#include <LibWeb/HTML/EventHandler.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
||||
@ -65,4 +66,14 @@ void MediaQueryList::remove_listener(RefPtr<DOM::EventListener> listener)
|
||||
remove_event_listener(HTML::EventNames::change, listener);
|
||||
}
|
||||
|
||||
void MediaQueryList::set_onchange(HTML::EventHandler event_handler)
|
||||
{
|
||||
set_event_handler_attribute(HTML::EventNames::change, event_handler);
|
||||
}
|
||||
|
||||
HTML::EventHandler MediaQueryList::onchange()
|
||||
{
|
||||
return event_handler_attribute(HTML::EventNames::change);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -44,6 +44,9 @@ public:
|
||||
void add_listener(RefPtr<DOM::EventListener> listener);
|
||||
void remove_listener(RefPtr<DOM::EventListener> listener);
|
||||
|
||||
void set_onchange(HTML::EventHandler);
|
||||
HTML::EventHandler onchange();
|
||||
|
||||
private:
|
||||
MediaQueryList(DOM::Document&, String);
|
||||
|
||||
|
@ -2,8 +2,7 @@
|
||||
interface MediaQueryList : EventTarget {
|
||||
readonly attribute CSSOMString media;
|
||||
readonly attribute boolean matches;
|
||||
// TODO:
|
||||
undefined addListener(EventListener? callback);
|
||||
undefined removeListener(EventListener? callback);
|
||||
// attribute EventHandler onchange;
|
||||
attribute EventHandler onchange;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user