summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/css/getComputedStyle/counter-reset-with-none.html
blob: fed6da50524494d2ae052b37fe7e2cf6359c0604 (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<!DOCTYPE html>
<style>
#counterReset {
    counter-reset: c 10;
}

#counterIncrement {
    counter-increment: c 2;
}

#counterResetAndIncrementSameCounter {
    counter-reset: c 10;
    counter-increment: c 2;
}

#counterResetAndIncrementDifferentCounter {
    counter-reset: a 5;
    counter-increment: c 2;
}
</style>
<div id="counterReset"></div>
<div id="counterIncrement"></div>
<div id="counterResetAndIncrementSameCounter"></div>
<div id="counterResetAndIncrementDifferentCounter"></div>
<script src="../../../resources/js-test.js"></script>
<script>
description("Test that resetting 'counter-reset' and 'counter-increment' with 'none' works as expected.");

debug("Testing resetting 'counter-reset' alone");
shouldBeEqualToString('window.getComputedStyle(counterReset, null).getPropertyValue("counter-reset")', 'c 10');
shouldBeEqualToString('window.getComputedStyle(counterReset, null).getPropertyValue("counter-increment")', 'none');
counterReset.style.counterReset = "none";
shouldBeEqualToString('window.getComputedStyle(counterReset, null).getPropertyValue("counter-reset")', 'none');
shouldBeEqualToString('window.getComputedStyle(counterReset, null).getPropertyValue("counter-increment")', 'none');

debug("Testing resetting 'counter-increment' alone");
shouldBeEqualToString('window.getComputedStyle(counterIncrement, null).getPropertyValue("counter-reset")', 'none');
shouldBeEqualToString('window.getComputedStyle(counterIncrement, null).getPropertyValue("counter-increment")', 'c 2');
counterIncrement.style.counterIncrement = "none";
shouldBeEqualToString('window.getComputedStyle(counterIncrement, null).getPropertyValue("counter-reset")', 'none');
shouldBeEqualToString('window.getComputedStyle(counterIncrement, null).getPropertyValue("counter-increment")', 'none');

debug("Testing resetting 'counter-reset' with 'counter-increment'");
shouldBeEqualToString('window.getComputedStyle(counterResetAndIncrementSameCounter, null).getPropertyValue("counter-reset")', 'c 10');
shouldBeEqualToString('window.getComputedStyle(counterResetAndIncrementSameCounter, null).getPropertyValue("counter-increment")', 'c 2');
counterResetAndIncrementSameCounter.style.counterReset = "none";
shouldBeEqualToString('window.getComputedStyle(counterResetAndIncrementSameCounter, null).getPropertyValue("counter-reset")', 'none');
shouldBeEqualToString('window.getComputedStyle(counterResetAndIncrementSameCounter, null).getPropertyValue("counter-increment")', 'c 2');

debug("Testing resetting 'counter-increment' with 'counter-reset'");
shouldBeEqualToString('window.getComputedStyle(counterResetAndIncrementDifferentCounter, null).getPropertyValue("counter-reset")', 'a 5');
shouldBeEqualToString('window.getComputedStyle(counterResetAndIncrementDifferentCounter, null).getPropertyValue("counter-increment")', 'c 2');
counterResetAndIncrementDifferentCounter.style.counterIncrement = "none";
shouldBeEqualToString('window.getComputedStyle(counterResetAndIncrementDifferentCounter, null).getPropertyValue("counter-reset")', 'a 5');
shouldBeEqualToString('window.getComputedStyle(counterResetAndIncrementDifferentCounter, null).getPropertyValue("counter-increment")', 'none');
</script>