Skip to content

Commit 84a573d

Browse files
committed
[css-sizing-4][css-values-4] Define 0 & infinite ratios as degenerate, and define that degenerate ratios do nothing.
1 parent 2c0b793 commit 84a573d

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

css-sizing-4/Overview.bs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,9 @@ Preferred Aspect Ratios: the 'aspect-ratio' property</h3>
182182
Size calculations involving the aspect ratio
183183
work with the dimensions of the box specified by 'box-sizing'.
184184

185+
If the <<ratio>> is [=degenerate ratio|degenerate=],
186+
the property instead behaves as ''aspect-ratio/auto''.
187+
185188
<dt><dfn>auto && <<ratio>></dfn>
186189
<dd>
187190
If both ''auto'' and a <<ratio>> are specified together,
@@ -191,6 +194,9 @@ Preferred Aspect Ratios: the 'aspect-ratio' property</h3>
191194
in which case that aspect ratio is used instead.
192195
In all cases, size calculations involving the aspect ratio
193196
work with the [=content box=] dimensions always.
197+
198+
If the <<ratio>> is [=degenerate ratio|degenerate=],
199+
the property instead behaves as ''aspect-ratio/auto''.
194200
</dl>
195201

196202
Note: Having a [=preferred aspect ratio=] does not make a box into a [=replaced element=];

css-values-4/Overview.bs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,14 +1293,10 @@ Ratios: the <<ratio>> type</h3>
12931293
However, <<ratio>> is always serialized with both components.
12941294

12951295
The computed value of a <<ratio>> is the pair of numbers provided.
1296-
However, a ratio of ''0 / 0'' behaves as the ratio ''1 / 0'' instead.
12971296

1298-
Note: This makes the behavior of ''calc(0 / 0)''
1299-
(an ordinary division,
1300-
which resolves to ''NaN''
1301-
and is then "censored" to ''infinity'')
1302-
consistent with the ratio ''0 / 0'';
1303-
this consistency is generally true in all other cases.
1297+
If either number in the <<ratio>> is 0 or infinite,
1298+
it represents a <dfn export>degenerate ratio</dfn>
1299+
(and, generally, won't do anything).
13041300

13051301
If two <<ratio>>s need to be compared,
13061302
divide the first number by the second,
@@ -1325,6 +1321,9 @@ Combination of <<ratio>></h4>
13251321
then interpreting the result as a <<ratio>>
13261322
with the result as the first value and ''1'' as the second value.
13271323

1324+
If either <<ratio>> is [=degenerate ratio|degenerate=],
1325+
the values cannot be interpolated.
1326+
13281327
<div class='example'>
13291328
For example,
13301329
halfway through a linear interpolation from ''5 / 1'' to ''3 / 2'',

0 commit comments

Comments
 (0)