Skip to content

Commit ee0be60

Browse files
committed
Define the term 'gradient box' and use it where appropriate to indicate the rectangle the gradient is drawn into.
1 parent 28d4695 commit ee0be60

2 files changed

Lines changed: 43 additions & 34 deletions

File tree

css3-images/Overview.html

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -828,8 +828,8 @@ <h2 id=gradients><span class=secno>4. </span> Gradients</h2>
828828
</div>
829829

830830
<p>A gradient is drawn into a box with the dimensions of the <a
831-
href="#concrete-object-size"><i>concrete object size</i></a>. Elsewhere in
832-
this section this rectangle is simply called the "box".
831+
href="#concrete-object-size"><i>concrete object size</i></a>, referred to
832+
as the <dfn id=gradient-box>gradient box</dfn>.
833833

834834
<p>A gradient has no <a href="#intrinsic-dimensions"><i>intrinsic
835835
dimensions</i></a>. This means that, for example, if you use a gradient in
@@ -878,13 +878,13 @@ <h4 class=no-toc id=linear-gradient-syntax><span class=secno>4.1.1. </span>
878878
right, and positive angles go clockwise. The starting-point and
879879
ending-point of the <a href="#gradient-line"><i>gradient-line</i></a> are
880880
determined by extending a line in both directions from the center of the
881-
box at the angle specified. In the direction of the angle, the
882-
ending-point is the point on the <a
881+
<a href="#gradient-box"><i>gradient box</i></a> at the angle specified. In
882+
the direction of the angle, the ending-point is the point on the <a
883883
href="#gradient-line"><i>gradient-line</i></a> where a line drawn
884884
perpendicular to the <a href="#gradient-line"><i>gradient-line</i></a>
885-
would intersect the corner of the box in that direction. The
886-
starting-point is determined identically, except in the opposite direction
887-
of the angle.
885+
would intersect the corner of the <a href="#gradient-box"><i>gradient
886+
box</i></a> in that direction. The starting-point is determined
887+
identically, except in the opposite direction of the angle.
888888

889889
<p>Alternately, the direction may be specified with keywords that denote
890890
the direction. If the argument is "to top", "to right", "to bottom", or
@@ -893,7 +893,8 @@ <h4 class=no-toc id=linear-gradient-syntax><span class=secno>4.1.1. </span>
893893
angle towards, the gradient must be rendered identically to an angle-based
894894
gradient with an angle chosen such that the endpoint of the gradient is in
895895
the same quadrant as the indicated corner, and a line drawn perpendicular
896-
to the gradient-line through the center of the box intersects the two
896+
to the gradient-line through the center of the <a
897+
href="#gradient-box"><i>gradient box</i></a> intersects the two
897898
neighboring corners.
898899

899900
<p class=note>It is expected that the next level of this module will
@@ -993,9 +994,9 @@ <h4 class=no-toc id=linear-gradient-examples><span class=secno>4.1.2.
993994
<h3 id=radial-gradients><span class=secno>4.2. </span> Radial Gradients</h3>
994995

995996
<p>In a radial gradient, rather than colors smoothly fading from one side
996-
of the box to the other as with linear gradients, they instead emerge from
997-
a single point and smoothly spread outward in a circular or elliptical
998-
shape.
997+
of the <a href="#gradient-box"><i>gradient box</i></a> to the other as
998+
with linear gradients, they instead emerge from a single point and
999+
smoothly spread outward in a circular or elliptical shape.
9991000

10001001
<p>A radial gradient is specified by indicating the center of the gradient
10011002
(where the 0% ellipse will be) and the size and shape of the <dfn
@@ -1039,7 +1040,8 @@ <h4 class=no-toc id=radial-gradient-syntax><span class=secno>4.2.1. </span>
10391040
positioning syntax of &lsquo;<code class=css><a
10401041
href="http://www.w3.org/TR/css3-background/#the-background-position">background-position</a></code>&rsquo;
10411042
and is resolved in the same way, using the center-point as the subject
1042-
and the content box as the positioning area. <a href="#CSS21"
1043+
and the <a href="#gradient-box"><i>gradient box</i></a> as the
1044+
positioning area. <a href="#CSS21"
10431045
rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a> <a href="#CSS3BG"
10441046
rel=biblioentry>[CSS3BG]<!--{{!CSS3BG}}--></a> If this argument is
10451047
omitted, it defaults to &lsquo;<code class=css>center</code>&rsquo;.
@@ -1054,8 +1056,9 @@ <h4 class=no-toc id=radial-gradient-syntax><span class=secno>4.2.1. </span>
10541056
href="#ending-shape"><i>ending shape</i></a>. If omitted it defaults to
10551057
&lsquo;<code class=css>farthest-corner</code>&rsquo;. It can be given
10561058
explicitly or by keyword. For the purpose of the keyword definitions,
1057-
consider the box edges as extending infinitely in both directions,
1058-
rather than being finite line segments.
1059+
consider the <a href="#gradient-box"><i>gradient box</i></a> edges as
1060+
extending infinitely in both directions, rather than being finite line
1061+
segments.
10591062

10601063
<p>Both &lsquo;<code class=css>circle</code>&rsquo; and &lsquo;<code
10611064
class=css>ellipse</code>&rsquo; gradients accept the following keywords
@@ -1066,7 +1069,8 @@ <h4 class=no-toc id=radial-gradient-syntax><span class=secno>4.2.1. </span>
10661069
class=css>closest-side</code>&rsquo;</dfn>
10671070

10681071
<dd>The <a href="#ending-shape"><i>ending shape</i></a> is sized so that
1069-
that it exactly meets the side of the box closest to the gradient's
1072+
that it exactly meets the side of the <a
1073+
href="#gradient-box"><i>gradient box</i></a> closest to the gradient's
10701074
center. If the shape is an ellipse, it exactly meets the closest side
10711075
in each dimension.
10721076

@@ -1081,7 +1085,8 @@ <h4 class=no-toc id=radial-gradient-syntax><span class=secno>4.2.1. </span>
10811085
class=css>closest-corner</code>&rsquo;</dfn>
10821086

10831087
<dd>The <a href="#ending-shape"><i>ending shape</i></a> is sized so that
1084-
that it passes through the corner of the box closest to the gradient's
1088+
that it passes through the corner of the <a
1089+
href="#gradient-box"><i>gradient box</i></a> closest to the gradient's
10851090
center. If the shape is an ellipse, the <a
10861091
href="#ending-shape"><i>ending shape</i></a> is given the same
10871092
aspect-ratio it would have if &lsquo;<code
@@ -1118,8 +1123,9 @@ <h4 class=no-toc id=radial-gradient-syntax><span class=secno>4.2.1. </span>
11181123

11191124
<dd>Gives the size of the ellipse explicitly. The first value represents
11201125
the horizontal radius, the second the vertical radius. Percentages
1121-
values are relative to the corresponding dimension of the box. Negative
1122-
values are invalid.
1126+
values are relative to the corresponding dimension of the <a
1127+
href="#gradient-box"><i>gradient box</i></a>. Negative values are
1128+
invalid.
11231129
</dl>
11241130
</dl>
11251131

@@ -1173,10 +1179,11 @@ <h4 class=no-toc id=degenerate-radials><span class=secno>4.2.3. </span>
11731179

11741180
<p>Some combinations of position, size, and shape will produce a circle or
11751181
ellipse with a radius of 0. This will occur, for example, if the center is
1176-
on a box edge and &lsquo;<code class=css>closest-side</code>&rsquo; or
1177-
&lsquo;<code class=css>closest-corner</code>&rsquo; is specified or if the
1178-
size and shape are given explicitly and either of the radiuses is zero. In
1179-
these degenerate cases, the gradient must be be rendered as follows:
1182+
on a <a href="#gradient-box"><i>gradient box</i></a> edge and &lsquo;<code
1183+
class=css>closest-side</code>&rsquo; or &lsquo;<code
1184+
class=css>closest-corner</code>&rsquo; is specified or if the size and
1185+
shape are given explicitly and either of the radiuses is zero. In these
1186+
degenerate cases, the gradient must be be rendered as follows:
11801187

11811188
<dl>
11821189
<dt>If the <a href="#ending-shape"><i>ending shape</i></a> has zero width
@@ -2624,6 +2631,9 @@ <h2 class=no-num id=index>Index</h2>
26242631
href="#find-the-average-color-of-a-gradient"
26252632
title=gradient-average-color><strong>4.3.</strong></a>
26262633

2634+
<li>gradient box, <a href="#gradient-box"
2635+
title="gradient box"><strong>4.</strong></a>
2636+
26272637
<li>gradient-line, <a href="#gradient-line"
26282638
title=gradient-line><strong>4.1.1.</strong></a>
26292639

css3-images/Overview.src.html

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -468,8 +468,7 @@ <h2 id="gradients">
468468
</div>
469469

470470
<p>A gradient is drawn into a box with the dimensions of the <i>concrete
471-
object size</i>. Elsewhere in this section this rectangle is simply
472-
called the "box".
471+
object size</i>, referred to as the <dfn>gradient box</dfn>.</p>
473472

474473
<p>A gradient has no <i>intrinsic dimensions</i>. This means that, for
475474
example, if you use a gradient in the 'background-image' property (with
@@ -513,13 +512,13 @@ <h4 class='no-toc' id='linear-gradient-syntax'>
513512
the right, and positive angles go clockwise.
514513
The starting-point and ending-point of the <i>gradient-line</i> are
515514
determined by extending a line in both directions from the center of the
516-
box at the angle specified. In the direction of the angle, the ending-point
515+
<i>gradient box</i> at the angle specified. In the direction of the angle, the ending-point
517516
is the point on the <i>gradient-line</i> where a line drawn perpendicular
518-
to the <i>gradient-line</i> would intersect the corner of the box in that
517+
to the <i>gradient-line</i> would intersect the corner of the <i>gradient box</i> in that
519518
direction. The starting-point is determined identically, except in the
520519
opposite direction of the angle.</p>
521520

522-
<p>Alternately, the direction may be specified with keywords that denote the direction. If the argument is "to top", "to right", "to bottom", or "to left", the gradient must be rendered identically to "0deg", "90deg", "180deg", or "270deg", respectively. If the argument specifies a corner to angle towards, the gradient must be rendered identically to an angle-based gradient with an angle chosen such that the endpoint of the gradient is in the same quadrant as the indicated corner, and a line drawn perpendicular to the gradient-line through the center of the box intersects the two neighboring corners.</p>
521+
<p>Alternately, the direction may be specified with keywords that denote the direction. If the argument is "to top", "to right", "to bottom", or "to left", the gradient must be rendered identically to "0deg", "90deg", "180deg", or "270deg", respectively. If the argument specifies a corner to angle towards, the gradient must be rendered identically to an angle-based gradient with an angle chosen such that the endpoint of the gradient is in the same quadrant as the indicated corner, and a line drawn perpendicular to the gradient-line through the center of the <i>gradient box</i> intersects the two neighboring corners.</p>
523522

524523
<p class='note'>It is expected that the next level of this module will provide the ability to define the gradient's direction relative to the current text direction and writing-mode.</p>
525524

@@ -603,7 +602,7 @@ <h3 id='radial-gradients'>
603602
Radial Gradients</h3>
604603

605604
<p>In a radial gradient, rather than colors smoothly fading from one side
606-
of the box to the other as with linear gradients, they instead emerge from
605+
of the <i>gradient box</i> to the other as with linear gradients, they instead emerge from
607606
a single point and smoothly spread outward in a circular or elliptical shape.</p>
608607

609608
<p>A radial gradient is specified by indicating the center
@@ -643,15 +642,15 @@ <h4 class='no-toc' id='radial-gradient-syntax'>
643642
is defined by the positioning syntax of
644643
'<a href="http://www.w3.org/TR/css3-background/#the-background-position">background-position</a>'
645644
and is resolved in the same way, using the center-point as the subject and
646-
the content box as the positioning area. [[!CSS21]] [[!CSS3BG]]
645+
the <i>gradient box</i> as the positioning area. [[!CSS21]] [[!CSS3BG]]
647646
If this argument is omitted, it defaults to ''center''. <span class='note'>Note that the CR of CSS3 B&amp;B doesn't yet have a definition of &lt;position> - it's defined in the ED, and an update to B&amp;B is expected.</span>
648647

649648
<dt id='radial-size'><dfn>&lt;size></dfn>
650649
<dd>
651650
<p>Determines the size of the gradient's <i>ending shape</i>. If
652651
omitted it defaults to ''farthest-corner''. It can be given explicitly or
653652
by keyword. For the purpose of the keyword definitions, consider the
654-
box edges as extending infinitely in both directions, rather than
653+
<i>gradient box</i> edges as extending infinitely in both directions, rather than
655654
being finite line segments.
656655

657656
<p>Both ''circle'' and ''ellipse'' gradients accept the following keywords
@@ -660,7 +659,7 @@ <h4 class='no-toc' id='radial-gradient-syntax'>
660659
<dl>
661660
<dt><dfn id='radial-closest-side'>''closest-side''</dfn></dt>
662661
<dd>The <i>ending shape</i> is sized so that that it exactly meets the
663-
side of the box closest to the gradient's center. If the shape is an
662+
side of the <i>gradient box</i> closest to the gradient's center. If the shape is an
664663
ellipse, it exactly meets the closest side in each dimension.</dd>
665664

666665
<dt><dfn id='radial-farthest-side'>''farthest-side''</dfn></dt>
@@ -669,7 +668,7 @@ <h4 class='no-toc' id='radial-gradient-syntax'>
669668

670669
<dt><dfn id='radial-closest-corner'>''closest-corner''</dfn></dt>
671670
<dd>The <i>ending shape</i> is sized so that that it passes through the
672-
corner of the box closest to the gradient's center. If the shape is an
671+
corner of the <i>gradient box</i> closest to the gradient's center. If the shape is an
673672
ellipse, the <i>ending shape</i> is given the same aspect-ratio
674673
it would have if ''closest-side'' were specified.
675674

@@ -696,7 +695,7 @@ <h4 class='no-toc' id='radial-gradient-syntax'>
696695
<dt><dfn id='radial-size-ellipse'>[&lt;length> | &lt;percentage>]{2}</dfn></dt>
697696
<dd>Gives the size of the ellipse explicitly. The first value represents
698697
the horizontal radius, the second the vertical radius. Percentages
699-
values are relative to the corresponding dimension of the box.
698+
values are relative to the corresponding dimension of the <i>gradient box</i>.
700699
Negative values are invalid.
701700
</dl>
702701
</dd>
@@ -728,7 +727,7 @@ <h4 class="no-toc" id="degenerate-radials">
728727

729728
<p>Some combinations of position, size, and shape will produce a circle
730729
or ellipse with a radius of 0. This will occur, for example, if the
731-
center is on a box edge and ''closest-side'' or ''closest-corner'' is
730+
center is on a <i>gradient box</i> edge and ''closest-side'' or ''closest-corner'' is
732731
specified or if the size and shape are given explicitly and either of
733732
the radiuses is zero. In these degenerate cases, the gradient must be
734733
be rendered as follows:</p>

0 commit comments

Comments
 (0)