Crash in WebCore::InsertTextCommand::positionInsideTextNode
authorgnavamarino@apple.com <gnavamarino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 May 2022 23:58:42 +0000 (23:58 +0000)
committergnavamarino@apple.com <gnavamarino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 May 2022 23:58:42 +0000 (23:58 +0000)
commit7e6e5e7aedfd8868736edd4ac106bd8fd1f56b28
tree130fe78ef307abfdd19e2be4faa1a497e869107d
parent9be7cf1f737505d128f6f68599b3db34bb5d05c5
Crash in WebCore::InsertTextCommand::positionInsideTextNode
https://bugs.webkit.org/show_bug.cgi?id=240480

Reviewed by Ryosuke Niwa.

Calling pushAnchorElementDown in CompositeEditCommand::positionAvoidingSpecialElementBoundary can
end up removing the startPosition's container node which leaves an invalid endingSelection.

InsertTextCommand::doApply requires a real endingSelection, so we should check if this occurred and bail out.

* editing/InsertTextCommand.cpp:
(WebCore::InsertTextCommand::doApply):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@294281 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/editing/InsertTextCommand.cpp