1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:27:34 +00:00

LibWeb: Implement MediaQuery matching :^)

Currently, `evaluate()` recalculates whether the MediaQuery matches or
not, and stores it in `m_matches`, which users can query using
`matches()`. This allows us to know when the match-state changes, which
is required to fire MediaQueryList's change event.
This commit is contained in:
Sam Atkins 2021-10-03 19:39:48 +01:00 committed by Andreas Kling
parent f354fd72f1
commit 1c829e0417
6 changed files with 163 additions and 1 deletions

View file

@ -29,6 +29,9 @@ public:
void append_medium(String);
void delete_medium(String);
bool evaluate(DOM::Window const&);
bool matches() const;
private:
explicit MediaList(NonnullRefPtrVector<MediaQuery>&&);