wpt / css / css-typed-om / stylevalue-subclasses / cssVariableReferenceValue-invalid.html

Status: FAIL | Duration: 48ms | Subtests: 0/2 | 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
Constructing a CSSVariableReferenceValue with an empty variable name throws a TypeErrorFAILassert_throws_js: function "() => new CSSVariableReferenceValue('')" threw object "ReferenceError: CSSVariableReferenceValue is not defined" ("ReferenceError") expected instance of function "function TypeError() { [native code] }" ("TypeError")
Constructing a CSSVariableReferenceValue with an invalid variable name throws a TypeErrorFAILassert_throws_js: function "() => new CSSVariableReferenceValue('bar')" threw object "ReferenceError: CSSVariableReferenceValue is not defined" ("ReferenceError") expected instance of function "function TypeError() { [native code] }" ("TypeError")

/css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue-invalid.html

<!doctype html>
<meta charset="utf-8">
<title>CSSVariableReferenceValue Error Handling</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#cssvariablereferencevalue">
<meta name="assert" content="Test CSSVariableReferenceValue constructor and attributes error handling" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<div id="log">
<script>
'use strict';

test(() => {
  assert_throws_js(TypeError, () => new CSSVariableReferenceValue(''));
}, 'Constructing a CSSVariableReferenceValue with an empty variable name ' +
   'throws a TypeError');

test(() => {
  assert_throws_js(TypeError, () => new CSSVariableReferenceValue('bar'));
}, 'Constructing a CSSVariableReferenceValue with an invalid variable name ' +
   'throws a TypeError');

</script>