Bug 49726 - box-shadow radii stays the same regardless of any spread set
Summary: box-shadow radii stays the same regardless of any spread set
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.6
: P2 Normal
Assignee: Nobody
URL: http://jsfiddle.net/leaverou/XmK8J/
Keywords:
: 49913 57258 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-11-18 05:12 PST by Lea Verou
Modified: 2011-04-08 13:50 PDT (History)
5 users (show)

See Also:


Attachments
Testcase with negative spread (512 bytes, text/html)
2010-12-21 20:23 PST, Simon Fraser (smfr)
no flags Details
Patch (219.69 KB, patch)
2011-01-20 05:10 PST, Hajime Morrita
no flags Details | Formatted Diff | Diff
Patch (122.77 KB, patch)
2011-03-30 15:39 PDT, Hajime Morrita
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lea Verou 2010-11-18 05:12:20 PST
From Backgrounds & Borders: (http://www.w3.org/TR/2010/WD-css3-background-20100612/#the-box-shadow)
"If a spread distance is defined, the shadow is expanded outward or contracted inward by an operation equivalent to applying twice the absolute value of the spread value to a blur operation as defined below and thresholding the result such that for a positive spread distance all non-transparent pixels are given the full shadow color and for a negative spread distance all non-opaque pixels are made transparent. The UA may approximate this operation by taking an outward outset of the specified amount normal to the original shadow perimeter. Alternatively the UA may approximate the transformed shadow perimeter shape by outsetting (insetting, for inner shadows) the shadow's straight edges by the spread distance and increasing (decreasing, for inner shadows) and flooring at zero the corner radii by the same amount. (The UA may even combine these methods, using one method for outer shadows and another for inner ones.)"

In Gecko & Presto the corner radii is adjusted accordingly. In Webkit, it stays the same as the radii of the outer edge of the border. This only happens with outset shadows, as you can see in the 3rd div, inset shadows are rendered just fine.

(Originally discovered by David DeSandro, although I did a search and I don't think there's another bug report on this.)
Comment 1 Simon Fraser (smfr) 2010-12-11 19:30:08 PST
Is this still an issue? It's hard to tell from the url.
Comment 2 Lea Verou 2010-12-12 03:00:04 PST
Yes it is.
Comment 3 Simon Fraser (smfr) 2010-12-21 20:23:19 PST
*** Bug 51386 has been marked as a duplicate of this bug. ***
Comment 4 Simon Fraser (smfr) 2010-12-21 20:23:38 PST
Created attachment 77182 [details]
Testcase with negative spread
Comment 5 Hajime Morrita 2010-12-23 22:15:45 PST
*** Bug 49913 has been marked as a duplicate of this bug. ***
Comment 6 Hajime Morrita 2011-01-20 05:10:47 PST
Created attachment 79583 [details]
Patch
Comment 7 Hajime Morrita 2011-01-20 05:14:38 PST
Hi mitz, as discussed at Bug 27417, I change the border-radius behavior in this patch.
Could you take a look when you have time?
Comment 8 Hajime Morrita 2011-01-23 17:19:13 PST
ping?
Comment 9 Simon Fraser (smfr) 2011-03-28 12:40:06 PDT
Patch no longer applies.
Comment 10 Simon Fraser (smfr) 2011-03-28 12:42:06 PDT
*** Bug 57258 has been marked as a duplicate of this bug. ***
Comment 11 Hajime Morrita 2011-03-30 15:39:27 PDT
Created attachment 87630 [details]
Patch
Comment 12 Hajime Morrita 2011-03-30 15:40:31 PDT
Hi Simon, thank you for trying this!
I just updated the patch to ToT. Could you take a review for this when you have time?
Thanks in advance.
Comment 13 Simon Fraser (smfr) 2011-03-30 15:56:32 PDT
Comment on attachment 87630 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=87630&action=review

> LayoutTests/fast/box-shadow/spread-multiple-inset.html:1
> +<html>

Could you fix the test so that the boxes don't overlap?
Comment 14 Hajime Morrita 2011-03-30 16:35:28 PDT
(In reply to comment #13)
> (From update of attachment 87630 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=87630&action=review
> 
> > LayoutTests/fast/box-shadow/spread-multiple-inset.html:1
> > +<html>
> 
> Could you fix the test so that the boxes don't overlap?
Sure! I'll fix this and land the patch shortly.
Comment 15 Hajime Morrita 2011-03-30 16:56:41 PDT
Committed r82520: <http://trac.webkit.org/changeset/82520>
Comment 16 Simon Fraser (smfr) 2011-04-08 13:49:16 PDT
I think this may have regressed the 6th box in LayoutTests/fast/box-shadow/inset-box-shadows.html
Comment 17 Simon Fraser (smfr) 2011-04-08 13:50:18 PDT
I filed bug 58162.