Bug 199430 - REGRESSION (iOS 13): Tapping an element with a click event handler no longer clears the selection
Summary: REGRESSION (iOS 13): Tapping an element with a click event handler no longer ...
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
Keywords: InRadar
Depends on:
Reported: 2019-07-02 20:21 PDT by Wenson Hsieh
Modified: 2019-07-03 12:59 PDT (History)
6 users (show)

See Also:

Patch (13.81 KB, patch)
2019-07-03 08:22 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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]
Comment 2 Radar WebKit Bug Importer 2019-07-03 08:23:15 PDT
Comment 3 Tim Horton 2019-07-03 12:26:50 PDT
Comment on attachment 373390 [details]

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


> 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]

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.