Skip to content

Commit c921985

Browse files
committed
Shift spread an blur definitions to below the list, to make the spec easier to understand for authors and to make the shape definitions flow in chronological order. Also attempted to make prose clearer, and added explicit text for degenerate shadows.
1 parent bc9e16a commit c921985

3 files changed

Lines changed: 76 additions & 50 deletions

File tree

css3-background/Overview.html

Lines changed: 38 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222

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

25-
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 5 May 2010</h2>
25+
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 3 June 2010</h2>
2626

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

30-
<dd><!--<a href="http://www.w3.org/TR/2010/WD-css3-background-20100505">http://www.w3.org/TR/2010/ED-css3-background-20100505</a>-->
30+
<dd><!--<a href="http://www.w3.org/TR/2010/WD-css3-background-20100603">http://www.w3.org/TR/2010/ED-css3-background-20100603</a>-->
3131
<a
3232
href="http://dev.w3.org/csswg/css3-background">http://dev.w3.org/csswg/css3-background</a>
3333

@@ -3704,27 +3704,15 @@ <h3 id=the-box-shadow><span class=secno>6.2. </span>The &lsquo;<a
37043704
<li>The second length is the vertical offset. A positive value offsets the
37053705
shadow down, a negative one up.
37063706

3707-
<li>The third length is a blur radius. Negative values are not allowed.
3708-
The blur radius is perpendicular to and centered on the shadow's edge and
3709-
defines a gradient color transition ranging from the full shadow color at
3710-
the radius endpoint inside the shadow to fully transparent at the
3711-
endpoint outside it: if the blur radius is 0, the shadow's edge is sharp,
3712-
otherwise the larger the value, the more the shadow is blurred. The exact
3713-
algorithm for the blur transition is not specified.
3707+
<li>The third length is a blur radius. Negative values are not allowed. If
3708+
the blur radius is zero, the shadow's edge is sharp. Otherwise, the
3709+
larger the value, the more the shadow's edge is blurred. See below.
37143710

37153711
<li>The fourth length is a spread radius. Positive values cause the shadow
37163712
shape to expand in all directions by the specified radius. Negative
3717-
values cause the shadow shape to contract. For corners with a zero
3718-
border-radius, the corner remains sharp. Otherwise the spread radius
3719-
outsets the edge of the shadow by the amount of the spread radius in the
3720-
direction perpendicular to the shadow's edge. <span class=note>Note that
3721-
for inner shadows, expanding the shadow means shrinking the shadow's
3722-
perimeter.</span> The UA may approximate the spread shape by outsetting
3723-
(insetting, for inner shadows) the shadow's straight edges by the spread
3724-
radius and increasing (decreasing, for inner shadows) and flooring at
3725-
zero the corner radii by the same amount. If both a blur radius and a
3726-
spread radius are defined, the blur is applied to the resulting shape
3727-
after the spread is applied.
3713+
values cause the shadow shape to contract. See below. <span
3714+
class=note>Note that for inner shadows, expanding the shadow (creating
3715+
more shadow area) means contracting the shadow's perimeter shape.</span>
37283716

37293717
<li>The color is the color of the shadow.
37303718

@@ -3745,15 +3733,35 @@ <h3 id=the-box-shadow><span class=secno>6.2. </span>The &lsquo;<a
37453733

37463734
<p>If the box has a nonzero <span class=property>&lsquo;<a
37473735
href="#border-radius"><code
3748-
class=property>border-radius</code></a>&rsquo;</span>, the shadow is
3736+
class=property>border-radius</code></a>&rsquo;</span>, the shadow shape is
37493737
rounded in the same way. The &lsquo;<a href="#border-image"><code
37503738
class=property>border-image</code></a>&rsquo; does not affect the shape of
37513739
the box-shadow.
37523740

3753-
<p>If an element has multiple boxes, all of them get drop shadows, but
3754-
shadows are only drawn where borders would also be drawn; see &lsquo;<a
3755-
href="#box-decoration-break"><code
3756-
class=property>box-decoration-break</code></a>&rsquo;.
3741+
<p>If a spread radius is defined, it increases the size of the shadow in
3742+
the direction normal to the shadow's edge by the specified amount.
3743+
However, for corners with a zero border-radius, the corner remains sharp,
3744+
i.e. the operation is equivalent to scaling the border-box. The UA may
3745+
approximate the transformed shadow perimeter shape by outsetting
3746+
(insetting, for inner shadows) the shadow's straight edges by the spread
3747+
radius and increasing (decreasing, for inner shadows) and flooring at zero
3748+
the corner radii by the same amount. In either case, the effective width
3749+
and height of the shadow shape is floored at zero. (A zero-sized shadow
3750+
shape would cause an outer shadow to disappear, and an inner shadow to
3751+
cover the entire padding-box.)
3752+
3753+
<p>The blur radius is perpendicular to and centered on the shadow's edge
3754+
and defines a gradient color transition ranging from the full shadow color
3755+
at the radius endpoint inside the shadow to fully transparent at the
3756+
endpoint outside it. The exact algorithm for the blur transition is not
3757+
specified.
3758+
3759+
<div class=example>
3760+
<p>The example below demonstrates the effects of the spread and blur radii
3761+
on the shadow:</p>
3762+
3763+
<p class=figure> <img src=spread-blur.png></p>
3764+
</div>
37573765

37583766
<p>The shadow effects are applied front-to-back: the first shadow is on top
37593767
and the others are layered behind. Shadows do not influence layout and may
@@ -3763,6 +3771,11 @@ <h3 id=the-box-shadow><span class=secno>6.2. </span>The &lsquo;<a
37633771
are drawn immediately above the background of that element (below the
37643772
borders and border image, if any).
37653773

3774+
<p>If an element has multiple boxes, all of them get drop shadows, but
3775+
shadows are only drawn where borders would also be drawn; see &lsquo;<a
3776+
href="#box-decoration-break"><code
3777+
class=property>box-decoration-break</code></a>&rsquo;.
3778+
37663779
<p>Shadows do not trigger scrolling or increase the size of the scrollable
37673780
area.
37683781

css3-background/Overview.src.html

Lines changed: 38 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2681,30 +2681,17 @@ <h3 id="the-box-shadow">The 'box-shadow' property</h3>
26812681
offsets the shadow down, a negative one up.
26822682

26832683
<li>The third length is a blur radius. Negative values are not
2684-
allowed. The blur radius is perpendicular to and centered on the
2685-
shadow's edge and defines a gradient color transition ranging from
2686-
the full shadow color at the radius endpoint inside the shadow to
2687-
fully transparent at the endpoint outside it: if the blur radius
2688-
is 0, the shadow's edge is sharp, otherwise the larger the value,
2689-
the more the shadow is blurred. The exact algorithm for the blur
2690-
transition is not specified.
2684+
allowed. If the blur radius is zero, the shadow's edge is sharp.
2685+
Otherwise, the larger the value, the more the shadow's edge is
2686+
blurred. See below.
26912687

26922688
<li>The fourth length is a spread radius. Positive values cause
26932689
the shadow shape to expand in all directions by the specified
2694-
radius. Negative values cause the shadow shape to contract. For
2695-
corners with a zero border-radius, the corner remains sharp.
2696-
Otherwise the spread radius outsets the edge of the shadow by
2697-
the amount of the spread radius in the direction perpendicular
2698-
to the shadow's edge.
2690+
radius. Negative values cause the shadow shape to contract.
2691+
See below.
26992692
<span class="note">Note that for inner shadows, expanding the
2700-
shadow means shrinking the shadow's perimeter.</span>
2701-
The UA may approximate the spread shape by outsetting (insetting,
2702-
for inner shadows) the shadow's straight edges by the spread
2703-
radius and increasing (decreasing, for inner shadows) and
2704-
flooring at zero the corner radii by the same amount.
2705-
2706-
If both a blur radius and a spread radius are defined, the blur
2707-
is applied to the resulting shape after the spread is applied.
2693+
shadow (creating more shadow area) means contracting the shadow's
2694+
perimeter shape.</span>
27082695

27092696
<li>The color is the color of the shadow.
27102697

@@ -2724,12 +2711,34 @@ <h3 id="the-box-shadow">The 'box-shadow' property</h3>
27242711
it is not drawn outside the padding box of the element.
27252712

27262713
<p>If the box has a nonzero <span class="property">'border-radius'</span>,
2727-
the shadow is rounded in the same way. The 'border-image' does not affect
2728-
the shape of the box-shadow.
2714+
the shadow shape is rounded in the same way. The 'border-image' does not
2715+
affect the shape of the box-shadow.
2716+
2717+
<p>If a spread radius is defined, it increases the size of the shadow
2718+
in the direction normal to the shadow's edge by the specified amount.
2719+
However, for corners with a zero border-radius, the corner remains
2720+
sharp, i.e. the operation is equivalent to scaling the border-box.
2721+
The UA may approximate the transformed shadow perimeter shape by
2722+
outsetting (insetting, for inner shadows) the shadow's straight edges
2723+
by the spread radius and increasing (decreasing, for inner shadows)
2724+
and flooring at zero the corner radii by the same amount. In either
2725+
case, the effective width and height of the shadow shape is floored
2726+
at zero. (A zero-sized shadow shape would cause an outer shadow to
2727+
disappear, and an inner shadow to cover the entire padding-box.)
2728+
2729+
<p>The blur radius is perpendicular to and centered on the shadow's
2730+
edge and defines a gradient color transition ranging from the full
2731+
shadow color at the radius endpoint inside the shadow to
2732+
fully transparent at the endpoint outside it. The exact algorithm
2733+
for the blur transition is not specified.
27292734

2730-
<p>If an element has multiple boxes, all of them get drop shadows, but
2731-
shadows are only drawn where borders would also be drawn; see
2732-
'box-decoration-break'.
2735+
<div class="example">
2736+
<p>The example below demonstrates the effects of the spread and
2737+
blur radii on the shadow:</p>
2738+
<p class="figure">
2739+
<img src="spread-blur.png">
2740+
</p>
2741+
</div>
27332742

27342743
<p>The shadow effects are applied front-to-back: the first shadow is
27352744
on top and the others are layered behind. Shadows do not influence
@@ -2739,6 +2748,10 @@ <h3 id="the-box-shadow">The 'box-shadow' property</h3>
27392748
an element are drawn immediately above the background of that element
27402749
(below the borders and border image, if any).
27412750

2751+
<p>If an element has multiple boxes, all of them get drop shadows, but
2752+
shadows are only drawn where borders would also be drawn; see
2753+
'box-decoration-break'.
2754+
27422755
<p>Shadows do not trigger scrolling or increase the size of the scrollable
27432756
area.
27442757

css3-background/spread-blur.png

24.2 KB
Loading

0 commit comments

Comments
 (0)