Bug 27417 - Add spread radius support to -webkit-box-shadow
: Add spread radius support to -webkit-box-shadow
Status: RESOLVED FIXED
Product: WebKit
Classification: Unclassified
Component: CSS
: 528+ (Nightly build)
: All All
: P2 Normal
Assigned To: mitz@webkit.org
: InRadar
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-07-18 15:23 PDT by mitz@webkit.org
Modified: 2011-01-20 00:14 PST (History)
1 user (show)

See Also:


Attachments
Patch (55.39 KB, patch)
2009-07-18 15:28 PDT, mitz@webkit.org
andersca: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mitz@webkit.org 2009-07-18 15:23:43 PDT
A spread radius component for box-shadow values is described in <http://www.w3.org/TR/2008/WD-css3-background-20080910/#the-box-shadow>.
Comment 1 mitz@webkit.org 2009-07-18 15:28:42 PDT
Created attachment 33030 [details]
Patch

Treatment of corner radii is deliberately different from Firefox’s. <http://www.w3.org/TR/2008/WD-css3-background-20080910/#the-box-shadow> says “ The shadow should not change shape when a spread radius is applied: sharp corners should remain sharp”, and this patch extrapolates this to not increasing the radius. Firefox makes a special case for the 0 radius by preserving it, while growing any positive radius by the spread radius, which does not make sense to me.
Comment 2 mitz@webkit.org 2009-07-18 15:32:26 PDT
<rdar://problem/7072267>
Comment 3 Anders Carlsson 2009-07-18 15:53:23 PDT
Comment on attachment 33030 [details]
Patch

r=me!
Comment 4 mitz@webkit.org 2009-07-18 15:59:46 PDT
Fixed in <http://trac.webkit.org/projects/webkit/changeset/46097>.
Comment 5 Hajime Morrita 2011-01-19 23:21:52 PST
Hi mitz, 
Trying fix Bug 49913, I find this bug describes the behavior reported 49913 is intentional.
But I have an objection... 

According to the spec [1], "The shadow should not change shape when a spread radius is applied", 
that means, in my understanding, the circle-shaped border makes circle-shaped shadow.
And Mozilla and Opera go that way [2].
I think scaling shadow radii based on spread is the right thing to do because it "optically" correct.

What do you think?

[1] http://www.w3.org/TR/2008/WD-css3-background-20080910/#box-shadow
[2] http://habrahabr.ru/blogs/css/103170/
Comment 6 mitz@webkit.org 2011-01-19 23:33:13 PST
I think that the language in the editor’s draft has changed in a way that it is no longer possible to reconcile the WebKit implementation with it. I still think the discontinuity at 0 is bizarre.

<http://dev.w3.org/cvsweb/~checkout~/csswg/css3-background/Overview.html?rev=1.237>
Comment 7 Hajime Morrita 2011-01-19 23:48:09 PST
(In reply to comment #6)
> I think that the language in the editor’s draft has changed in a way that it is no longer possible to reconcile the WebKit implementation with it. I still think the discontinuity at 0 is bizarre.
> 
> <http://dev.w3.org/cvsweb/~checkout~/csswg/css3-background/Overview.html?rev=1.237>

Mitz, thanks for your rapid feedback! I didn't know such a history.
Though I'm not sure whether I understand your concern about discontinuity,
I'll try something at Bug 49726.
(which is the canonical of Bug 49913 I mentioned at previous post.)
Comment 8 mitz@webkit.org 2011-01-19 23:55:09 PST
By “discontinuity” I mean that the rule applied to a border-radius value of 0 is different from that applied to any positive border-radius value. To me, this makes no sense.
Comment 9 Hajime Morrita 2011-01-20 00:14:03 PST
(In reply to comment #8)
> By “discontinuity” I mean that the rule applied to a border-radius value of 0 is different from that applied to any positive border-radius value. To me, this makes no sense.
I got it! We cannot increase nor decrease the radii in that case.