New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 701790 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

-webkit-line-clamp does not properly obey line-height on last line when clamping is active

Reported by corbanbr...@gmail.com, Mar 15 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:51.0) Gecko/20100101 Firefox/51.0

Steps to reproduce the problem:
With the following css used to line-clamp I have found that although it respects the line-height to display the text the last line clamps the text too short resulting in a different height when clamping is active.

By active clamping i mean text that overflows the number of lines specified by -webkit-line-clamp.

ie. 3 lines of text that does not overflow would equal 72px high. 3 * 24px line-height.

but when text overflows and clamping is active (ellipsis appears) the height of the div shrinks to 67px high.

    line-height: 24px;
    font-size: 13px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    overflow: hidden;
    -webkit-box-orient: vertical;

What is the expected behavior?
The height should be 72px high (3 * 24px) but instead the last line gets cut too short and the height is 67px high.

What went wrong?
I believe that when line-clamp is active that it reverts to the browser default line-height when clamping the last line.

This can be tested by setting line-height: initial; the problem does not appear and a height of 45px appears for 3 lines of text overflowing or not. Using the default browser line-height of 15px for 13px font-size.

Did this work before? No 

Does this work in other browsers? N/A

Chrome version:  56.0.2924.87 (64-bit)  Channel: stable
OS Version: OS X 10.12
Flash Version: Shockwave Flash 21.0 r0
 
Cc: kavvaru@chromium.org
Labels: Needs-Feedback
Thanks for the issue.

Could you please provide us any sample test file or URL to triage the issue from test team end.

Thanks,

Here you go. Shows the difference in heights with various line-height and font-size combinations with 3 lines of text not overflowing vs overflowing.
line-clamp.html
4.6 KB View Download
Project Member

Comment 3 by sheriffbot@chromium.org, Mar 16 2017

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "kavvaru@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Components: -Blink>CSS Blink>Layout
Status: Untriaged (was: Unconfirmed)
I suspect this is layout related?

Comment 6 by e...@chromium.org, Mar 17 2017

Cc: e...@chromium.org
Status: WontFix (was: Untriaged)
Thank you for the detailed report and test case!

Given the non-standard nature of -webkit-line-clamp and the fact that we'd like to remove it (and replace it with a standardized version) we're unlikely to fix this unless it significantly breaks real world content.

I understand this might not be the answer you were looking for but we need to prioritize what we work on and we really do not want to encourage further use of non-standard features.

Sign in to add a comment