summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-typed-om/set-var-reference-thcrash.html
blob: c6bc3cc2a39703fcaee050c459fa3182b5454cd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<!DOCTYPE html>
<title>Don't crash when setting a CSSVariableReferenceValue</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#cssvariablereferencevalue">
<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>