Bug 41425 - Negative shadow radius should make shadow properties invalid
Summary: Negative shadow radius should make shadow properties invalid
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: All OS X 10.5
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-30 13:17 PDT by Simon Fraser (smfr)
Modified: 2023-01-25 16:40 PST (History)
5 users (show)

See Also:


Attachments
test for negative values in box|text-shadow (871 bytes, text/html)
2023-01-25 16:39 PST, Karl Dubost
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2010-06-30 13:17:46 PDT
We should throw out box-shadow and text-shadow properties when the blur radius is negative; the rule should be considered invalid.
Comment 1 Ahmad Saleem 2022-07-23 07:24:42 PDT
https://wpt.fyi/results/css/css-backgrounds/box-shadow-radius-001.html?label=master&label=experimental&aligned&q=shadow-radius

It has box-shadow negative values coverage. Ignore my comment, if I am wrong. Thanks!
Comment 2 Karl Dubost 2023-01-25 16:39:49 PST
Created attachment 464659 [details]
test for negative values in box|text-shadow

The negative values in these tests are the spread-radius (4th value), not the border radius. Negative values are authorized on the 4th value.


https://developer.mozilla.org/en-US/docs/Web/CSS/box-shadow
box-shadow: offset-x | offset-y | blur-radius | spread-radius | color


3rd <length [0,∞]>
Specifies the blur radius. Negative values are invalid. If the blur value is zero, the shadow’s edge is sharp. Otherwise, the larger the value, the more the shadow’s edge is blurred. See Shadow Blurring, below.
— https://w3c.github.io/csswg-drafts/css-backgrounds/#box-shadow


https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow
text-shadow: offset-x | offset-y | blur-radius | color 
OR 
text-shadow: color | offset-x | offset-y | blur-radius


https://w3c.github.io/csswg-drafts/css-text-decor/#text-shadow-property 
doesn't really forbid the negative value apart a reference to the length where it says it can be problematic.

The story is slightly different in text-shadow 4
https://drafts.csswg.org/css-text-decor-4/#text-shadow-property

where it explicitly reference the box-shadow way of doing things. 
https://drafts.csswg.org/css-backgrounds-3/#typedef-shadow

I uploaded a test.

There's no styling going on when the values are negative. So probably this has been solved in the past. 

And we can also see this in the Web Inspector.