Bug 199430

Summary: REGRESSION (iOS 13): Tapping an element with a click event handler no longer clears the selection
Product: WebKit Reporter: Wenson Hsieh <wenson_hsieh>
Component: HTML EditingAssignee: Wenson Hsieh <wenson_hsieh>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, commit-queue, megan_gardner, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Wenson Hsieh 2019-07-02 20:21:51 PDT
This makes it nearly impossible to truly dismiss a text selection on a New York Times article, Google search results page, and other big websites. I wrote “truly dismiss” because while it looks like the UIKit selection view disappears upon tapping, the DOM selection remains the same.

To reproduce:

1. Go to any New York Times article.
2. Make a text selection.
3. Try to dismiss the text selection by tapping on some other text. Notice that the blue tinted selection view disappears.
4. Open Web Inspector and type “getSelection().toString()”.

Expected: Empty string.
Observed: The originally selected text.
Comment 1 Wenson Hsieh 2019-07-03 08:22:16 PDT
Created attachment 373390 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2019-07-03 08:23:15 PDT
<rdar://problem/52589498>
Comment 3 Tim Horton 2019-07-03 12:26:50 PDT
Comment on attachment 373390 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=373390&action=review

> Source/WebCore/ChangeLog:8
> +        After <trac.webkit.org/r245067>, we no longer immediately clear the text selection when recognizing a single tap

Whoops

> Source/WebCore/ChangeLog:24
> +        breaking the fix in r233311 by matching macOS behavior and not bailing via early return in the case where the

Very nice!
Comment 4 WebKit Commit Bot 2019-07-03 12:59:08 PDT
Comment on attachment 373390 [details]
Patch

Clearing flags on attachment: 373390

Committed r247100: <https://trac.webkit.org/changeset/247100>
Comment 5 WebKit Commit Bot 2019-07-03 12:59:10 PDT
All reviewed patches have been landed.  Closing bug.