Bug 214326

Summary: Selection is not always clearing when tapping.
Product: WebKit Reporter: Megan Gardner <megan_gardner>
Component: New BugsAssignee: Megan Gardner <megan_gardner>
Severity: Normal CC: thorton, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Description Flags
Patch for landing none

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
Comment 2 Megan Gardner 2020-07-14 16:35:17 PDT
Created attachment 404305 [details]
Comment 3 Wenson Hsieh 2020-07-14 16:40:34 PDT
Comment on attachment 404305 [details]

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]
Comment 7 Wenson Hsieh 2020-07-16 13:05:37 PDT
Comment on attachment 404476 [details]

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