-
Notifications
You must be signed in to change notification settings - Fork 3.3k
/
Copy pathsibling-function-descriptors.tentative.html
45 lines (41 loc) · 1.38 KB
/
sibling-function-descriptors.tentative.html
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
<!DOCTYPE html>
<title>CSS Values and Units Test: sibling-index() and sibling-count() invalid in descriptors</title>
<link rel="help" href="https://drafts.csswg.org/css-values-5/#tree-counting">
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/10982">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style id="test_sheet">
@page {
margin: 100px;
margin: calc(0px * sibling-index());
}
@page {
margin: 100px;
margin: calc(0px * sibling-count());
}
@font-face {
font-family: my-font;
font-weight: 300;
font-weight: calc(max(0 * sibling-index(), 400));
}
@font-face {
font-family: my-font;
font-weight: 300;
font-weight: calc(max(0 * sibling-count(), 400));
}
</style>
<script>
const rules = test_sheet.sheet.cssRules;
test(() => {
assert_equals(rules[0].style.margin, "100px");
}, "sibling-index() should not be allowed in @page properties");
test(() => {
assert_equals(rules[1].style.margin, "100px");
}, "sibling-count() should not be allowed in @page properties");
test(() => {
assert_equals(rules[2].style.fontWeight, "300");
}, "sibling-index() should not be allowed in @font-face descriptors");
test(() => {
assert_equals(rules[3].style.fontWeight, "300");
}, "sibling-count() should not be allowed in @font-face descriptors");
</script>