Bug 201471 - -[WKContentView selectedText] returns an empty string when selecting more than 200 characters
Summary: -[WKContentView selectedText] returns an empty string when selecting more tha...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-09-04 14:56 PDT by Wenson Hsieh
Modified: 2022-08-02 13:39 PDT (History)
7 users (show)

See Also:


Attachments
Patch (4.46 KB, patch)
2019-09-04 15:38 PDT, Wenson Hsieh
thorton: review+
Details | Formatted Diff | Diff
Fix non-internal iOS builds (5.31 KB, patch)
2019-09-04 15:56 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>