Skip to content

Commit 189af7a

Browse files
committed
[typed-om] Added a note describing how equality is determined. Fixes w3c#682.
1 parent 9191a4f commit 189af7a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

css-typed-om/Overview.bs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,6 +1126,21 @@ The following are the arithmetic operations you can perform on dimensions:
11261126
3. Return `true`.
11271127
</div>
11281128

1129+
<div class=note>
1130+
This notion of equality is purposely fairly exacting;
1131+
all the values must be the exact same type and value, in the same order.
1132+
For example, `CSSMathSum(CSS.px(1), CSS.px(2))`
1133+
is <em>not</em> equal to `CSSMathSum(CSS.px(2), CSS.px(1))`.
1134+
1135+
This precise notion is used because it allows structural equality to be tested for very quickly;
1136+
if we were to use a slower and more forgiving notion of equality,
1137+
such as allowing the arguments to match in any order,
1138+
we'd probably want to go all the way
1139+
and perform other simplifications,
1140+
like considering ''96px'' to be equal to ''1in'';
1141+
this looser notion of equality might be added in the future.
1142+
</div>
1143+
11291144
<div algorithm>
11301145
To determine whether two {{CSSNumericValue}}s |value1| and |value2|
11311146
are <dfn export lt="equal numeric value">equal numeric values</dfn>,

0 commit comments

Comments
 (0)