summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/css/variables/cycle-detection-is-order-independent.html
blob: 7c6f03464193383f45b39c30fcc10686b95af828 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<!DOCTYPE html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<style>
div {
    width: 100px;
    height: 100px;
}
#firstdiv {
    --b: var(--b);
    --a: var(--b, green);
    background-color: var(--a,red);
}
#seconddiv {
    --c: var(--c);
    --d: var(--c, green);
    background-color: var(--d,red);
}
</style>

<div id=firstdiv></div>
<div id=seconddiv></div>

<script>
test(function() {
  assert_equals(getComputedStyle(firstdiv).backgroundColor, 'rgb(0, 128, 0)');
  assert_equals(getComputedStyle(seconddiv).backgroundColor, 'rgb(0, 128, 0)');
}, 'custom property cycles are marked invalid in the same way, independent of ordering.');
</script>