Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /css/css-properties-values-api/registered-property-ident-function.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>CSS Properties Values API: Registered custom properties with ident()</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
@property --ident {
syntax: "<custom-ident>";
inherits: true;
initial-value: none;
}
</style>
<div id=target></div>
<script>
let actual_ident = 'ident("--myident" calc(42 * sign(1em - 1px)))';
let expected_ident = '--myident42';
test((t) => {
t.add_cleanup(() => { target.style = ''; })
target.style.setProperty('--ident', actual_ident);
assert_equals(getComputedStyle(target).getPropertyValue('--ident'),
expected_ident);
}, 'The ident() function is resolved in a registered custom property');
</script>