Skip to content

Commit 1e9e869

Browse files
committed
Make definitions of spread and blur radii more compatible with actual blur and spread operations
1 parent e84b892 commit 1e9e869

2 files changed

Lines changed: 63 additions & 48 deletions

File tree

css3-background/Overview.html

Lines changed: 35 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222

2323
<h1>CSS Backgrounds and Borders Module Level 3</h1>
2424

25-
<h2 class="no-num no-toc" id=longstatus-date>W3C Working Draft 10 June
25+
<h2 class="no-num no-toc" id=longstatus-date>W3C Working Draft 12 June
2626
2010</h2>
2727

2828
<dl>
2929
<dt>This version:
3030

3131
<dd><a
32-
href="http://www.w3.org/TR/2010/WD-css3-background-20100610">http://www.w3.org/TR/2010/WD-css3-background-20100610</a>
32+
href="http://www.w3.org/TR/2010/WD-css3-background-20100612">http://www.w3.org/TR/2010/WD-css3-background-20100612</a>
3333
<!--<a href="http://dev.w3.org/csswg/css3-background">http://dev.w3.org/csswg/css3-background</a>-->
3434

3535

@@ -3724,11 +3724,11 @@ <h3 id=the-box-shadow><span class=secno>6.2. </span>The &lsquo;<a
37243724
the blur radius is zero, the shadow's edge is sharp. Otherwise, the
37253725
larger the value, the more the shadow's edge is blurred. See below.
37263726

3727-
<li>The fourth length is a spread. Positive values cause the shadow shape
3728-
to expand in all directions by the specified radius. Negative values
3729-
cause the shadow shape to contract. See below. <span class=note>Note that
3730-
for inner shadows, expanding the shadow (creating more shadow area) means
3731-
contracting the shadow's perimeter shape.</span>
3727+
<li>The fourth length is a spread radius. Positive values cause the shadow
3728+
shape to expand in all directions by the specified radius. Negative
3729+
values cause the shadow shape to contract. See below. <span
3730+
class=note>Note that for inner shadows, expanding the shadow (creating
3731+
more shadow area) means contracting the shadow's perimeter shape.</span>
37323732

37333733
<li>The color is the color of the shadow.
37343734

@@ -3740,12 +3740,12 @@ <h3 id=the-box-shadow><span class=secno>6.2. </span>The &lsquo;<a
37403740
</ul>
37413741

37423742
<p>An outer box-shadow casts a shadow as if the border-box of the element
3743-
were opaque. The shadow is drawn outside the border edge only: it is not
3744-
drawn inside the border-box of the element.
3743+
were opaque. The shadow is drawn outside the border edge only: it is
3744+
clipped inside the border-box of the element.
37453745

37463746
<p>An inner box-shadow casts a shadow as if everything outside the padding
37473747
edge were opaque. The inner shadow is drawn inside the padding edge only:
3748-
it is not drawn outside the padding box of the element.
3748+
it is clipped outside the padding box of the element.
37493749

37503750
<p>If the box has a nonzero <span class=property>&lsquo;<a
37513751
href="#border-radius"><code
@@ -3754,24 +3754,32 @@ <h3 id=the-box-shadow><span class=secno>6.2. </span>The &lsquo;<a
37543754
class=property>border-image</code></a>&rsquo; does not affect the shape of
37553755
the box-shadow.
37563756

3757-
<p>If a spread is defined, the shadow is expanded by an outward outset of
3758-
the specified amount normal to the original shadow perimeter. For corners
3759-
with a zero border-radius (i.e. where the normal is not defined), the
3760-
corner remains sharp&#8212;the operation is equivalent to scaling the
3761-
shadow shape. The UA may approximate the transformed shadow perimeter
3762-
shape by outsetting (insetting, for inner shadows) the shadow's straight
3763-
edges by the spread distance and increasing (decreasing, for inner
3764-
shadows) and flooring at zero the corner radii by the same amount. In
3765-
either case, the effective width and height of the shadow shape is floored
3766-
at zero. (A zero-sized shadow shape would cause an outer shadow to
3767-
disappear, and an inner shadow to cover the entire padding-box.)
3768-
3769-
<p>The blur radius is perpendicular to and centered on the shadow's edge
3770-
and defines a gradient color transition ranging from the full shadow color
3757+
<p>If a spread radius is defined, the shadow is expanded outward by an
3758+
operation equivalent to applying the absolute value of the spread radius
3759+
to a blur operation as defined below and thresholding the result such for
3760+
a positive spread radius all non-transparent pixels are given the full
3761+
shadow color and for a negative spread radius all non-opaque pixels are
3762+
made transparent. The UA may approximate this operation by taking an
3763+
outward outset of the specified amount normal to the original shadow
3764+
perimeter. Alternatively the UA may approximate the transformed shadow
3765+
perimeter shape by outsetting (insetting, for inner shadows) the shadow's
3766+
straight edges by the spread distance and increasing (decreasing, for
3767+
inner shadows) and flooring at zero the corner radii by the same amount.
3768+
(The UA may even combine these methods, using one method for outer shadows
3769+
and another for inner ones.) For corners with a zero border-radius,
3770+
however, the corner must remain sharp&#8212;the operation is equivalent to
3771+
scaling the shadow shape. In any case, the effective width and height of
3772+
the shadow shape is floored at zero. (A zero-sized shadow shape would
3773+
cause an outer shadow to disappear, and an inner shadow to cover the
3774+
entire padding-box.)
3775+
3776+
<p>A positive blur radius indicates that the resulting shadow should be
3777+
blurred, such as by a Gaussian filter. The exact algorithm is not defined;
3778+
however for a long, straight shadow edge, this should create a color
3779+
transition the length of the blur radius that is perpendicular to and
3780+
centered on the shadow's edge, and that ranges from the full shadow color
37713781
at the radius endpoint inside the shadow to fully transparent at the
3772-
endpoint outside it. <span class=issue>Is this the correct definition for
3773-
blur radius? Also, is there a better term for it?</span> The exact
3774-
algorithm for the blur transition is not specified.
3782+
endpoint outside it.
37753783

37763784
<div class=example>
37773785
<p>The example below demonstrates the effects of spread and blur on the

css3-background/Overview.src.html

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2692,7 +2692,7 @@ <h3 id="the-box-shadow">The 'box-shadow' property</h3>
26922692
Otherwise, the larger the value, the more the shadow's edge is
26932693
blurred. See below.
26942694

2695-
<li>The fourth length is a spread. Positive values cause
2695+
<li>The fourth length is a spread radius. Positive values cause
26962696
the shadow shape to expand in all directions by the specified
26972697
radius. Negative values cause the shadow shape to contract.
26982698
See below.
@@ -2711,36 +2711,43 @@ <h3 id="the-box-shadow">The 'box-shadow' property</h3>
27112711

27122712
<p>An outer box-shadow casts a shadow as if the border-box of the element
27132713
were opaque. The shadow is drawn outside the border edge only: it is
2714-
not drawn inside the border-box of the element.
2714+
clipped inside the border-box of the element.
27152715

27162716
<p>An inner box-shadow casts a shadow as if everything outside the padding
27172717
edge were opaque. The inner shadow is drawn inside the padding edge only:
2718-
it is not drawn outside the padding box of the element.
2718+
it is clipped outside the padding box of the element.
27192719

27202720
<p>If the box has a nonzero <span class="property">'border-radius'</span>,
27212721
the shadow shape is rounded in the same way. The 'border-image' does not
27222722
affect the shape of the box-shadow.
27232723

2724-
<p>If a spread is defined, the shadow is expanded by an outward
2725-
outset of the specified amount normal to the original shadow perimeter.
2726-
For corners with a zero border-radius (i.e. where the normal is not
2727-
defined), the corner remains sharp&#8212;the operation is equivalent to
2728-
scaling the shadow shape.
2729-
The UA may approximate the transformed shadow perimeter shape by
2724+
<p>If a spread radius is defined, the shadow is expanded outward by an
2725+
operation equivalent to applying the absolute value of the spread radius
2726+
to a blur operation as defined below and thresholding the result such
2727+
for a positive spread radius all non-transparent pixels are given the
2728+
full shadow color and for a negative spread radius all non-opaque pixels
2729+
are made transparent.
2730+
The UA may approximate this operation by taking an outward outset of the
2731+
specified amount normal to the original shadow perimeter. Alternatively
2732+
the UA may approximate the transformed shadow perimeter shape by
27302733
outsetting (insetting, for inner shadows) the shadow's straight edges
27312734
by the spread distance and increasing (decreasing, for inner shadows)
2732-
and flooring at zero the corner radii by the same amount. In either
2733-
case, the effective width and height of the shadow shape is floored
2734-
at zero. (A zero-sized shadow shape would cause an outer shadow to
2735-
disappear, and an inner shadow to cover the entire padding-box.)
2736-
2737-
<p>The blur radius is perpendicular to and centered on the shadow's
2738-
edge and defines a gradient color transition ranging from the full
2739-
shadow color at the radius endpoint inside the shadow to
2740-
fully transparent at the endpoint outside it. <span class="issue">Is
2741-
this the correct definition for blur radius? Also, is there a better
2742-
term for it?</span>
2743-
The exact algorithm for the blur transition is not specified.
2735+
and flooring at zero the corner radii by the same amount. (The UA may
2736+
even combine these methods, using one method for outer shadows and
2737+
another for inner ones.)
2738+
For corners with a zero border-radius, however, the corner must remain
2739+
sharp&#8212;the operation is equivalent to scaling the shadow shape.
2740+
In any case, the effective width and height of the shadow shape is
2741+
floored at zero. (A zero-sized shadow shape would cause an outer shadow
2742+
to disappear, and an inner shadow to cover the entire padding-box.)
2743+
2744+
<p>A positive blur radius indicates that the resulting shadow should
2745+
be blurred, such as by a Gaussian filter. The exact algorithm is not
2746+
defined; however for a long, straight shadow edge, this should create
2747+
a color transition the length of the blur radius that is perpendicular
2748+
to and centered on the shadow's edge, and that ranges from the full
2749+
shadow color at the radius endpoint inside the shadow to fully
2750+
transparent at the endpoint outside it.
27442751

27452752
<div class="example">
27462753
<p>The example below demonstrates the effects of spread and blur

0 commit comments

Comments
 (0)