Bug 45399 - -webkit-line-clamp is not respected when visibility is hidden
Summary: -webkit-line-clamp is not respected when visibility is hidden
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
Keywords: InRadar
: 207013 (view as bug list)
Depends on:
Blocks: 233770
  Show dependency treegraph
Reported: 2010-09-08 10:44 PDT by Rob Brackett
Modified: 2022-06-30 09:35 PDT (History)
5 users (show)

See Also:

Test case for -webkit-line-clamp and visibility hidden issue (5.70 KB, text/html)
2010-09-08 10:44 PDT, Rob Brackett
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Brackett 2010-09-08 10:44:06 PDT
Created attachment 66913 [details]
Test case for -webkit-line-clamp and visibility hidden issue

When an element with visibility: hidden and -webkit-line-clamp: [anything] is appended to the DOM, the line clamp is not respected, even after setting visibility: visible or removing the visibility setting altogether. Note that the problem really seems to be that -webkit-line-clamp is ignored when rendering an element with visibility: hidden, not when making it visible (although the problem continues to persist then).

Test case attached.

Brief example:
  <div id="root">
    <div id="container">
      <p id="clamped">
        Blah blah blah

1. Remove #container
2. Set visibility: hidden on #container
3. Append #container to #root
4. Remove visibility: hidden on #container

This also works if the element you remove and set visibility on is #clamped instead of #container. Just wanted to illustrate that it could be any node up the tree.
Comment 1 mralkanlar 2013-07-26 12:03:09 PDT
I can confirm the existence of this bug in Chrome Version 28.0.1500.71.
Comment 2 Dima Voytenko 2015-01-09 09:33:40 PST
Definitely seeing it on  39.0.2171.95: both desktop and mobile
Comment 3 Sam Sneddon [:gsnedders] 2021-12-02 10:17:56 PST
*** Bug 207013 has been marked as a duplicate of this bug. ***
Comment 4 Brent Fulgham 2022-06-30 09:35:57 PDT
This appears to be tracked by this radar: