@@ -1959,26 +1959,44 @@ and to the CSS [=math functions=].
1959
1959
Similarly for <<angle>> , <<time>> , <<frequency>> , <<resolution>> , and <<flex>> .
1960
1960
1961
1961
If the context in which the value is used
1962
- does not allow <<percentage>> values,
1963
- then the [=type=] must additionally have
1964
- a null [=percent hint=]
1965
- to be considered [=CSSNumericValue/matching=] .
1962
+ allows <<percentage>> values,
1963
+ and those percentages are resolved against another type,
1964
+ then for the [=type=] to be considered [=CSSNumericValue/matching=]
1965
+ it must either have a null [=percent hint=] ,
1966
+ or the [=percent hint=] must match the other type.
1967
+
1968
+ If the context does <em> not</em> allow <<percentage>> values
1969
+ to be mixed with <<length>> /etc values
1970
+ (or doesn't allow <<percentage>> values at all,
1971
+ such as 'border-width' ),
1972
+ then for the [=type=] to be considered [=CSSNumericValue/matching=]
1973
+ the [=percent hint=] must be null.
1974
+
1966
1975
* A [=type=] matches <<percentage>>
1967
- if its only non-zero [=map/entry=] is «[ "percent" → 1 ] ».
1976
+ if its only non-zero [=map/entry=] is «[ "percent" → 1 ] »,
1977
+ and it has a null [=percent hint=] .
1968
1978
* A [=type=] matches <<length-percentage>>
1969
- if its only non-zero [=map/entry=] is either « [ " length" → 1 ] » or « [ "percent" → 1 ] » .
1979
+ if it matches << length>> or matches <<percentage>> .
1970
1980
Same for <<angle-percentage>> , <<time-percentage>> , etc.
1971
1981
* A [=type=] matches <<number>>
1972
1982
if it has no non-zero [=map/entries=] .
1973
1983
1974
1984
If the context in which the value is used
1975
- does not allow <<percentage>> values,
1976
- then the [=type=] must additionally have
1977
- a null [=percent hint=]
1978
- to be considered [=CSSNumericValue/matching=] .
1985
+ allows <<percentage>> values,
1986
+ and those percentages are resolved against another type,
1987
+ then for the [=type=] to be considered [=CSSNumericValue/matching=]
1988
+ it must either have a null [=percent hint=] ,
1989
+ or the [=percent hint=] must match the other type.
1990
+
1991
+ If the context does <em> not</em> allow <<percentage>> values,
1992
+ or allows them but does not resolve them against another type
1993
+ (or treats them equivalent to a <<number>> ,
1994
+ such as in 'opacity' ),
1995
+ then for the [=type=] to be considered [=CSSNumericValue/matching=]
1996
+ the [=percent hint=] must be null.
1979
1997
</div>
1980
1998
1981
- Note: [=Types=] form a semi-group under both addition
1999
+ Note: [=Types=] form a semi-group under addition,
1982
2000
and a monoid under multiplication
1983
2001
(with the multiplicative identity being «[ ] » with a null [=percent hint=] ),
1984
2002
meaning that they're associative and commutative.
0 commit comments