Skip to content

Commit 933d7dd

Browse files
committed
[css-backgrounds-3][css-backgrounds-4] Use bracketed range notation
Added bracketed range notation for non-negative values ( [0,∞] ) in these properties & productions: - <bg-size> - <line-width> - border-radius and longhands - border-image-slice - border-image-width - border-image-outset - <shadow> NOTE: required re-writing the syntax (since ony one of the 4 possible lengths has a restriction) - border-limit and border-clip in level 4 NOTE: these didn't have prose restrictions, but they also didn't explain how negative values could work. I added a changes note to level 3 (change since CR), but not level 4 (not published yet).
1 parent ded9374 commit 933d7dd

File tree

2 files changed

+23
-20
lines changed

2 files changed

+23
-20
lines changed

css-backgrounds-3/Overview.bs

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,7 @@ layer.
930930

931931
<p>Specifies the size of the background images. Where
932932

933-
<pre class=prod><dfn><<bg-size>></dfn> = [ <<length-percentage>> | auto ]{1,2} | cover | contain</pre>
933+
<pre class=prod><dfn><<bg-size>></dfn> = [ <<length-percentage [0,&infin;]>> | auto ]{1,2} | cover | contain</pre>
934934

935935
<p>Values have the following meanings:
936936

@@ -946,7 +946,7 @@ layer.
946946
(if any), to the smallest size such that both its width and its
947947
height can completely cover the background positioning area.</dd>
948948

949-
<dt>[ <dfn><<length-percentage>></dfn>
949+
<dt>[ <dfn><<length-percentage [0,&infin;]>></dfn>
950950
| <dfn>auto</dfn> ]{1,2}</dt>
951951
<dd>
952952
<p>The first value gives the width of the corresponding image,
@@ -1631,7 +1631,7 @@ the padding is less than the radius of the corner.
16311631
<p>These properties set the thickness of the border.
16321632
Where
16331633

1634-
<pre class=prod><dfn><<line-width>></dfn> = <<length>> | thin | medium | thick</pre>
1634+
<pre class=prod><dfn><<line-width>></dfn> = <<length [0,&infin;]>> | thin | medium | thick</pre>
16351635

16361636
<p dfn-type=value dfn-for="<line-width>, border-width, border-top-width, border-left-width, border-bottom-width, border-right-width, border">
16371637
The lengths corresponding to <dfn>thin</dfn>, <dfn>medium</dfn>, and <dfn>thick</dfn>
@@ -1791,7 +1791,7 @@ the 'color' property. The fact that the
17911791
<dfn>border-bottom-left-radius</dfn>
17921792
<tr>
17931793
<th><a href="#values">Value</a>:
1794-
<td><<length-percentage>>{1,2}
1794+
<td><<length-percentage [0,&infin;]>>{1,2}
17951795
<tr>
17961796
<th>Initial:
17971797
<td>0
@@ -1819,7 +1819,7 @@ the 'color' property. The fact that the
18191819
<td><dfn>border-radius</dfn>
18201820
<tr>
18211821
<th><a href="#values">Value</a>:
1822-
<td><<length-percentage>>{1,4} [ / <<length-percentage>>{1,4} ]?
1822+
<td><<length-percentage [0,&infin;]>>{1,4} [ / <<length-percentage [0,&infin;]>>{1,4} ]?
18231823
<tr>
18241824
<th>Initial:
18251825
<td>see individual properties
@@ -2231,7 +2231,7 @@ and the border image is drawn as described in the sections below.
22312231
<td><dfn>border-image-slice</dfn>
22322232
<tr>
22332233
<th><a href="#values">Value</a>:
2234-
<td>[<<number>> | <<percentage>>]{1,4} &amp;&amp; fill?
2234+
<td>[<<number [0,&infin;]>> | <<percentage [0,&infin;]>>]{1,4} &amp;&amp; fill?
22352235
<tr>
22362236
<th>Initial:
22372237
<td>100%
@@ -2266,12 +2266,12 @@ the same as the right; if the bottom is missing, it is the same as the top;
22662266
if the right is missing, it is the same as the top.
22672267

22682268
<dl dfn-for=border-image-slice dfn-type=value>
2269-
<dt><dfn><<percentage>></dfn>
2269+
<dt><dfn><<percentage [0,&infin;]>></dfn>
22702270
<dd>Percentages are relative to the size of the image: the width
22712271
of the image for the horizontal offsets, the height for vertical
22722272
offsets.
22732273

2274-
<dt><dfn><<number>></dfn>
2274+
<dt><dfn><<number [0,&infin;]>></dfn>
22752275
<dd>Numbers represent pixels in the image (if the image is a raster
22762276
image) or vector coordinates (if the image is a vector image).
22772277

@@ -2312,7 +2312,7 @@ with no <i>specified size</i> and the <i>border image area</i> as the <i>default
23122312
<td><dfn>border-image-width</dfn>
23132313
<tr>
23142314
<th><a href="#values">Value</a>:
2315-
<td>[ <<length-percentage>> | <<number>> | auto ]{1,4}
2315+
<td>[ <<length-percentage [0,&infin;]>> | <<number [0,&infin;]>> | auto ]{1,4}
23162316
<tr>
23172317
<th>Initial:
23182318
<td>1
@@ -2346,11 +2346,11 @@ if the bottom is missing, it is the same as the top; if the right is missing,
23462346
it is the same as the top. Values have the following meanings:</p>
23472347

23482348
<dl dfn-for=border-image-width dfn-type=value>
2349-
<dt><dfn><<length-percentage>></dfn>
2349+
<dt><dfn><<length-percentage [0,&infin;]>></dfn>
23502350
<dd>Percentages refer to the size of the border image area: the width of the
23512351
area for horizontal offsets, the height for vertical offsets.
23522352

2353-
<dt><dfn><<number>></dfn>
2353+
<dt><dfn><<number [0,&infin;]>></dfn>
23542354
<dd>Numbers represent multiples of the corresponding computed
23552355
<a href="#the-border-width">border-width</a>.
23562356

@@ -2385,7 +2385,7 @@ them by <var>f</var>.
23852385
<td><dfn>border-image-outset</dfn>
23862386
<tr>
23872387
<th><a href="#values">Value</a>:
2388-
<td>[ <<length>> | <<number>> ]{1,4}
2388+
<td>[ <<length [0,&infin;]>> | <<number [0,&infin;]>> ]{1,4}
23892389
<tr>
23902390
<th>Initial:
23912391
<td>0
@@ -2415,11 +2415,11 @@ if the bottom is missing, it is the same as the top; if the right is missing,
24152415
it is the same as the top.
24162416

24172417
<dl dfn-for=border-image-outset dfn-type=value>
2418-
<dt><<length>>
2418+
<dt><<length [0,&infin;]>>
24192419
<dd>Represents an outset of the specified length.
24202420
Negative values are invalid.
24212421

2422-
<dt><<number>>
2422+
<dt><<number [0,&infin;]>>
24232423
<dd>Represents an outset of the specified multiple of the corresponding computed <a href="#the-border-width">border-width</a>.
24242424
Negative values are invalid.
24252425
</dl>
@@ -2668,7 +2668,7 @@ has been moved to the <a href="https://www.w3.org/TR/css3-break/">CSS Fragmentat
26682668
represented by 2-4 length values, an optional color, and an optional ''box-shadow/inset'' keyword.
26692669
Omitted lengths are 0; omitted colors default to the value of the 'color' property.
26702670
<pre class=prod>
2671-
<dfn><<shadow>></dfn> = <<color>>? &amp;&amp; <<length>>{2,4} &amp;&amp; inset?</pre>
2671+
<dfn><<shadow>></dfn> = <<color>>? &amp;&amp; [<<length>>{2} <<length [0,&infin;]>>? <<length>>?] &amp;&amp; inset?</pre>
26722672

26732673
<p>The components of each <<shadow>> are interpreted as follows:
26742674

@@ -2684,7 +2684,7 @@ has been moved to the <a href="https://www.w3.org/TR/css3-break/">CSS Fragmentat
26842684
Specifies the <dfn>vertical offset</dfn> of the shadow.
26852685
A positive value offsets the shadow down, a negative one up.
26862686

2687-
<dt><dfn id="shadow-blur-radius">3rd <<length>></dfn>
2687+
<dt><dfn id="shadow-blur-radius">3rd <<length [0,&infin;]>></dfn>
26882688
<dd>Specifies the <dfn>blur radius</dfn>.
26892689
Negative values are not allowed.
26902690
If the blur value is zero, the shadow’s edge is sharp.
@@ -2993,6 +2993,9 @@ Changes since the 17 October 2017 Candidate Recommendation</h3>
29932993
<li>
29942994
Cleaned up and regularized “Animation type” and “Computed value” lines
29952995
in the property definition tables.
2996+
<li>
2997+
Changed syntax to use <a>bracketed range notation</a>
2998+
to reflect the prose restrictions on negative values.
29962999
</ul>
29973000

29983001
<h3 id="changes-2014-09">

css-backgrounds-4/Overview.bs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ Corner Sizing: the 'border-radius property</h3>
236236

237237
<pre class="propdef">
238238
Name: border-radius
239-
Value: <<length-percentage>>{1,4} [ / <<length-percentage>>{1,4} ]?
239+
Value: <<length-percentage [0,&infin;]>>{1,4} [ / <<length-percentage [0,&infin;]>>{1,4} ]?
240240
Initial: 0
241241
Applies to: all elements, except table element when 'border-collapse' is ''collapse''
242242
Inherited: no
@@ -338,8 +338,8 @@ Partial Borders: the 'border-limit' property</h3>
338338

339339
<pre class="propdef">
340340
Name: border-limit
341-
Value: all | [ sides | corners ] <<length-percentage>>?
342-
| [ top | right | bottom | left ] <<length-percentage>>
341+
Value: all | [ sides | corners ] <<length-percentage [0,&infin;]>>?
342+
| [ top | right | bottom | left ] <<length-percentage [0,&infin;]>>
343343
Initial: round
344344
Applies to: all elements, except table element when 'border-collapse' is ''collapse''
345345
Inherited: no
@@ -394,7 +394,7 @@ The 'border-clip' properties</h3>
394394

395395
<pre class="propdef">
396396
Name: border-clip, border-clip-top, border-clip-right, border-clip-bottom, border-clip-left
397-
Value: normal | [ <<length-percentage>> | <<flex>> ]+
397+
Value: normal | [ <<length-percentage [0,&infin;]>> | <<flex>> ]+
398398
Initial: normal
399399
Inherited: no
400400
Percentages: refer to length of border-edge side

0 commit comments

Comments
 (0)