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: Border with undefined var() renders default black border, unlike other browsers #3202

Open
1 task
aplefull opened this issue Jan 9, 2025 · 1 comment

Comments

@aplefull
Copy link

aplefull commented Jan 9, 2025

Summary

See reduced test case and screenshots.
I tried to read through the spec to figure out what's going on here, but I'm left quite confused...

From spec:

When a custom property’s value is the guaranteed-invalid value, var() functions cannot use it for substitution. Attempting to do so makes the declaration invalid at computed-value time, unless a valid fallback is specified.

So I assumed that the entire declaration should be dropped. But, reading further, in Example 15, we see that var() should be substituted with the unset keyword. Not sure what would be the correct behavior here, so I'm leaving figuring this out to someone who actually knows what he is doing :^)

Operating system

Linux

Steps to reproduce

N/A

Expected behavior

Border shouldn't show up at all

Actual behavior

It's rendered

URL for a reduced test case

N/A

HTML/SVG/etc. source for a reduced test case

<style>
    body {
        border: solid 10px var(--nope);
    }
</style>

Log output and (if possible) backtrace

N/A

Screenshots or screen recordings

Chrome Ladybird

image

image

Build flags or config settings

No response

Contribute a patch?

  • I’ll contribute a patch for this myself.
@Psychpsyo
Copy link
Contributor

Psychpsyo commented Jan 9, 2025

The example 15 from the spec you cited does not apply here since --not-a-color has a value of 20px in it, instead of the guaranteed-invalid value, which is what a CSS variable is set to initially, before you assign anything to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants