wpt / css / css-typed-om / stylevalue-subclasses / cssUnparsedValue-length.html

Status: FAIL | Duration: 50ms | Subtests: 0/4 | 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
Length of CSSUnparsedValue with no fragments is zeroFAILCSSUnparsedValue is not defined
Length of CSSUnparsedValue with multiple fragments is the number of fragmentsFAILCSSUnparsedValue is not defined
Length of CSSUnparsedValue updates when fragments are appendedFAILCSSUnparsedValue is not defined
Length of CSSUnparsedValue does not change when fragments are modifiedFAILCSSUnparsedValue is not defined

/css/css-typed-om/stylevalue-subclasses/cssUnparsedValue-length.html

<!doctype html>
<meta charset="utf-8">
<title>CSSUnparsedValue.length</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-cssunparsedvalue-length">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<div id="log"></div>
<script>
'use strict';

test(() => {
  const result = new CSSUnparsedValue([]);
  assert_equals(result.length, 0, 'length');
}, 'Length of CSSUnparsedValue with no fragments is zero');

test(() => {
  const result = new CSSUnparsedValue([
    ' ', new CSSVariableReferenceValue('--A')
  ]);
  assert_equals(result.length, 2, 'length');
}, 'Length of CSSUnparsedValue with multiple fragments is the number of ' +
   'fragments');

test(() => {
  let result = new CSSUnparsedValue([' ']);
  assert_equals(result.length, 1, 'initial length');

  result[1] = new CSSVariableReferenceValue('--A');
  assert_equals(result.length, 2, 'length after appending once');

  result[2] = 'lemon';
  assert_equals(result.length, 3, 'length after appending twice');
}, 'Length of CSSUnparsedValue updates when fragments are appended');

test(() => {
  let result = new CSSUnparsedValue([' ']);
  assert_equals(result.length, 1, 'initial length');

  result[0] = new CSSVariableReferenceValue('--A');
  assert_equals(result.length, 1, 'length after modification');

  result[0] = 'lemon';
  assert_equals(result.length, 1, 'length after modification');
}, 'Length of CSSUnparsedValue does not change when fragments are modified');

</script>