mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 00:17:45 +00:00
LibWeb: Fire MediaQueryListEvents when an MQL's match-state changes
The HTML event loop does a check for MQL match-state changes and dispatches the events. This requires us to keep a list of MQLs on the Document.
This commit is contained in:
parent
1c829e0417
commit
050823bea7
10 changed files with 122 additions and 2 deletions
|
@ -10,6 +10,7 @@
|
|||
#include <LibWeb/Bindings/EventWrapper.h>
|
||||
#include <LibWeb/Bindings/EventWrapperFactory.h>
|
||||
#include <LibWeb/Bindings/KeyboardEventWrapper.h>
|
||||
#include <LibWeb/Bindings/MediaQueryListEventWrapper.h>
|
||||
#include <LibWeb/Bindings/MessageEventWrapper.h>
|
||||
#include <LibWeb/Bindings/MouseEventWrapper.h>
|
||||
#include <LibWeb/Bindings/PageTransitionEventWrapper.h>
|
||||
|
@ -22,6 +23,8 @@ EventWrapper* wrap(JS::GlobalObject& global_object, DOM::Event& event)
|
|||
{
|
||||
if (is<DOM::CustomEvent>(event))
|
||||
return static_cast<CustomEventWrapper*>(wrap_impl(global_object, static_cast<DOM::CustomEvent&>(event)));
|
||||
if (is<CSS::MediaQueryListEvent>(event))
|
||||
return static_cast<MediaQueryListEventWrapper*>(wrap_impl(global_object, static_cast<CSS::MediaQueryListEvent&>(event)));
|
||||
if (is<HTML::CloseEvent>(event))
|
||||
return static_cast<CloseEventWrapper*>(wrap_impl(global_object, static_cast<HTML::CloseEvent&>(event)));
|
||||
if (is<HTML::MessageEvent>(event))
|
||||
|
|
|
@ -204,6 +204,8 @@
|
|||
#include <LibWeb/Bindings/ImageDataConstructor.h>
|
||||
#include <LibWeb/Bindings/ImageDataPrototype.h>
|
||||
#include <LibWeb/Bindings/MediaQueryListConstructor.h>
|
||||
#include <LibWeb/Bindings/MediaQueryListEventConstructor.h>
|
||||
#include <LibWeb/Bindings/MediaQueryListEventPrototype.h>
|
||||
#include <LibWeb/Bindings/MediaQueryListPrototype.h>
|
||||
#include <LibWeb/Bindings/MessageChannelConstructor.h>
|
||||
#include <LibWeb/Bindings/MessageChannelPrototype.h>
|
||||
|
@ -371,6 +373,7 @@
|
|||
ADD_WINDOW_OBJECT_INTERFACE(HTMLVideoElement) \
|
||||
ADD_WINDOW_OBJECT_INTERFACE(ImageData) \
|
||||
ADD_WINDOW_OBJECT_INTERFACE(MediaQueryList) \
|
||||
ADD_WINDOW_OBJECT_INTERFACE(MediaQueryListEvent) \
|
||||
ADD_WINDOW_OBJECT_INTERFACE(MessageChannel) \
|
||||
ADD_WINDOW_OBJECT_INTERFACE(MessageEvent) \
|
||||
ADD_WINDOW_OBJECT_INTERFACE(MouseEvent) \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue