Bug 190905 - REGRESSION (r237255): Selection not painted for text with overflow:hidden
Summary: REGRESSION (r237255): Selection not painted for text with overflow:hidden
Status: RESOLVED DUPLICATE of bug 190899
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Mac macOS 10.14
: P1 Normal
Assignee: Ali Juma
URL:
Keywords: InRadar, Regression
Depends on: 189833
Blocks:
  Show dependency treegraph
 
Reported: 2018-10-25 10:10 PDT by Daniel Bates
Modified: 2018-10-25 12:52 PDT (History)
6 users (show)

See Also:


Attachments
Example (248 bytes, text/html)
2018-10-25 10:12 PDT, Daniel Bates
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 2018-10-25 10:10:28 PDT
Selection is no longer painted for text with CSS overflow:hidden.

Open the page with the following markup in Safari:

[[
<style>
.test {
    text-decoration: underline;
}

.test::selection {
    background-color: blue;
    color: white;
}

.hidden {
    overflow: hidden;
}
</style>
<p class="test">First line of text.</p>
<p class="test hidden">Second line of text</p>
]]

Click and drag from the word "Second" in the second line of text to the end of the line. No selection highlight is drawn. Compare to the behavior of clicking and dragging from the word "First" in the first line to the end of that line. I would have expected the same selection behavior for both lines. Additionally, if you focus the page and choose Edit > Select All then only the first line and the gap between the first and second line are painted as selected. That is, the second line of text is not painted as selected. I would have expected all lines of text to have been painted as selected.

Weirdly, if you go through the motions to select the second line of text (e.g. click and drag from the word "Second" in the second of line text to the end of the line) then click where the selection would have been painted then the selection will be painted.
Comment 1 Radar WebKit Bug Importer 2018-10-25 10:11:02 PDT
<rdar://problem/45557072>
Comment 2 Daniel Bates 2018-10-25 10:12:19 PDT
Created attachment 353090 [details]
Example

For convenience, here is a file with the markup given in comment #0.
Comment 3 Daniel Bates 2018-10-25 11:28:58 PDT
This regression was caused by <http://trac.webkit.org/changeset/237255> (bug #189833)
Comment 4 Daniel Bates 2018-10-25 11:30:16 PDT

*** This bug has been marked as a duplicate of bug 190899 ***
Comment 5 Ali Juma 2018-10-25 12:51:43 PDT
Reopening to attach new patch.
Comment 6 Ali Juma 2018-10-25 12:52:43 PDT
Whoops, meant to attach a patch to the other bug.

*** This bug has been marked as a duplicate of bug 190899 ***