Bug 185536 - Cleanup canPerformActionForWebView in relation to the webSelectionAssistant being removed
Summary: Cleanup canPerformActionForWebView in relation to the webSelectionAssistant b...
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: 2018-05-10 16:50 PDT by Megan Gardner
Modified: 2018-05-11 16:05 PDT (History)
4 users (show)

See Also:


Attachments
Patch (3.97 KB, patch)
2018-05-10 16:52 PDT, Megan Gardner
no flags Details | Formatted Diff | Diff
Patch (3.97 KB, patch)
2018-05-11 13:53 PDT, Megan Gardner
thorton: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Megan Gardner 2018-05-10 16:50:24 PDT
Cleanup canPerformActionForWebView in relation to the webSelectionAssistant being removed
Comment 1 Megan Gardner 2018-05-10 16:52:21 PDT
Created attachment 340147 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2018-05-10 16:55:42 PDT
<rdar://problem/40147338>
Comment 3 Tim Horton 2018-05-10 17:02:32 PDT
Comment on attachment 340147 [details]
Patch

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

> Source/WebKit/ChangeLog:8
> +        The _webSelectionAssistant is now always nil, therefor many of these checks are unnecessary.

therefore

> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:-2322
> -        // Don't attempt selectAll with general web content.

I’m confused... did this behavior (where we enable selectAll) change with your earlier change to always use the modern selection path?

> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:-2325
> -        // FIXME: Only enable if the selection doesn't already span the entire document.

Why’d this FIXME go away?
Comment 4 Wenson Hsieh 2018-05-10 17:32:15 PDT
Comment on attachment 340147 [details]
Patch

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

> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:2271
> +        if (_page->editorState().isInPasswordField || _page->editorState().selectionIsRange)

I think you're missing a ! here.
Comment 5 Megan Gardner 2018-05-11 13:51:39 PDT
Comment on attachment 340147 [details]
Patch

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

>> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:2271
>> +        if (_page->editorState().isInPasswordField || _page->editorState().selectionIsRange)
> 
> I think you're missing a ! here.

you're right, thanks!

>> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:-2322
>> -        // Don't attempt selectAll with general web content.
> 
> I’m confused... did this behavior (where we enable selectAll) change with your earlier change to always use the modern selection path?

It didn't really change, as this logic was overly complicated and _page->editorState().selectionIsRange is basically equivalent to hasWebSelection, especially in the new paradigm. This is just overly complicated so I wanted to clean this up separately to removing _webSelectionAssistant. This new logic basically says if you have a selection, and it's not ranged, which basically means if you have a caret, then allow SelectAll. You cannot have a selection that is not ranged in nonEditable text, so we only allow selectAll in editable content where there is no selection.

>> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:-2325
>> -        // FIXME: Only enable if the selection doesn't already span the entire document.
> 
> Why’d this FIXME go away?

Select All actually only appears when you have a caret selection, so you can only go from zero to everything, we don't even consider expanding via select all with a smaller selection. This mirrors Note's behavior.
Comment 6 Megan Gardner 2018-05-11 13:53:22 PDT
Created attachment 340220 [details]
Patch
Comment 7 Megan Gardner 2018-05-11 16:05:19 PDT
https://trac.webkit.org/changeset/231726/webkit