wpt / css / css-typed-om / stylevalue-subclasses / numeric-objects / equals.tentative.html

Status: FAIL | Duration: 54ms | Subtests: 0/11 | Open test on wpt.live | wpt.fyi

Data from commit:
a50cb89 wpt: run reference-named files which are themselves tests (#836) (2026-09-03)

SubtestStatusMessage
Two CSSUnitValues with same value and unit are equalFAILnot a callable function
Two CSSUnitValues with different values are not equalFAILnot a callable function
Two CSSUnitValues with different units are not equalFAILnot a callable function
Two CSSMathValues with different types are not equalFAILCSSMathSum is not defined
Two CSSMathValues with different number of values are not equalFAILCSSMathSum is not defined
Two CSSMathValues with different values are not equalFAILCSSMathSum is not defined
Two CSSMathValues with same structure are equalFAILCSSMathSum is not defined
Multiple CSSMathValues with same structure are equalFAILCSSMathSum is not defined
Multiple CSSMathValues with one different are not equalFAILCSSMathSum is not defined
Two CSSMathClamp with same value and unit are equalFAILCSSMathClamp is not defined
Two CSSMathClamp with different units are not equalFAILCSSMathClamp is not defined

/css/css-typed-om/stylevalue-subclasses/numeric-objects/equals.tentative.html

<meta charset="utf-8">
<title>CSSNumericValue.equals tests</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-cssnumericvalue-equals">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../resources/testhelper.js"></script>
<script>
'use strict';

test(() => {
  assert_true(CSS.px(1).equals(CSS.px(1)));
}, 'Two CSSUnitValues with same value and unit are equal');

test(() => {
  assert_false(CSS.px(0).equals(CSS.px(1)));
}, 'Two CSSUnitValues with different values are not equal');

test(() => {
  assert_false(CSS.px(1).equals(CSS.number(1)));
}, 'Two CSSUnitValues with different units are not equal');

test(() => {
  const a = new CSSMathSum(0, new CSSMathNegate(0));
  const b = new CSSMathProduct(0, new CSSMathNegate(0));
  assert_false(a.equals(b));
}, 'Two CSSMathValues with different types are not equal');

test(() => {
  const a = new CSSMathSum(0, new CSSMathNegate(0));
  const b = new CSSMathSum(0);
  assert_false(a.equals(b));
}, 'Two CSSMathValues with different number of values are not equal');

test(() => {
  const a = new CSSMathSum(0, new CSSMathNegate(0));
  const b = new CSSMathSum(0, new CSSMathNegate(1));
  assert_false(a.equals(b));
}, 'Two CSSMathValues with different values are not equal');

test(() => {
  const a = new CSSMathSum(0, new CSSMathNegate(0));
  const b = new CSSMathSum(0, new CSSMathNegate(0));
  assert_true(a.equals(b));
}, 'Two CSSMathValues with same structure are equal');

test(() => {
  const a = new CSSMathSum(0, new CSSMathNegate(0));
  const b = new CSSMathSum(0, new CSSMathNegate(0));
  const c = new CSSMathSum(0, new CSSMathNegate(0));
  const d = new CSSMathSum(0, new CSSMathNegate(0));
  assert_true(a.equals(b, c, d));
}, 'Multiple CSSMathValues with same structure are equal');

test(() => {
  const a = new CSSMathSum(0, new CSSMathNegate(0));
  const b = new CSSMathSum(0, new CSSMathNegate(0));
  const c = new CSSMathSum(0, new CSSMathNegate(1));
  const d = new CSSMathSum(0, new CSSMathNegate(0));
  assert_false(a.equals(b, c, d));
}, 'Multiple CSSMathValues with one different are not equal');

test(() => {
  const a = new CSSMathClamp(1, 2, 3);
  const b = new CSSMathClamp(CSS.number(1), CSS.number(2), CSS.number(3));
  assert_true(a.equals(b));
}, 'Two CSSMathClamp with same value and unit are equal');

test(() => {
  const a = new CSSMathClamp(1, 2, 3);
  const b = new CSSMathClamp(CSS.px(1), CSS.px(2), CSS.px(3));
  assert_false(a.equals(b));
}, 'Two CSSMathClamp with different units are not equal');

</script>