Bug 1764895 - part 3: Get rid of nsIEditor.setShouldTxnSetSelection r=m_kato DONTBUILD

It allows multiple edit action preserves `Selection` when updating the DOM tree.
However, most callers do not use `finally` to reset the state, and this makes
edit action handling complicated in some edge cases.  Therefore, let's stop
supporting this feature.  If Thunderbird requires the feature, the developers
should request additional param for preserving `Selection` like the preceding
patch.

Depends on D196004

Differential Revision: https://phabricator.services.mozilla.com/D196005
This commit is contained in:
Masayuki Nakano 2023-12-14 00:41:20 +00:00
parent 8582db0ea5
commit 5f6299d456
2 changed files with 0 additions and 23 deletions

View file

@ -1251,11 +1251,6 @@ void EditorBase::EndPlaceholderTransaction(
}
}
NS_IMETHODIMP EditorBase::SetShouldTxnSetSelection(bool aShould) {
MakeThisAllowTransactionsToChangeSelection(aShould);
return NS_OK;
}
NS_IMETHODIMP EditorBase::GetDocumentIsEmpty(bool* aDocumentIsEmpty) {
MOZ_ASSERT(aDocumentIsEmpty);
*aDocumentIsEmpty = IsEmpty();

View file

@ -316,24 +316,6 @@ interface nsIEditor : nsISupports
[can_run_script]
void endTransaction();
/**
* While setting the flag with this method to false, DeleteRangeTransaction,
* DeleteTextTransaction, InsertNodeTransaction, InsertTextTransaction and
* SplitNodeTransaction won't change Selection after modifying the DOM tree.
* Note that calling this with false does not guarantee that Selection won't
* be changed because other transaction may ignore this flag, editor itself
* may change selection, and current selection may become invalid after
* changing the DOM tree, etc.
* After calling this method with true, the caller should guarantee that
* Selection should be positioned where user expects.
*
* @param should false if you don't want above transactions to modify
* Selection automatically after modifying the DOM tree.
* Note that calling this with false does not guarantee
* that Selection is never changed.
*/
void setShouldTxnSetSelection(in boolean should);
/* ------------ Inline Spell Checking methods -------------- */
/** Returns the inline spell checker associated with this object. The spell