summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-text-decor/reference/text-decoration-lines-001-ref.html
blob: a2d0c3dca74a1699e81a0b8afa085caff48f9025 (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
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Text Decoration Test: text-decoration setting several lines and thickness reference</title>
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
  .wrapper {
    position: relative;
    width: 10px;
    height: 100px;
    margin: 110px 2px;
    float: left;
  }
  .decoration {
    position: absolute;
    top: 0;
    left: 0;
    font: 10px/1 Ahem;
    color: transparent;
    text-decoration-color: green;
    text-decoration-style: solid;
    text-decoration-skip-ink: none;
  }
</style>
<p>The test passes if it matches the reference.</p>
<script>
  let lines = ["underline", "overline", "line-through",
               "underline overline", "underline line-through", "overline line-through",
               "underline overline line-through"];

  let thicknesses = ["1px", "10px", "50px", "100px"];

  for (let line of lines) {
    for (let thickness of thicknesses) {
      let wrapper = document.createElement("div");
      wrapper.className = "wrapper";

      for (let individualLine of line.split(" ")) {
        let decoration = document.createElement("div");
        decoration.className = "decoration";
        decoration.innerHTML = "X";
        decoration.style.textDecorationLine = individualLine;
        decoration.style.textDecorationThickness = thickness;
        wrapper.appendChild(decoration);
      }

      document.body.appendChild(wrapper);
    }
  }
</script>