Bug 19127

Summary: Find... interacts oddly with -webkit-user-select: none
Product: WebKit Reporter: Pam Greene (IRC:pamg) <pam>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: UNCONFIRMED ---    
Severity: Normal CC: akeerthi, alexanderkahn, mitz, tonikitoo
Priority: P2 Keywords: InRadar
Version: 525.x (Safari 3.1)   
Hardware: All   
OS: All   
Bug Depends on: 251709    
Bug Blocks:    
Attachments:
Description Flags
Entire body is -webkit-user-select: none
none
Second line is -webkit-user-select: none none

Description Pam Greene (IRC:pamg) 2008-05-19 13:06:36 PDT
Trying to find text on a page with only un-selectable text (-webkit-user-select: none) fails to find any of the matches.

Finding text on a page with mixed sections of un-selectable text  and normally selectable text behaves more oddly.  The first match in the section of un-selectable text is marked, but won't be highlighted when cycling through the matches: there will be one "pause" with no match highlighted.  Any other matches in that section won't be found at all.

To see the first problem, load the attached body-user-select.html, cmd-F, and look for the letter t.  notice "not found".

To see the second problem, load the attached user-select.html, cmd-F, and look for the letter t.  Notice that only one t in the middle line is marked. Then cmd-G repeatedly to cycle through the matches and notice the "pause" when the t on that middle line would have been the active match.
Comment 1 Pam Greene (IRC:pamg) 2008-05-19 13:07:32 PDT
Created attachment 21231 [details]
Entire body is -webkit-user-select: none
Comment 2 Pam Greene (IRC:pamg) 2008-05-19 13:19:44 PDT
Created attachment 21232 [details]
Second line is -webkit-user-select: none
Comment 3 mitz 2010-10-07 23:00:32 PDT
<rdar://problem/8081660>
Comment 4 Alexander Kahn 2011-01-26 08:58:19 PST
I'm running into this bug as well. I'm on OS X 10.6.6 using WebKit nightly r76640.
Comment 5 Aditya Keerthi 2023-02-03 16:05:22 PST
To resolve this on iOS, we simply need to fix 251709.

To resolve this on macOS, additional work is required, since macOS only uses the current selection for find (doesn't store ranges as done on iOS).