Skip to content

Commit 3d35b66

Browse files
committed
[css-values-5] Tweak the wording of <progress> to only allow literal percentage tokens to be equivalent to a number. #10017
1 parent 705636a commit 3d35b66

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

css-values-5/Overview.bs

+16-10
Original file line numberDiff line numberDiff line change
@@ -317,13 +317,21 @@ Representing Interpolation Progress: the <<progress>> type</h2>
317317
where:
318318

319319
<dl dfn-type=value dfn-for="<progress>">
320-
<dt><dfn><<percentage>></dfn>
320+
<dt><dfn><<percentage-token>></dfn>
321321
<dd>
322322
Computes to the equivalent <<number>>:
323323
''0%'' becomes ''0'',
324324
''100%'' becomes ''1'',
325325
etc.
326326

327+
Note: This only allows literal percentages,
328+
like ''15%'';
329+
calculations like ''calc(100% / 7)'' will not work,
330+
as they will instead attempt to use the normal rules
331+
for resolving a percentage against another type
332+
(such as <<length>>, in 'width').
333+
Use expressions like ''calc(1 / 7)'' instead.
334+
327335
<dt><dfn><<number>></dfn>
328336
<dd>
329337
Represents the [=mix progress value=].
@@ -332,15 +340,6 @@ Representing Interpolation Progress: the <<progress>> type</h2>
332340
''media-progress()'',
333341
and ''container-progress()'' notations.
334342

335-
For this purpose,
336-
a value is allowed to match <<number>>
337-
regardless of its [=CSSNumericValue/type=]’s [=percent hint=].
338-
339-
Note: This means that a value like ''progress(50% from 100px to 200px)''
340-
will match,
341-
despite its type having a [=percent hint=] of "length".
342-
343-
344343
<dt><dfn><<'animation-timeline'>></dfn>
345344
<dd>
346345
Represents the [=mix progress value=]
@@ -361,6 +360,13 @@ Representing Interpolation Progress: the <<progress>> type</h2>
361360
they allow representing interpolation beyond the range
362361
defined by the start and end values.
363362

363+
Note: While <<progress>> itself can be a <<percentage>>,
364+
mapping directly to the equivalent <<number>>,
365+
a function that <em>resolves</em> to a <<number>>,
366+
like ''progress()'',
367+
resolves <<percentage>>s using the normal rules for the context;
368+
for example, in 'width', they would be resolved against a length.
369+
364370
The [=computed value=] of a <<progress>> value specified with <<percentage>> or <<number>>
365371
is the computed <<number>> converted through the <<easing-function>> (if any).
366372
The [=computed value=] of a <<progress>> value specified with <<'animation-timeline'>>

0 commit comments

Comments
 (0)