Same text, same exaggerated line-height: 2.2, in all four rows. The highlight color behind "Agypqj" (a cap, an ascender, and three different descenders, chosen to catch trimming on both edges) is the text's actual box, background-color always fills the full line box, trimmed or not. Watch the highlight shrink from the top only, then the bottom only, then both, as text-box-trim changes.
text-box-trim: normal;
Agypqjtext-box-trim: trim-start;
text-box-edge: cap alphabetic;
text-box-trim: trim-end;
text-box-edge: cap alphabetic;
text-box-trim: trim-both;
text-box-edge: cap alphabetic;