Loading
Bug 1574852 - part 100: Get rid of `TextEditRules::DidDeleteSelection()` r=m_kato
There are only 3 callers and it does simple but different 2 things. One of the callers is `HTMLEditRules::DidDeleteSelection()` so that if same things are done by `TextEditor::DeleteSelectionAsSubAction()`, it does not need to duplicate the code. Therefore, we need to duplicate the code into `TextEditor::DeleteSelectionAsSubAction()` and `TextEditRules::WillSetText()`. Then, `TextEditRules::WillSetText()` can avoid accessing `Selection` since it still grabs the modified text node. Note that only when it's called by `TextEditRules::DidDoAction()`, `AutoTransactionsConserveSelection` has been set. However, neither `DeleteNodeWithTransaction()` nor `DeleteNodeTransaction::DoTransaction()` changes `Selection`. Therefore, it hasn't do anything. So, we can remove it right now. Differential Revision: https://phabricator.services.mozilla.com/D45294 --HG-- extra : moz-landing-system : lando