Skip to content

Commit f791dfa

Browse files
committed
[css-values-4] Fix the type-resolution of division operations. Minor surrounding markup tweaks.
1 parent ea66912 commit f791dfa

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

css-values-4/Overview.bs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1776,18 +1776,27 @@ Type-Checking Expressions</h5>
17761776
so long as the expression as a whole resolves to a singular unit
17771777
according to the following rules:
17781778

1779-
* At a ''+'' or ''-'' sub-expression,
1779+
* At a <css>+</css> or <css>-</css> sub-expression,
17801780
attempt to [=add two types|add the types=] of the left and right arguments.
17811781
If this returns failure,
17821782
the entire [=math function=] is invalid.
17831783
Otherwise, the sub-expression's [=CSSNumericValue/type=] is the returned type.
17841784

1785-
* At a ''*'' or ''/'' sub-expression,
1785+
* At a <css>*</css> sub-expression,
17861786
attempt to [=multiply two types|multiply the types=] of the left and right arguments.
17871787
If this returns failure,
17881788
the entire [=math function=] is invalid.
17891789
Otherwise, the sub-expression's [=CSSNumericValue/type=] is the returned type.
17901790

1791+
* At a <css>/</css> sub-expression,
1792+
find the [=CSSNumericValue/types=] of its left and right arguments,
1793+
then negate the values of every [=map/entry=] in the right argument’s [=CSSNumericValue/type=].
1794+
Attempt to [=multiply two types|multiply=] the left argument’s type
1795+
and the negated right argument’s type.
1796+
If this returns failure,
1797+
the entire [=math function=] is invalid.
1798+
Otherwise, the sub-expression's [=CSSNumericValue/type=] is the returned type.
1799+
17911800
* The [=CSSNumericValue/type=] of a literal
17921801
is the result of [=creating a type=]
17931802
from the literal's unit,
@@ -1809,7 +1818,7 @@ Type-Checking Expressions</h5>
18091818
If the result is failure,
18101819
the entire [=math function=] is invalid.
18111820

1812-
The [=math function=] resolves to <<length>>, <<angle>>, <<time>>, <<frequency>>, <<resolution>>, <<flex>>, or <<percentage>>
1821+
A [=math function=] resolves to <<length>>, <<angle>>, <<time>>, <<frequency>>, <<resolution>>, <<flex>>, or <<percentage>>
18131822
according to which of those productions its [=CSSNumericValue/type=] [=CSSNumericValue/matches=].
18141823
(These categories are mutually exclusive.)
18151824
If it can't [=CSSNumericValue/match=] any of these,

0 commit comments

Comments
 (0)