text-box-trim-line-clamp-auto-002.html (990B)
1 <!DOCTYPE html> 2 <meta charset="UTF-8"> 3 <title>text-box-trim applies to the last line before clamp when clamping by a height</title> 4 <link rel="help" href="https://drafts.csswg.org/css-inline-3/#propdef-text-box-edge"> 5 <link rel="help" href="https://drafts.csswg.org/css-inline-3/#propdef-text-box-trim"> 6 <link rel="match" href="text-box-trim-line-clamp-auto-002-ref.html"> 7 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 8 <style> 9 .spacer { 10 background: lightgray; 11 block-size: 100px; 12 } 13 .target { 14 font: 50px/2 Ahem; 15 text-box-trim: trim-end; 16 text-box-edge: text; 17 18 /* 385px will fit 4 lines if the last line has its end trimmed 19 * (4*100 - 25 = 375px), but it will fit 5 lines if all have their end trimmed 20 * (5*(100 - 25) = 375px). This tests that only the last line gets trimmed. */ 21 line-clamp: auto; 22 max-height: 385px; 23 } 24 </style> 25 <div class="spacer"></div> 26 <div class="target"> 27 A<br> 28 B<br> 29 C<br> 30 D<br> 31 E<br> 32 F</div> 33 <div class="spacer"></div>