@@ -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><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><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