Bug 216097

Summary: Simplify some editing code
Product: WebKit Reporter: Darin Adler <darin>
Component: HTML EditingAssignee: Darin Adler <darin>
Severity: Normal CC: cdumez, changseok, commit-queue, esprehn+autocc, ews-watchlist, gyuyoung.kim, kangil.han, mifenton, sam, tsavell, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Bug Depends on: 216143    
Bug Blocks:    
Description Flags
Patch none

Description Darin Adler 2020-09-02 14:12:54 PDT
Simplify some editing code
Comment 1 Darin Adler 2020-09-02 14:15:54 PDT
Created attachment 407810 [details]
Comment 2 Darin Adler 2020-09-02 14:19:23 PDT
Came from one of the things Sam Weinig asked for in my last patch.
Comment 3 EWS 2020-09-02 18:32:46 PDT
Committed r266498: <https://trac.webkit.org/changeset/266498>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 407810 [details].
Comment 4 Radar WebKit Bug Importer 2020-09-02 18:33:46 PDT
Comment 5 Truitt Savell 2020-09-03 10:31:16 PDT
It looks like the changes in https://trac.webkit.org/changeset/266498/webkit

has caused editing/inserting/insert-paragraph-separator-crash.html

to crash constantly with an assertion on Mac and iOS debug


Comment 6 Truitt Savell 2020-09-03 10:37:16 PDT
Created https://bugs.webkit.org/show_bug.cgi?id=216128 to track this
Comment 7 Darin Adler 2020-09-03 14:08:26 PDT
Lets roll this out. I will re-land after fixing.
Comment 8 WebKit Commit Bot 2020-09-03 14:33:52 PDT
Re-opened since this is blocked by bug 216143
Comment 9 Darin Adler 2020-09-04 10:22:34 PDT
Comment on attachment 407810 [details]

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

> Source/WebCore/page/DOMSelection.cpp:344
> +    frame->selection().setSelectedRange(makeSimpleRange(selectedRange->start), Affinity::Upstream, FrameSelection::ShouldCloseTyping::No);

Turns out this needs to be Affinity::Downstream to preserve behavior. Might be correct to have it be upstream, but requires changes elsewhere. Landing with Affinity::Downstream to preserve behavior.
Comment 10 Darin Adler 2020-09-04 10:22:56 PDT
Committed r266618: <https://trac.webkit.org/changeset/266618>