зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1385514 - Part 1: Make SetTextTransaction a selection preserving transaction; r=masayuki
This makes the SetTextTransaction transaction behave more similarly to the rest of the editor transactions, by making sure the inner transactions don't manipulate the selections themselves and leave it up to the AfterEdit() method to take care of adjusting the selection when the entire editing operation is finished.
This commit is contained in:
Родитель
d29f92675d
Коммит
5c7a6f8e12
|
@ -901,6 +901,9 @@ TextEditRules::WillSetText(Selection& aSelection,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
// don't spaz my selection in subtransactions
|
||||
AutoTransactionsConserveSelection dontSpazMySelection(textEditor);
|
||||
|
||||
// Even if empty text, we don't remove text node and set empty text
|
||||
// for performance
|
||||
nsresult rv = textEditor->SetTextImpl(aSelection, tString,
|
||||
|
|
Загрузка…
Ссылка в новой задаче