Bug 170328 - [WK2] Tapping away to dismiss the selection does not update the selected DOM range using character granularity
Summary: [WK2] Tapping away to dismiss the selection does not update the selected DOM ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-03-30 23:32 PDT by Wenson Hsieh
Modified: 2017-03-31 16:19 PDT (History)
4 users (show)

See Also:


Attachments
Patch (7.01 KB, patch)
2017-03-31 13:46 PDT, Wenson Hsieh
thorton: review+
Details | Formatted Diff | Diff
Patch for landing (7.25 KB, patch)
2017-03-31 14:53 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff
Address post-review feedback (1.78 KB, patch)
2017-03-31 16:12 PDT, Wenson Hsieh
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wenson Hsieh 2017-03-30 23:32:40 PDT
<rdar://problem/30904558>
Comment 1 Wenson Hsieh 2017-03-31 13:46:13 PDT
Created attachment 306008 [details]
Patch
Comment 2 Wenson Hsieh 2017-03-31 14:53:33 PDT
Created attachment 306014 [details]
Patch for landing
Comment 3 WebKit Commit Bot 2017-03-31 15:36:03 PDT
Comment on attachment 306014 [details]
Patch for landing

Clearing flags on attachment: 306014

Committed r214692: <http://trac.webkit.org/changeset/214692>
Comment 4 mitz 2017-03-31 15:50:03 PDT
Comment on attachment 306014 [details]
Patch for landing

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

> Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:2982
> +    if (_webView.configuration.selectionGranularity != WKSelectionGranularityCharacter)
> +        return;
> +

Why is this dependent on the selection granularity rather than the kind of selection assistant we are currently using. In other words, why does this bug (and fix) not apply to contenteditable elements in web views that don’t opt into character granularity?
Comment 5 Wenson Hsieh 2017-03-31 16:07:22 PDT
(In reply to mitz@webkit.org from comment #4)
> Comment on attachment 306014 [details]
> Patch for landing
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=306014&action=review
> 
> > Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:2982
> > +    if (_webView.configuration.selectionGranularity != WKSelectionGranularityCharacter)
> > +        return;
> > +
> 
> Why is this dependent on the selection granularity rather than the kind of
> selection assistant we are currently using. In other words, why does this
> bug (and fix) not apply to contenteditable elements in web views that don’t
> opt into character granularity?

Good point. This handling should apply when using the text interaction assistant rather than when using selectionGranularity WKSelectionGranularityCharacter. I'll fix this in a followup patch.
Comment 6 Wenson Hsieh 2017-03-31 16:12:48 PDT
Created attachment 306024 [details]
Address post-review feedback
Comment 7 Wenson Hsieh 2017-03-31 16:19:54 PDT
Landed followup: <http://trac.webkit.org/changeset/214696>