Skip to content

Commit b62ac70

Browse files
committed
[css-properties-values] Move and re-wrap the computed value section. No normative changes.
1 parent 09b54b2 commit b62ac70

File tree

1 file changed

+67
-59
lines changed

1 file changed

+67
-59
lines changed

css-properties-values-api/Overview.bs

Lines changed: 67 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,74 @@ See [[#computed-value]].
159159
not a necessity like for UA-defined properties.
160160
</details>
161161

162-
Computed Value of Custom Properties {#computed-value}
163-
-----------------------------------------------------
164162

165-
Issue: Move computed value behavior here.
163+
Calculation of Computed Values {#calculation-of-computed-values}
164+
----------------------------------------------------------------
165+
166+
The [=computed value=] of a [=registered property=]
167+
is determined by the syntax it's registered with.
168+
169+
Note: All properties, regardless of registered syntax,
170+
accept the [=CSS-wide keywords=],
171+
such as ''inherit'' or ''revert''.
172+
These are handled at [=specified value=] time,
173+
as defined in [[css-cascade-4#defaulting-keywords]].
174+
175+
For <code>"&lt;length>"</code> values,
176+
the computed value is the absolute length expressed in pixels.
177+
178+
For <code>"&lt;length-percentage>"</code> values,
179+
the computed value is one of the following:
180+
181+
* if the specified value contains only length units,
182+
the computed value is the absolute length expressed in pixels.
183+
* if the specified value contains only percentages,
184+
the computed value is a simple percentage.
185+
* otherwise, the computed value is a calc expression
186+
containing an absolute length expressed in pixels,
187+
and a percentage value.
188+
189+
For <code>"&lt;angle>"</code>, <code>"&lt;time>"</code> and <code>"&lt;resolution>"</code> values,
190+
the computed value is the value expressed in its [=canonical unit=],
191+
with ''calc()'' expressions evaluated [[css-values-4#calc-computed-value|as described in CSS Values]].
192+
193+
For <code>"&lt;color>"</code> values,
194+
the value is computed as described in [[css-color-4#resolving-color-values]].
195+
196+
For <code>"&lt;custom-ident>"</code>, ident, or <code>"*"</code> values,
197+
the computed value is as specified.
198+
199+
For <code>"&lt;url>"</code> values,
200+
the computed value is one of the following:
201+
202+
* if the URL is a relative URL,
203+
the computed value is the resolved absolute URL as described in [[!css3-values]].
204+
* otherwise, the computed value is as specified.
205+
206+
For <code>"&lt;image>"</code> values,
207+
the computed value is as specified,
208+
except that relative URLs that appear in the value are resolved to absolute URLs
209+
as described in [[!css3-values]],
210+
and all lengths are resolved to their computed values.
211+
212+
For <code>"&lt;integer>"</code>, <code>"&lt;number>"</code> and <code>"&lt;percentage>"</code> values,
213+
the computed value is one of the following:
214+
215+
* if the specified value is a ''calc()'' expression,
216+
the computed value is the evaluated result of that expression.
217+
* otherwise, the computed value is as specified.
218+
219+
For <code>"&lt;transform-function>"</code> values
220+
(including those contained in <code>"&lt;transform-list>"</code> values),
221+
the computed value is as specified but with all lengths resolved to their computed values.
222+
223+
For values specified by a syntax string that include "|" clauses,
224+
the computed value is given by applying the calculation rules
225+
for the first clause that matches to the specified value.
226+
227+
For list values,
228+
the computed value is a list of the computed values of the primitives in the list.
229+
166230

167231
Animation Behavior of Custom Properties {#animation-behavior-of-custom-properties}
168232
----------------------------------------------------------------------------------
@@ -513,62 +577,6 @@ following members:
513577
: <dfn dict-member for=PropertyDefinition>initialValue</dfn>
514578
:: The initial value of this custom property.
515579

516-
Calculation of Computed Values {#calculation-of-computed-values}
517-
----------------------------------------------------------------
518-
519-
The syntax of a custom property fully determines how computed values are
520-
generated from specified values for that property.
521-
522-
The <a>CSS-wide keywords</a> and ''revert'' generate computed values as
523-
described in [[!css3-values]] and [[!css-cascade-4]] respectively. Otherwise:
524-
525-
For &lt;length> values, the computed value is the absolute length expressed in pixels.
526-
527-
For &lt;length-percentage> values, the computed value is one of the following:
528-
* if the specified value contains only length units, the computed value is the absolute length
529-
expressed in pixels.
530-
* if the specified value contains only percentages, the computed value is a
531-
simple percentage.
532-
* otherwise, the computed value is a calc expression containing an absolute
533-
length expressed in pixels, and a percentage value.
534-
535-
For &lt;color> values, the value is computed as described in
536-
[[css-color-4#resolving-color-values]].
537-
538-
For &lt;angle>, &lt;time> and &lt;resolution> values, the computed value is the
539-
value expressed in its [=canonical unit=], with ''calc()'' expressions
540-
evaluated [[css-values-4#calc-computed-value|as described in CSS Values]].
541-
542-
For &lt;custom-ident>, ident, or "*" values, the computed value is as specified.
543-
544-
For &lt;url> values, the computed value is one of the following:
545-
546-
* if the URL is a relative URL, the computed value is the resolved absolute URL
547-
as described in [[!css3-values]].
548-
* otherwise, the computed value is as specified.
549-
550-
For &lt;image> values, the computed value is as specified, except that relative
551-
URLs that appear in the value are resolved to absolute URLs as described in
552-
[[!css3-values]], and all lengths are resolved to their computed values.
553-
554-
For &lt;integer>, &lt;number> and &lt;percentage> values, the computed value is
555-
one of the following:
556-
557-
* if the specified value is a ''calc()'' expression, the computed value is the
558-
evaluated result of that expression.
559-
* otherwise, the computed value is as specified.
560-
561-
For &lt;transform-function> values (including those contained in &lt;transform-list> values),
562-
the computed value is as specified but with all lengths resolved to their
563-
computed values.
564-
565-
For values specified by a syntax string that include "|" clauses, the computed
566-
value is given by applying the calculation rules for the first clause that
567-
matches to the specified value.
568-
569-
For list values, the computed value is a list of the computed values of the
570-
primitives in the list.
571-
572580

573581
Registered Properties and @supports {#supports}
574582
-----------------------------------------------

0 commit comments

Comments
 (0)