Skip to content

Commit 808c87a

Browse files
committed
[css-typed-om] Fix the type match algo to refer to the percent hint more abstractly.
1 parent c428893 commit 808c87a

File tree

1 file changed

+26
-24
lines changed

1 file changed

+26
-24
lines changed

css-typed-om/Overview.bs

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1896,30 +1896,32 @@ and to the CSS [=math functions=].
18961896
3. Return |result|.
18971897
18981898

1899-
A [=type=] is said to match a CSS production in some circumstances:
1900-
1901-
* A [=type=] matches <>
1902-
if its only non-zero [=map/entry=] is «[ "length" → 1 ]»
1903-
and its [=percent hint=] is null.
1904-
Similarly for <>, <, <>, <>, and <>.
1905-
* A [=type=] matches <>
1906-
if its only non-zero [=map/entry=] is «[ "percent" → 1 ]».
1907-
* A [=type=] matches <>
1908-
if its only non-zero [=map/entry=] is either «[ "length" → 1 ]» or «[ "percent" → 1 ]»
1909-
Same for <>, <>, etc.
1910-
* A [=type=] matches <>
1911-
if it has no non-zero [=map/entries=]
1912-
and its [=percent hint=] is null.
1913-
* A [=type=] matches <>
1914-
if it has no non-zero [=map/entries=],
1915-
or its only non-zero [=map/entry=] is «[ "percent" → 1 ]».
1916-
1917-
Many specifications use ''[ <> | <> ]''
1918-
instead of ''<>'' in their grammar,
1919-
and specify in prose that the <> and <> can be combined.
1920-
For the purposes of [=CSSNumericValue/matching=],
1921-
these cases should be treated as <>.
1922-
Similarly for <>, etc.
1899+
1900+
A [=type=] is said to match a CSS production in some circumstances:
1901+
1902+
* A [=type=] matches <>
1903+
if its only non-zero [=map/entry=] is «[ "length" → 1 ]».
1904+
Similarly for <>, <, <>, <>, and <>.
1905+
1906+
If the context in which the value is used
1907+
does not allow <> values,
1908+
then the [=type=] must additionally have
1909+
a null [=percent hint=]
1910+
to be considered [=CSSNumericValue/matching=].
1911+
* A [=type=] matches <>
1912+
if its only non-zero [=map/entry=] is «[ "percent" → 1 ]».
1913+
* A [=type=] matches <>
1914+
if its only non-zero [=map/entry=] is either «[ "length" → 1 ]» or «[ "percent" → 1 ]».
1915+
Same for <>, <>, etc.
1916+
* A [=type=] matches <>
1917+
if it has no non-zero [=map/entries=].
1918+
1919+
If the context in which the value is used
1920+
does not allow <> values,
1921+
then the [=type=] must additionally have
1922+
a null [=percent hint=]
1923+
to be considered [=CSSNumericValue/matching=].
1924+
19231925

19241926
Note: [=Types=] form a semi-group under both addition
19251927
and a monoid under multiplication

0 commit comments

Comments
 (0)