summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-text-decor/text-decoration-lines-001.html
blob: a87218a20efb2ea5e95514ccc6b0d0a5b1c5fd4f (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
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Text Decoration Test: text-decoration setting several lines and thickness</title>
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com">
<link rel="help" href="https://drafts.csswg.org/css-text-decor-4/#text-decoration-line-property">
<meta name="assert" content="Checks that different text decoration lines, even when you get multiple lines in the same declaration, work as expected with different decoration thickness.">
<link rel="match" href="reference/text-decoration-lines-001-ref.html">
<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";
      let decoration = document.createElement("div");
      decoration.className = "decoration";
      decoration.innerHTML = "X";
      decoration.style.textDecorationLine = line;
      decoration.style.textDecorationThickness = thickness;
      wrapper.appendChild(decoration);
      document.body.appendChild(wrapper);
    }
  }
</script>