Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

<!DOCTYPE html>
<title>Don't crash when setting a CSSVariableReferenceValue</title>
<link rel="help" href="https://crbug.com/986710<;">
<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>