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-typed-om/set-var-reference-thcrash.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>Don't crash when setting a CSSVariableReferenceValue</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
:root { --x: green; }
</style>
<div id="target"></div>
<script>
test(function(){
let ref = new CSSVariableReferenceValue('--x')
let unparsed = new CSSUnparsedValue([' ', ref]);
target.attributeStyleMap.set('color', unparsed);
assert_equals('rgb(0, 128, 0)', target.computedStyleMap().get('color').toString());
}, 'Do not crash when referencing a variable with CSSVariableReferenceValue');
</script>