1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:47:35 +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:
Sam Atkins 2021-10-04 17:41:35 +01:00 committed by Andreas Kling
parent 1c829e0417
commit 050823bea7
10 changed files with 122 additions and 2 deletions

View file

@ -303,6 +303,9 @@ public:
void run_the_resize_steps();
void evaluate_media_queries_and_report_changes();
void add_media_query_list(NonnullRefPtr<CSS::MediaQueryList>&);
private:
explicit Document(const AK::URL&);
@ -393,6 +396,9 @@ private:
// Used by run_the_resize_steps().
Gfx::IntSize m_last_viewport_size;
// Used by evaluate_media_queries_and_report_changes().
Vector<WeakPtr<CSS::MediaQueryList>> m_media_query_lists;
};
}