Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LibWeb: Styles inside @media are ignored if there is no query #1551

Open
aplefull opened this issue Sep 27, 2024 · 1 comment
Open

LibWeb: Styles inside @media are ignored if there is no query #1551

aplefull opened this issue Sep 27, 2024 · 1 comment
Labels
bug Something isn't working css has repro We have a way to reproduce this bug.

Comments

@aplefull
Copy link

I'm not sure if @media without actual query is valid but Chrome and Firefox seem to apply styles anyway. This reduction also comes from a real website iirc, so things like that exist in the wild.

Example:

<style>
    @media {
        body {
            background-color: crimson;
        }
    }
</style>
Chrome/Firefox Ladybird

image

image

@AtkinsSJ
Copy link
Member

Thanks! Spec says that it is indeed valid, so this is a bug in our implementation:

An empty media query list evaluates to true.
For example, these are equivalent:

@media all { … }
@media { … }
https://www.w3.org/TR/mediaqueries-5/#mq-list

@AtkinsSJ AtkinsSJ added bug Something isn't working has repro We have a way to reproduce this bug. css labels Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working css has repro We have a way to reproduce this bug.
Projects
None yet
Development

No branches or pull requests

2 participants