Bug 201471

Summary: -[WKContentView selectedText] returns an empty string when selecting more than 200 characters
Product: WebKit Reporter: Wenson Hsieh <wenson_hsieh>
Component: HTML EditingAssignee: Wenson Hsieh <wenson_hsieh>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, bfulgham, commit-queue, megan_gardner, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
thorton: review+
Fix non-internal iOS builds none

Description Wenson Hsieh 2019-09-04 14:56:01 PDT
<rdar://problem/55039227>
Comment 1 Wenson Hsieh 2019-09-04 15:38:38 PDT
Created attachment 378019 [details]
Patch
Comment 2 Tim Horton 2019-09-04 15:43:56 PDT
Comment on attachment 378019 [details]
Patch

I feel like it also wouldn't be crazy to bump it to like... 10k or something. But whatever.
Comment 3 Wenson Hsieh 2019-09-04 15:51:21 PDT
(In reply to Tim Horton from comment #2)
> Comment on attachment 378019 [details]
> Patch
> 
> I feel like it also wouldn't be crazy to bump it to like... 10k or
> something. But whatever.

Indeed!

I also feel like we should see if we can get rid of this altogether. Callers of this really seem to be interested in either one of two things:

- Is there any selected text?
- What is the full selected text?

It seems for (1), we could just make them check the length of the selected text instead, and for (2) refactor them to asynchronously grab the full text. Unfortunately, many of these call sites are in UIKit, so cleaning this up is a tad tricky :/
Comment 4 Wenson Hsieh 2019-09-04 15:56:57 PDT
Created attachment 378021 [details]
Fix non-internal iOS builds
Comment 5 WebKit Commit Bot 2019-09-04 18:17:20 PDT
Comment on attachment 378021 [details]
Fix non-internal iOS builds

Clearing flags on attachment: 378021

Committed r249508: <https://trac.webkit.org/changeset/249508>