wpt / css / css-inline / text-box-trim / text-box-trim-line-clamp-auto-002.html

Status: FAIL | Duration: 11ms | Subtests: 0/1 | Open test on wpt.live | Open ref on wpt.live | wpt.fyi

/css/css-inline/text-box-trim/text-box-trim-line-clamp-auto-002.html

<!DOCTYPE html>
<meta charset="UTF-8">
<title>text-box-trim applies to the last line before clamp when clamping by a height</title>
<link rel="help" href="https://drafts.csswg.org/css-inline-3/#propdef-text-box-edge">
<link rel="help" href="https://drafts.csswg.org/css-inline-3/#propdef-text-box-trim">
<link rel="match" href="text-box-trim-line-clamp-auto-002-ref.html">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<style>
.spacer {
  background: lightgray;
  block-size: 100px;
}
.target {
  font: 50px/2 Ahem;
  text-box-trim: trim-end;
  text-box-edge: text;

  /* 385px will fit 4 lines if the last line has its end trimmed
   * (4*100 - 25 = 375px), but it will fit 5 lines if all have their end trimmed
   * (5*(100 - 25) = 375px). This tests that only the last line gets trimmed. */
  line-clamp: auto;
  max-height: 385px;
}
</style>
<div class="spacer"></div>
<div class="target">
  A<br>
  B<br>
  C<br>
  D<br>
  E<br>
  F</div>
<div class="spacer"></div>

/css/css-inline/text-box-trim/text-box-trim-line-clamp-auto-002-ref.html

<!DOCTYPE html>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<style>
.spacer {
  background: lightgray;
  block-size: 100px;
}
.target {
  font-family: Ahem;
  font-size: 50px;
  line-height: 2;
  height: 375px;
}
</style>
<div class="spacer"></div>
<div class="target">
  A<br>
  B<br>
  C<br>
  D…</div>
<div class="spacer"></div>