mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-25 11:48:06 +00:00
LibWeb: Implement generic boolean logic for media/supports queries
CSS Values 5 now defines a `<boolean-expr[]>` type that is used in place of the bespoke grammar that previously existed for `@media` and `@supports` queries. This commit implements some BooleanExpression types to represent the nodes in a `<boolean-expr[]>`, and reimplements `@media` and `@supports` queries using this. The one part of this implementation I'm not convinced on is that the `evaluate()` methods take a `HTML::Window*`. This is a compromise because `@media` requires a Window, and `@supports` does not require anything at all. As more users of `<boolean-expr[]>` get implemented in the future, it will become clear if this is sufficient, or if we need to do something smarter. As a bonus, this actually improves our serialization of media queries!
This commit is contained in:
parent
84a695c958
commit
0f5e054f97
Notes:
github-actions[bot]
2025-03-17 10:01:42 +00:00
Author: https://github.com/AtkinsSJ
Commit: 0f5e054f97
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3941
13 changed files with 526 additions and 663 deletions
|
@ -1,6 +1,6 @@
|
|||
@media screen {
|
||||
}
|
||||
@media screen and ((min-width: 20px) and (max-width: 40px)) {
|
||||
@media screen and (min-width: 20px) and (max-width: 40px) {
|
||||
}
|
||||
@media screen and (min-resolution: 1dppx) {
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue