mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:27:45 +00:00
LibWeb: Evaluate @media
rules
We now evaluate the conditions of `@media` rules at the same point in the HTML event loop as evaluation of `MediaQueryList`s. This is not strictly to spec, but since the spec doesn't actually say when to do this, it seems to make the most sense. In any case, it works! :^)
This commit is contained in:
parent
57a25139a5
commit
5098cd22a4
8 changed files with 47 additions and 2 deletions
|
@ -1156,6 +1156,11 @@ void Document::evaluate_media_queries_and_report_changes()
|
|||
media_query_list->dispatch_event(event);
|
||||
}
|
||||
}
|
||||
|
||||
// Also not in the spec, but this is as good a place as any to evaluate @media rules!
|
||||
for (auto& style_sheet : style_sheets().sheets()) {
|
||||
style_sheet.evaluate_media_queries(window());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue