Bug 214326 - Selection is not always clearing when tapping.
Summary: Selection is not always clearing when tapping.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Megan Gardner
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-07-14 15:40 PDT by Megan Gardner
Modified: 2020-07-16 14:59 PDT (History)
2 users (show)

See Also:


Attachments
Patch (2.13 KB, patch)
2020-07-14 16:35 PDT, Megan Gardner
no flags Details | Formatted Diff | Diff
Patch (6.74 KB, patch)
2020-07-16 12:57 PDT, Megan Gardner
no flags Details | Formatted Diff | Diff
Patch for landing (6.77 KB, patch)
2020-07-16 14:27 PDT, Megan Gardner
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Megan Gardner 2020-07-14 15:40:06 PDT
Selection is not always clearing when tapping.
Comment 1 Megan Gardner 2020-07-14 16:33:43 PDT
<rdar://problem/65069201>
Comment 2 Megan Gardner 2020-07-14 16:35:17 PDT
Created attachment 404305 [details]
Patch
Comment 3 Wenson Hsieh 2020-07-14 16:40:34 PDT
Comment on attachment 404305 [details]
Patch

Can we remove the `!_page->editorState().selectionIsRange` check too?

This is also something we should be able to write a test for.
Comment 4 Megan Gardner 2020-07-14 16:42:57 PDT
We can, but I figured it was a reasonable short-circuit, so I didn't take it out.
Comment 5 Wenson Hsieh 2020-07-14 16:51:20 PDT
(In reply to Megan Gardner from comment #4)
> We can, but I figured it was a reasonable short-circuit, so I didn't take it
> out.

👍🏻 Sounds reasonable
Comment 6 Megan Gardner 2020-07-16 12:57:21 PDT
Created attachment 404476 [details]
Patch
Comment 7 Wenson Hsieh 2020-07-16 13:05:37 PDT
Comment on attachment 404476 [details]
Patch

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

> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:2574
>                  if (!_page->editorState().selectionIsRange)
>                      return NO;
> -                return [self _pointIsInsideSelectionRect:point outBoundingRect:nil];
> +                return YES;

Nit - this might be cleaner as just `return _page->editorState().selectionIsRange;`

> LayoutTests/editing/selection/ios/hide-selection-after-tap-on-prevent-default-element.html:53
> +    //await UIHelper.delayFor(1000);

Nit - stray commented out code.
Comment 8 Megan Gardner 2020-07-16 14:27:06 PDT
Created attachment 404484 [details]
Patch for landing
Comment 9 EWS 2020-07-16 14:59:38 PDT
Committed r264481: <https://trac.webkit.org/changeset/264481>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 404484 [details].