Skip to content

Commit

Permalink
[css-values-5] Tweak the wording of <progress> to only allow literal …
Browse files Browse the repository at this point in the history
…percentage tokens to be equivalent to a number. #10017
  • Loading branch information
tabatkins committed Mar 4, 2024
1 parent 705636a commit 3d35b66
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions css-values-5/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -317,13 +317,21 @@ Representing Interpolation Progress: the <<progress>> type</h2>
where:

<dl dfn-type=value dfn-for="<progress>">
<dt><dfn><<percentage>></dfn>
<dt><dfn><<percentage-token>></dfn>
<dd>
Computes to the equivalent <<number>>:
''0%'' becomes ''0'',
''100%'' becomes ''1'',
etc.

Note: This only allows literal percentages,
like ''15%'';
calculations like ''calc(100% / 7)'' will not work,
as they will instead attempt to use the normal rules
for resolving a percentage against another type
(such as <<length>>, in 'width').
Use expressions like ''calc(1 / 7)'' instead.

<dt><dfn><<number>></dfn>
<dd>
Represents the [=mix progress value=].
Expand All @@ -332,15 +340,6 @@ Representing Interpolation Progress: the <<progress>> type</h2>
''media-progress()'',
and ''container-progress()'' notations.

For this purpose,
a value is allowed to match <<number>>
regardless of its [=CSSNumericValue/type=]’s [=percent hint=].

Note: This means that a value like ''progress(50% from 100px to 200px)''
will match,
despite its type having a [=percent hint=] of "length".


<dt><dfn><<'animation-timeline'>></dfn>
<dd>
Represents the [=mix progress value=]
Expand All @@ -361,6 +360,13 @@ Representing Interpolation Progress: the <<progress>> type</h2>
they allow representing interpolation beyond the range
defined by the start and end values.

Note: While <<progress>> itself can be a <<percentage>>,
mapping directly to the equivalent <<number>>,
a function that <em>resolves</em> to a <<number>>,
like ''progress()'',
resolves <<percentage>>s using the normal rules for the context;
for example, in 'width', they would be resolved against a length.

The [=computed value=] of a <<progress>> value specified with <<percentage>> or <<number>>
is the computed <<number>> converted through the <<easing-function>> (if any).
The [=computed value=] of a <<progress>> value specified with <<'animation-timeline'>>
Expand Down

0 comments on commit 3d35b66

Please sign in to comment.
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy