Status: FAIL | Duration: 66ms | Subtests: 0/36 | Open test on wpt.live | wpt.fyi
Data from commit:
a50cb89 wpt: run reference-named files which are themselves tests (#836) (2026-09-03)
| Subtest | Status | Message |
|---|---|---|
| Constructing CSSUnitValue with an unknown unit throws a TypeError | FAIL | assert_throws_js: function "() => new CSSUnitValue(0, 'lemon')" threw object "ReferenceError: CSSUnitValue is not defined" ("ReferenceError") expected instance of function "function TypeError() { [native code] }" ("TypeError") |
| Constructing CSSUnitValue with a empty string unit throws a TypeError | FAIL | assert_throws_js: function "() => new CSSUnitValue(0, '')" threw object "ReferenceError: CSSUnitValue is not defined" ("ReferenceError") expected instance of function "function TypeError() { [native code] }" ("TypeError") |
| CSSUnitValue can be constructed with number | FAIL | CSSUnitValue is not defined |
| CSSUnitValue can be constructed with percent | FAIL | CSSUnitValue is not defined |
| CSSUnitValue can be constructed with em | FAIL | CSSUnitValue is not defined |
| CSSUnitValue can be constructed with ex | FAIL | CSSUnitValue is not defined |
| CSSUnitValue can be constructed with ch | FAIL | CSSUnitValue is not defined |
| CSSUnitValue can be constructed with ic | FAIL | CSSUnitValue is not defined |
| CSSUnitValue can be constructed with rem | FAIL | CSSUnitValue is not defined |
| CSSUnitValue can be constructed with lh | FAIL | CSSUnitValue is not defined |
| CSSUnitValue can be constructed with rlh | FAIL | CSSUnitValue is not defined |
| CSSUnitValue can be constructed with vw | FAIL | CSSUnitValue is not defined |
| CSSUnitValue can be constructed with vh | FAIL | CSSUnitValue is not defined |
| CSSUnitValue can be constructed with vi | FAIL | CSSUnitValue is not defined |
| CSSUnitValue can be constructed with vb | FAIL | CSSUnitValue is not defined |
| CSSUnitValue can be constructed with vmin | FAIL | CSSUnitValue is not defined |
| CSSUnitValue can be constructed with vmax | FAIL | CSSUnitValue is not defined |
| CSSUnitValue can be constructed with cm | FAIL | CSSUnitValue is not defined |
| CSSUnitValue can be constructed with mm | FAIL | CSSUnitValue is not defined |
| CSSUnitValue can be constructed with Q | FAIL | CSSUnitValue is not defined |
| CSSUnitValue can be constructed with in | FAIL | CSSUnitValue is not defined |
| CSSUnitValue can be constructed with pt | FAIL | CSSUnitValue is not defined |
| CSSUnitValue can be constructed with pc | FAIL | CSSUnitValue is not defined |
| CSSUnitValue can be constructed with px | FAIL | CSSUnitValue is not defined |
| CSSUnitValue can be constructed with deg | FAIL | CSSUnitValue is not defined |
| CSSUnitValue can be constructed with grad | FAIL | CSSUnitValue is not defined |
| CSSUnitValue can be constructed with rad | FAIL | CSSUnitValue is not defined |
| CSSUnitValue can be constructed with turn | FAIL | CSSUnitValue is not defined |
| CSSUnitValue can be constructed with s | FAIL | CSSUnitValue is not defined |
| CSSUnitValue can be constructed with ms | FAIL | CSSUnitValue is not defined |
| CSSUnitValue can be constructed with Hz | FAIL | CSSUnitValue is not defined |
| CSSUnitValue can be constructed with kHz | FAIL | CSSUnitValue is not defined |
| CSSUnitValue can be constructed with dpi | FAIL | CSSUnitValue is not defined |
| CSSUnitValue can be constructed with dpcm | FAIL | CSSUnitValue is not defined |
| CSSUnitValue can be constructed with dppx | FAIL | CSSUnitValue is not defined |
| CSSUnitValue can be constructed with fr | FAIL | CSSUnitValue is not defined |
/css/css-typed-om/stylevalue-subclasses/numeric-objects/cssUnitValue.html
<!doctype html> <meta charset="utf-8"> <title>CSSUnitValue Constructor</title> <link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-cssunitvalue-cssunitvalue"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../resources/testhelper.js"></script> <body> <div id="log"></div> <script> 'use strict'; test(() => { assert_throws_js(TypeError, () => new CSSUnitValue(0, 'lemon')); }, 'Constructing CSSUnitValue with an unknown unit throws a TypeError'); test(() => { assert_throws_js(TypeError, () => new CSSUnitValue(0, '')); }, 'Constructing CSSUnitValue with a empty string unit throws a TypeError'); for (const unit of gValidUnits) { test(() => { const result = new CSSUnitValue(-3.14, unit); assert_not_equals(result, null, 'a CSSUnitValue is created'); assert_equals(result.value, -3.14, 'value is same as given by constructor'); assert_equals(result.unit, unit.toLowerCase(), 'unit is same as given by constructor'); }, 'CSSUnitValue can be constructed with ' + unit); } </script>