Bug 214319

Summary: [iOS] Caret should be before text placeholder instead of after it
Product: WebKit Reporter: Daniel Bates <dbates>
Component: WebCore Misc.Assignee: Daniel Bates <dbates>
Status: RESOLVED FIXED    
Severity: Normal CC: ews-watchlist, mifenton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: iPhone / iPad   
OS: Unspecified   
Attachments:
Description Flags
For the bots
none
Patch
none
To Land
none
To Land none

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.