textarea-pre-wrap-012.html (1345B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Text level 3 Test: preserved white space at the end of soft-wrapped lines and white-space:pre-wrap with right alignement in a textarea</title> 4 <link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/"> 5 <link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2"> 6 <link rel="match" href="reference/pre-wrap-012-ref.html"> 7 <meta name="assert" content="When white-space is pre-wrap, only spaces at the end of soft-wrapped lines get collapsed or hanged, so they do not have any effect when right aligning."> 8 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 9 <style> 10 textarea { 11 word-wrap: initial; /*deprecated alias*/ 12 overflow-wrap: initial; 13 line-break: initial; 14 word-break: initial; 15 margin: 0; 16 padding: 0; 17 border: none; 18 outline: none; 19 resize: none; 20 overflow: hidden; /* I don't want scrollbars, and overflow:visible isn't typically supported on textarea */ 21 22 font-size: 20px; 23 font-family: Ahem; 24 line-height: 1em; 25 white-space: pre-wrap; 26 color: green; 27 28 background: linear-gradient(red, red) 1ch 0/2ch 2ch no-repeat; 29 30 width: 3ch; 31 text-align: right; 32 } 33 </style> 34 <body> 35 <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p> 36 <textarea>XX  37 XX </textarea> 38 </body>