Bug 223563

Summary: [iOS] Composition text is not initially highlighted when typing in text fields using Pinyin keyboard
Product: WebKit Reporter: Wenson Hsieh <wenson_hsieh>
Component: HTML EditingAssignee: Wenson Hsieh <wenson_hsieh>
Status: RESOLVED FIXED    
Severity: Normal CC: ews-watchlist, koivisto, mifenton, rniwa, thorton, webkit-bug-importer, wenson_hsieh, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
koivisto: review+
Alternate approach koivisto: review+, ews-feeder: commit-queue-

Description Wenson Hsieh 2021-03-21 10:23:29 PDT
<rdar://problem/75564516>
Comment 1 Wenson Hsieh 2021-03-21 11:00:46 PDT Comment hidden (obsolete)
Comment 2 Wenson Hsieh 2021-03-21 23:49:17 PDT Comment hidden (obsolete)
Comment 3 Wenson Hsieh 2021-03-21 23:58:26 PDT
Created attachment 423858 [details]
Patch
Comment 4 zalan 2021-03-22 08:24:22 PDT
The line layout integration part is r+ (don't know enough about editing to give educated review on the other part)
Comment 5 Wenson Hsieh 2021-03-22 09:04:07 PDT
Created attachment 423893 [details]
Alternate approach
Comment 6 Wenson Hsieh 2021-03-22 09:12:18 PDT
(In reply to zalan from comment #4)
> The line layout integration part is r+ (don't know enough about editing to
> give educated review on the other part)

The editing part of that patch is the part I'm iffy about too; the problem is that layout code would need to somehow know what text node the typing command is going to create or modify before the first layout pass after inserting that node, which would either intricate plumbing through edit commands, or something like this where we try and figure out where we're inserting the text ahead of time.

I uploaded an alternative approach to fixing this that's more similar to how macOS works (i.e. calling into ensureLineBoxes() instead of adding layout integration avoidance). Let's see what people think!
Comment 7 Antti Koivisto 2021-03-22 09:34:54 PDT
I think both approaches are fine. The ensureLineBoxes one is the minimal fix and might be appropriate for the branch.
Comment 8 EWS 2021-03-22 13:26:18 PDT
commit-queue failed to commit attachment 423893 [details] to WebKit repository. To retry, please set cq+ flag again.
Comment 9 Wenson Hsieh 2021-03-22 14:00:49 PDT
Committed: <https://commits.webkit.org/235598@main>