ladybird icon indicating copy to clipboard operation
ladybird copied to clipboard

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

Open aplefull opened this issue 1 year ago • 1 comments

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

aplefull avatar Sep 27 '24 15:09 aplefull

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 avatar Sep 27 '24 15:09 AtkinsSJ