Incorrect "Invalid Property Value" for custom property with a single whitespace token
Categories
(DevTools :: Inspector: Rules, defect, P3)
Tracking
(Not tracked)
People
(Reporter: James0x57, Unassigned)
References
Details
Attachments
(3 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0
Steps to reproduce:
Any custom CSS property who's value is a single whitespace token is incorrectly flagged as "Invalid Property Value"
--foo: ;
Actual results:
dev tools shows the property as invalid
Expected results:
a single whitespace token is a valid value so it should not be flagged as invalid:
https://www.w3.org/TR/css-variables-1/#syntax
see the 3rd note there ^, quoted here:
Note: While <declaration-value> must represent at least one token, that one token may be whitespace. This implies that --foo: ; is valid, and the corresponding var(--foo) call would have a single space as its substitution value, but --foo:; is invalid.
If it helps, here is markup you can use to verify:
<html>
<head></head>
<body style="--foo: ; --bar: ;"></body>
</html>
inspect the body tag to see the bug
Updated•5 years ago
|
Comment 2•5 years ago
|
||
Resetting severity to default of --
.
Comment 3•5 years ago
|
||
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•2 years ago
|
This appears to be fixed?
I've just stumbled upon the test case I made for this 5 years ago and there doesn't seem to be any issue in DevTools anymore (what it looked like in 2020).
Comment 6•4 days ago
|
||
(In reply to Ana Tudor from comment #5)
Created attachment 9463448 [details]
February 2025 screenshotThis appears to be fixed?
I've just stumbled upon the test case I made for this 5 years ago and there doesn't seem to be any issue in DevTools anymore (what it looked like in 2020).
Hello Ana 👋
yes, it looks like this was fixed, probably by Bug 1713787, I'm going to close this bug
We also fixed a few other things around empty custom properties in the inspector (e.g. Bug 1912263)
Description
•