File: margin-001.html

package info (click to toggle)
thunderbird 1%3A140.3.1esr-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,608,628 kB
  • sloc: cpp: 7,671,698; javascript: 5,901,131; ansic: 3,898,955; python: 1,413,270; xml: 653,997; asm: 462,284; java: 180,948; sh: 113,489; makefile: 20,460; perl: 14,288; objc: 13,059; yacc: 4,583; pascal: 3,352; lex: 1,720; ruby: 1,222; exp: 762; sql: 715; awk: 580; php: 436; lisp: 430; sed: 70; csh: 10
file content (105 lines) | stat: -rw-r--r-- 3,391 bytes parent folder | download | duplicates (7)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
<link rel="help" href="https://drafts.csswg.org/cssom/#the-csspagerule-interface">
<title>CSSPageRule CSSOM test for nested cssRules (CSSMarginRule)</title>
<style id="sheet">
  @page {}
  @page {
    @top-center {}
  }
  @page {
    color: red;

    /* This property doesn't apply, but the declaration should still be
       included: */
    column-count: 7;

    @bottom-left {
      margin: inherit;
    }
    @top-right {
      content: "hot";
      font-size: 2em;
    }
    @top-left-corner {}
    @top-left {}
    @top-center {}
    @top-right {}
    @top-right-corner {}

    color: inherit;

    @right-top {}
    @right-middle {}
    @right-bottom {}
    @bottom-right-corner {}
    @bottom-right {}
    @bottom-center {}
    @bottom-left {}
    @bottom-left-corner {}
    @left-bottom {}
    @left-middle {}
    @left-top {}
    @herring {}

    margin-left: 111px;
  }
</style>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
  var sheet = document.getElementById("sheet").sheet;
  test(() => {
    assert_not_equals(sheet, null);
    assert_equals(sheet.rules.length, 3);
  }, "There should be 3 @page rules.");

  test(() => {
    assert_equals(sheet.rules[0].cssRules.length, 0);
  }, "Rule #0");

  test(() => {
    assert_equals(sheet.rules[1].cssRules.length, 1);
    assert_equals(sheet.rules[1].cssRules[0].style.length, 0);
  }, "Rule #1");

  test(() => {
    var pageRule = sheet.rules[2];
    var style = pageRule.style;
    assert_equals(style.length, 3);
    assert_equals(style.marginLeft, "111px");

    assert_equals(pageRule.cssRules.length, 18);

    var bottomLeft = pageRule.cssRules[0];
    assert_equals(bottomLeft.name, "bottom-left");
    assert_equals(bottomLeft.style.length, 4);
    assert_equals(bottomLeft.style.marginTop, "inherit");
    assert_equals(bottomLeft.style.marginRight, "inherit");
    assert_equals(bottomLeft.style.marginBottom, "inherit");
    assert_equals(bottomLeft.style.marginLeft, "inherit");

    var topRight = pageRule.cssRules[1];
    assert_equals(topRight.name, "top-right");
    assert_equals(topRight.style.length, 2);
    assert_equals(topRight.style.content, "\"hot\"");
    assert_equals(topRight.style.fontSize, "2em");

    assert_equals(pageRule.cssRules[2].name, "top-left-corner");
    assert_equals(pageRule.cssRules[3].name, "top-left");
    assert_equals(pageRule.cssRules[4].name, "top-center");
    assert_equals(pageRule.cssRules[5].name, "top-right");
    assert_equals(pageRule.cssRules[6].name, "top-right-corner");
    assert_equals(pageRule.cssRules[7].name, "right-top");
    assert_equals(pageRule.cssRules[8].name, "right-middle");
    assert_equals(pageRule.cssRules[9].name, "right-bottom");
    assert_equals(pageRule.cssRules[10].name, "bottom-right-corner");
    assert_equals(pageRule.cssRules[11].name, "bottom-right");
    assert_equals(pageRule.cssRules[12].name, "bottom-center");
    assert_equals(pageRule.cssRules[13].name, "bottom-left");
    assert_equals(pageRule.cssRules[14].name, "bottom-left-corner");
    assert_equals(pageRule.cssRules[15].name, "left-bottom");
    assert_equals(pageRule.cssRules[16].name, "left-middle");
    assert_equals(pageRule.cssRules[17].name, "left-top");
  }, "Rule #2");
</script>