If empty input, aStringToInsert.First() will crash at https://searchfox.org/mozilla-central/rev/c2e3ac11be4837718c2604e58085fbc8252b69dd/xpcom/string/nsTSubstring.cpp#968 Needed to adjust whether rewrap needs beforeinput handling: NeedsBeforeInputEventHandling would return false, because rewrap was set not to need that https://searchfox.org/mozilla-central/rev/803b368879fa332e8e2c1840bf1ec164f7ed2c32/editor/libeditor/EditorBase.h#1152 .. so EditorBase::AutoEditActionDataSetter::MaybeDispatchBeforeInputEvent would assert rewrap also needs to be allowed for MayEditActionDeleteSelection (not to assert) Differential Revision: https://phabricator.services.mozilla.com/D93167
nsINode::GetSelectionRootContent()
MOZ_CAN_RUN_SCRIPT