text-decoration-thickness-percent-001.html (2138B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>Test case for text-decoration-thickness</title> 6 <meta name="assert" content="text-decoration-thickness: percentage is resolved against computed font size"> 7 <link rel="author" title="Jonathan Kew" href="mailto:jkew@mozilla.com"> 8 <link rel="help" href="https://drafts.csswg.org/css-text-decor-4/#text-decoration-width-property"> 9 <link rel="match" href="reference/text-decoration-thickness-percent-001-ref.html"> 10 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> 11 <style> 12 div { 13 position: absolute; 14 top: 50px; 15 line-height: 100px; 16 } 17 u, span { 18 display: inline-block; 19 font: 20px/1 Ahem; 20 width: 100px; 21 text-align-last: justify; 22 } 23 span { 24 color: red; 25 /* shift the glyphs down to where the test underlines will be */ 26 position: relative; 27 top: 0.8em; 28 } 29 u { 30 color: transparent; 31 text-decoration: green underline; 32 text-decoration-skip-ink: none; 33 /* place underline exactly at the bottom of the text */ 34 text-underline-position: auto; 35 text-underline-offset: 0px; 36 text-decoration-skip-ink: none; 37 text-decoration-thickness: 20px; 38 } 39 .test0, .test1, .test2 { 40 /* set thickness to computed font size */ 41 text-decoration-thickness: 100%; 42 } 43 .test1 { 44 font-size-adjust: 0.25; /* this should result in a smaller used font size */ 45 } 46 .test2 { 47 font-size-adjust: 1.25; /* this should result in a larger used font size */ 48 } 49 </style> 50 </head> 51 <body> 52 <p>Test passes if there are four equal green rectangles and no red</p> 53 <div> 54 <span>X X</span> 55 <span>X X</span> 56 <span>X X</span> 57 <span>X X</span> 58 </div> 59 <div> 60 <u>X X</u> 61 <u class=test0>X X</u> 62 <u class=test1>X X</u> 63 <u class=test2>X X</u> 64 </div> 65 </body> 66 </html>