Bug 223563 - [iOS] Composition text is not initially highlighted when typing in text fields using Pinyin keyboard
Summary: [iOS] Composition text is not initially highlighted when typing in text field...
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: 2021-03-21 10:23 PDT by Wenson Hsieh
Modified: 2021-03-22 14:00 PDT (History)
8 users (show)

See Also:


Attachments
Patch (13.58 KB, patch)
2021-03-21 11:00 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff
Patch (10.44 KB, patch)
2021-03-21 23:49 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff
Patch (13.13 KB, patch)
2021-03-21 23:58 PDT, Wenson Hsieh
koivisto: review+
Details | Formatted Diff | Diff
Alternate approach (6.00 KB, patch)
2021-03-22 09:04 PDT, Wenson Hsieh
koivisto: review+
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

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