Skip to content

Commit 2afd13a

Browse files
committed
[css-values] Reorder sections. No changes to prose.
1 parent 5ee9639 commit 2afd13a

File tree

2 files changed

+92
-84
lines changed

2 files changed

+92
-84
lines changed

css-values-3/Overview.bs

+46-42
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,49 @@ Real Numbers: the <<number>> type</h3>
720720
As with integers, the first character of a number may be immediately preceded by ''-'' or ''+''
721721
to indicate the number's sign.
722722

723+
<h3 id='dimensions'>
724+
Numbers with Units: <a>dimension</a> values</h3>
725+
726+
The general term <dfn export>dimension</dfn> refers to
727+
a number with a unit attached to it;
728+
and is denoted by <dfn>&lt;dimension></dfn>.
729+
730+
When written literally,
731+
a <a>dimension</a> is a <a>number</a>
732+
immediately followed by a unit identifier,
733+
which is an <a>identifier</a>.
734+
It corresponds to the <<dimension-token>> production
735+
in the <a href="https://www.w3.org/TR/css-syntax/">CSS Syntax Module</a> [[!CSS3SYN]].
736+
Like keywords, unit identifiers are <a>ASCII case-insensitive</a>.
737+
738+
CSS uses <<dimension>>s to specify
739+
distances (<<length>>),
740+
durations (<<time>>),
741+
frequencies (<<frequency>>),
742+
resolutions (<<resolution>>),
743+
and other quantities.
744+
745+
<h4 id="compat">
746+
Compatible Units</h4>
747+
748+
When <a href="https://www.w3.org/TR/cssom-1/#serializing-css-values">serializing</a> <a>computed values</a> [[!CSSOM]],
749+
<dfn export local-lt=compatible>compatible units</dfn>
750+
(those related by a static multiplicative factor,
751+
like the 96:1 factor between ''px'' and ''in'',
752+
or the the computed 'font-size' factor between ''em'' and ''px'')
753+
are converted into a single <dfn export local-lt=canonical>canonical unit</dfn>.
754+
Each group of compatible units defines which among them is the <a>canonical unit</a>
755+
that will be used for serialization.
756+
757+
When serializing <a href="https://www.w3.org/TR/cssom-1/#resolved-values">resolved values</a>
758+
that are <a>used values</a>,
759+
all value types (percentages, numbers, keywords, etc.)
760+
that represent lengths are considered <a>compatible</a> with lengths.
761+
Likewise any future API that returns <a>used values</a>
762+
must consider any values represent distances/durations/frequencies/etc.
763+
as <a>compatible</a> with the relevant class of <a>dimensions</a>,
764+
and canonicalize accordingly.
765+
723766
<!--
724767
█████ ██
725768
██ ██ ██
@@ -751,6 +794,9 @@ Percentages: the <<percentage>> type</h3>
751794
(e.g., the width of a <a>containing block</a>),
752795
or something else.
753796

797+
<h3 id="mixed-percentages">
798+
Mixing Percentages and Dimensions</h3>
799+
754800
In cases where a <<percentage>> can represent the same quantity
755801
as a <a>dimension</a> or <a>number</a> in the same <a>component value</a> position,
756802
and can therefore be combined with them in a ''calc()'' expression,
@@ -791,48 +837,6 @@ Percentages: the <<percentage>> type</h3>
791837
Note: Specifications should never alternate <<percentage>> in place of a dimension
792838
in a grammar unless they are <a>compatible</a>.
793839

794-
<h3 id='dimensions'>
795-
Numbers with Units: <a>dimensions</a></h3>
796-
797-
The general term <dfn export>dimension</dfn> refers to
798-
a number with a unit attached to it;
799-
and is denoted by <dfn>&lt;dimension></dfn>.
800-
801-
When written literally,
802-
a <a>dimension</a> is a <a>number</a>
803-
immediately followed by a unit identifier,
804-
which is an <a>identifier</a>.
805-
It corresponds to the <<dimension-token>> production
806-
in the <a href="https://www.w3.org/TR/css-syntax/">CSS Syntax Module</a> [[!CSS3SYN]].
807-
Like keywords, unit identifiers are <a>ASCII case-insensitive</a>.
808-
809-
CSS uses <<dimension>>s to specify
810-
distances (<<length>>),
811-
durations (<<time>>),
812-
frequencies (<<frequency>>),
813-
resolutions (<<resolution>>),
814-
and other quantities.
815-
816-
<h3 id="compat">
817-
Compatible Units</h3>
818-
819-
When <a href="https://www.w3.org/TR/cssom-1/#serializing-css-values">serializing</a> <a>computed values</a> [[!CSSOM]],
820-
<dfn export local-lt=compatible>compatible units</dfn>
821-
(those related by a static multiplicative factor,
822-
like the 96:1 factor between ''px'' and ''in'',
823-
or the the computed 'font-size' factor between ''em'' and ''px'')
824-
are converted into a single <dfn export local-lt=canonical>canonical unit</dfn>.
825-
Each group of compatible units defines which among them is the <a>canonical unit</a>
826-
that will be used for serialization.
827-
828-
When serializing <a href="https://www.w3.org/TR/cssom-1/#resolved-values">resolved values</a>
829-
that are <a>used values</a>,
830-
all value types (percentages, numbers, keywords, etc.)
831-
that represent lengths are considered <a>compatible</a> with lengths.
832-
Likewise any future API that returns <a>used values</a>
833-
must consider any values represent distances/durations/frequencies/etc.
834-
as <a>compatible</a> with the relevant class of <a>dimensions</a>,
835-
and canonicalize accordingly.
836840

837841
<!--
838842
██ ████████ ██ ██ ██████ ████████ ██ ██

css-values-4/Overview.bs

+46-42
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,49 @@ Real Numbers: the <<number>> type</h3>
719719
do not match <<zero>>;
720720
only literal <<number-token>>s do.
721721

722+
<h3 id='dimensions'>
723+
Numbers with Units: <a>dimension</a> values</h3>
724+
725+
The general term <dfn export>dimension</dfn> refers to
726+
a number with a unit attached to it;
727+
and is denoted by <dfn>&lt;dimension></dfn>.
728+
729+
When written literally,
730+
a <a>dimension</a> is a <a>number</a>
731+
immediately followed by a unit identifier,
732+
which is an <a>identifier</a>.
733+
It corresponds to the <<dimension-token>> production
734+
in the <a href="https://www.w3.org/TR/css-syntax/">CSS Syntax Module</a> [[!CSS3SYN]].
735+
Like keywords, unit identifiers are <a>ASCII case-insensitive</a>.
736+
737+
CSS uses <<dimension>>s to specify
738+
distances (<<length>>),
739+
durations (<<time>>),
740+
frequencies (<<frequency>>),
741+
resolutions (<<resolution>>),
742+
and other quantities.
743+
744+
<h4 id="compat">
745+
Compatible Units</h4>
746+
747+
When <a href="https://www.w3.org/TR/cssom-1/#serializing-css-values">serializing</a> <a>computed values</a> [[!CSSOM]],
748+
<dfn export local-lt=compatible>compatible units</dfn>
749+
(those related by a static multiplicative factor,
750+
like the 96:1 factor between ''px'' and ''in'',
751+
or the the computed 'font-size' factor between ''em'' and ''px'')
752+
are converted into a single <dfn export local-lt=canonical>canonical unit</dfn>.
753+
Each group of compatible units defines which among them is the <a>canonical unit</a>
754+
that will be used for serialization.
755+
756+
When serializing <a href="https://www.w3.org/TR/cssom-1/#resolved-values">resolved values</a>
757+
that are <a>used values</a>,
758+
all value types (percentages, numbers, keywords, etc.)
759+
that represent lengths are considered <a>compatible</a> with lengths.
760+
Likewise any future API that returns <a>used values</a>
761+
must consider any values represent distances/durations/frequencies/etc.
762+
as <a>compatible</a> with the relevant class of <a>dimensions</a>,
763+
and canonicalize accordingly.
764+
722765
<!--
723766
█████ ██
724767
██ ██ ██
@@ -750,6 +793,9 @@ Percentages: the <<percentage>> type</h3>
750793
(e.g., the width of a <a>containing block</a>),
751794
or something else.
752795

796+
<h3 id="mixed-percentages">
797+
Mixing Percentages and Dimensions</h3>
798+
753799
In cases where a <<percentage>> can represent the same quantity
754800
as a <a>dimension</a> in the same <a>component value</a> position,
755801
and can therefore be combined with them in a ''calc()'' expression,
@@ -791,48 +837,6 @@ Percentages: the <<percentage>> type</h3>
791837
A &lt;number-percentage> will never be added,
792838
as <<number>> and <<percentage>> can't be combined in ''calc()''.
793839

794-
<h3 id='dimensions'>
795-
Numbers with Units: <a>dimensions</a></h3>
796-
797-
The general term <dfn export>dimension</dfn> refers to
798-
a number with a unit attached to it;
799-
and is denoted by <dfn>&lt;dimension></dfn>.
800-
801-
When written literally,
802-
a <a>dimension</a> is a <a>number</a>
803-
immediately followed by a unit identifier,
804-
which is an <a>identifier</a>.
805-
It corresponds to the <<dimension-token>> production
806-
in the <a href="https://www.w3.org/TR/css-syntax/">CSS Syntax Module</a> [[!CSS3SYN]].
807-
Like keywords, unit identifiers are <a>ASCII case-insensitive</a>.
808-
809-
CSS uses <<dimension>>s to specify
810-
distances (<<length>>),
811-
durations (<<time>>),
812-
frequencies (<<frequency>>),
813-
resolutions (<<resolution>>),
814-
and other quantities.
815-
816-
<h3 id="compat">
817-
Compatible Units</h3>
818-
819-
When <a href="https://www.w3.org/TR/cssom-1/#serializing-css-values">serializing</a> <a>computed values</a> [[!CSSOM]],
820-
<dfn export local-lt=compatible>compatible units</dfn>
821-
(those related by a static multiplicative factor,
822-
like the 96:1 factor between ''px'' and ''in'',
823-
or the the computed 'font-size' factor between ''em'' and ''px'')
824-
are converted into a single <dfn export local-lt=canonical>canonical unit</dfn>.
825-
Each group of compatible units defines which among them is the <a>canonical unit</a>
826-
that will be used for serialization.
827-
828-
When serializing <a href="https://www.w3.org/TR/cssom-1/#resolved-values">resolved values</a>
829-
that are <a>used values</a>,
830-
all value types (percentages, numbers, keywords, etc.)
831-
that represent lengths are considered <a>compatible</a> with lengths.
832-
Likewise any future API that returns <a>used values</a>
833-
must consider any values represent distances/durations/frequencies/etc.
834-
as <a>compatible</a> with the relevant class of <a>dimensions</a>,
835-
and canonicalize accordingly.
836840

837841
<!--
838842
██ ████████ ██ ██ ██████ ████████ ██ ██

0 commit comments

Comments
 (0)