Bug 187938 - Height of element changes when ellipses show on a -webkit-line-clamp element with line-height
Summary: Height of element changes when ellipses show on a -webkit-line-clamp element ...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Trivial
Assignee: Nobody
URL:
Keywords: InRadar
: 197525 (view as bug list)
Depends on:
Blocks: 233770
  Show dependency treegraph
 
Reported: 2018-07-23 19:13 PDT by thewingthing
Modified: 2022-06-30 09:37 PDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description thewingthing 2018-07-23 19:13:17 PDT
When there is an element with -webkit-line-clamp and line-height set, the height of the element is different when the text is just short enough to not warrant ellipses vs when the text is just long enough to warrant ellipses.

e.g.
With line-height
No ellipses: height is 44px
With ellipses: height is 42px

Without line-height
No ellipses: height is 38px
With ellipses: height is 38px
Comment 1 Sam Sneddon [:gsnedders] 2021-12-02 10:20:03 PST
*** Bug 197525 has been marked as a duplicate of this bug. ***
Comment 2 Sam Sneddon [:gsnedders] 2021-12-02 10:20:36 PST
From the dupe:

(In reply to Timothy Armstrong from comment #0)
> * What steps will reproduce the problem?
> 
> (1) Visit https://jsfiddle.net/4bzh2rv9/
> (2) Click the toggle button so that the box can no longer contain two lines
> of text (and shows an ellipsis).
> (3) Note that as soon as the above condition is met, the height of the box
> decreases, instead of allowing for the appropriate amount of line-height.
> 
> * What is the expected result?
> 
> The div height should not change once the ellipsis is present.
> 
> * What happens instead?
> 
> The div height shrinks once the ellipsis is present.
> 
> 
> (See also: crbug.com/937931)
Comment 3 Brent Fulgham 2022-06-30 09:33:26 PDT
This appears to be tracked by this radar:
<rdar://50448006>