summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-text-decor/text-decoration-thickness-percent-001.html
blob: 0d1f334b1e6d3eb5045338b445429cb17dcdaca9 (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
57
58
59
60
61
62
63
64
65
66
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Test case for text-decoration-thickness</title>
    <meta name="assert" content="text-decoration-thickness: percentage is resolved against computed font size">
    <link rel="author" title="Jonathan Kew" href="mailto:jkew@mozilla.com">
    <link rel="help" href="https://drafts.csswg.org/css-text-decor-4/#text-decoration-width-property">
    <link rel="match" href="reference/text-decoration-thickness-percent-001-ref.html">
    <link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
    <style>
        div {
            position: absolute;
            top: 50px;
            line-height: 100px;
        }
        u, span {
            display: inline-block;
            font: 20px/1 Ahem;
            width: 100px;
            text-align-last: justify;
        }
        span {
            color: red;
            /* shift the glyphs down to where the test underlines will be */
            position: relative;
            top: 0.8em;
        }
        u {
            color: transparent;
            text-decoration: green underline;
            text-decoration-skip-ink: none;
            /* place underline exactly at the bottom of the text */
            text-underline-position: auto;
            text-underline-offset: 0px;
            text-decoration-skip-ink: none;
            text-decoration-thickness: 20px;
        }
        .test0, .test1, .test2 {
            /* set thickness to computed font size */
            text-decoration-thickness: 100%;
        }
        .test1 {
            font-size-adjust: 0.25; /* this should result in a smaller used font size */
        }
        .test2 {
            font-size-adjust: 1.25; /* this should result in a larger used font size */
        }
    </style>
</head>
<body>
    <p>Test passes if there are four equal green rectangles and no red</p>
    <div>
      <span>X X</span>
      <span>X X</span>
      <span>X X</span>
      <span>X X</span>
    </div>
    <div>
      <u>X X</u>
      <u class=test0>X X</u>
      <u class=test1>X X</u>
      <u class=test2>X X</u>
    </div>
</body>
</html>