Status: PASS | Duration: 5ms | Subtests: 1/1 | Open test on wpt.live | Open ref on wpt.live | wpt.fyi
/css/css-text/tab-size/tab-min-rendered-width-1.html
<!DOCTYPE html> <html> <head> <title>CSS Text Test: minimum rendered width of tab character</title> <link rel="author" title="Jonathan Kew" href="mailto:jkew@mozilla.com"> <link rel="reviewer" title="Xidorn Quan" href="https://www.upsuper.org/"> <link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2"> <link rel="match" href="tab-min-rendered-width-1-ref.html"> <meta name="assert" content="If [rendered width of tab would be] less than 0.5ch, then the subsequent tab stop is used instead."> <link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style> span { background-color: yellow; display: inline-block; } /* Using 16px Ahem means that the 'ch' unit will be evenly divisible by 8 (for the 0.125ch increment used below) without running into floating-point accuracy limitations */ pre { position: absolute; top: 0; font: 16px Ahem; } tt { font: 16px monospace; } </style> </head> <body> <pre> </pre> <script> let pre = document.getElementsByTagName("pre")[0]; let test = ""; for (i = 7.0; i <= 8.125; i += 0.125) { test += `<span style="width:${i}ch"><tt>${i}ch</tt></span>	<tt>foo</tt>\n`; } pre.innerHTML = test; </script> </body> </html>
/css/css-text/tab-size/tab-min-rendered-width-1-ref.html
<!DOCTYPE html> <html> <head> <title>CSS Text Test: minimum rendered width of tab character</title> <link rel="author" title="Jonathan Kew" href="mailto:jkew@mozilla.com"> <link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style> span { background-color: yellow; display: inline-block; } pre { position: absolute; top: 0; font: 16px Ahem; } tt { font: 16px monospace; } </style> </head> <body> <pre> </pre> <pre> </pre> <script> let pre = document.getElementsByTagName("pre")[0]; let test = ""; for (i = 7.0; i <= 8.125; i += 0.125) { test += `<span style="width:${i}ch"><tt>${i}ch</tt></span>\n`; } pre.innerHTML = test; pre = document.getElementsByTagName("pre")[1]; test = ""; for (i = 0; i < 5; i++) { test += `\t<tt>foo</tt>\n`; } for (i = 0; i < 5; i++) { test += `\t\t<tt>foo</tt>\n`; } pre.innerHTML = test; </script> </body> </html>