Bug 214319 - [iOS] Caret should be before text placeholder instead of after it
Summary: [iOS] Caret should be before text placeholder instead of after it
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Local Build
Hardware: iPhone / iPad Unspecified
: P2 Normal
Assignee: Daniel Bates
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-07-14 13:52 PDT by Daniel Bates
Modified: 2020-07-15 13:28 PDT (History)
4 users (show)

See Also:


Attachments
For the bots (981 bytes, patch)
2020-07-14 13:54 PDT, Daniel Bates
no flags Details | Formatted Diff | Diff
Patch (9.40 KB, patch)
2020-07-14 16:16 PDT, Daniel Bates
no flags Details | Formatted Diff | Diff
To Land (16.13 KB, patch)
2020-07-15 13:08 PDT, Daniel Bates
no flags Details | Formatted Diff | Diff
To Land (16.27 KB, patch)
2020-07-15 13:22 PDT, Daniel Bates
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 2020-07-14 13:52:54 PDT
To match UIKit the caret should be placed before the text placeholder instead of after it.
Comment 1 Daniel Bates 2020-07-14 13:53:08 PDT
<rdar://problem/65295523>
Comment 2 Daniel Bates 2020-07-14 13:54:22 PDT
Created attachment 404278 [details]
For the bots
Comment 3 Daniel Bates 2020-07-14 16:16:30 PDT
Created attachment 404300 [details]
Patch
Comment 4 Daniel Bates 2020-07-14 18:54:57 PDT
Comment on attachment 404300 [details]
Patch

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

> Source/WebCore/editing/Editor.cpp:3326
> +    m_document.selection().setSelection(VisibleSelection { positionInParentBeforeNode(placeholder.ptr()), SEL_DEFAULT_AFFINITY }, FrameSelection::defaultSetSelectionOptions(UserTriggered));

This is not correct. positionInParentBeforeNode() will assert if the placeholder is not in the document. Will patch this up to check that...
Comment 5 Daniel Bates 2020-07-15 13:05:16 PDT
Thanks Wenson!
Comment 6 Daniel Bates 2020-07-15 13:08:11 PDT
Created attachment 404380 [details]
To Land
Comment 7 Daniel Bates 2020-07-15 13:22:12 PDT
Created attachment 404382 [details]
To Land
Comment 8 Daniel Bates 2020-07-15 13:28:11 PDT
Comment on attachment 404382 [details]
To Land

Clearing flags on attachment: 404382

Committed r264418: <https://trac.webkit.org/changeset/264418>
Comment 9 Daniel Bates 2020-07-15 13:28:12 PDT
All reviewed patches have been landed.  Closing bug.