summaryrefslogtreecommitdiffstats
path: root/editor/libeditor/HTMLEditRules.h
Commit message (Collapse)AuthorAgeLines
* Bug 1316302 - Part 3: Create EditActionResult class for making the methods ↵Gaming4JC2020-06-27-30/+24
| | | | | | | | | | | | | which return nsresult, handled and canceled with out params In a lot of places, edit action handlers and their helper methods return nsresult and aHandled and aCanceled with out params. However, the out params cause the code complicated since: * it's not unclear if the method will overwrite aHandled and aCanceled value. * callers need to create temporary variable event if some of them are not necessary. This patch rewrites the helper methods of HTMLEditRules::WillDeleteSelection() with it. Tag #1563
* Bug 1316302 - Part 1: Helper methods for ↵Gaming4JC2020-06-27-5/+61
| | | | | | | | | | | | HTMLEditRules::WillDeleteSelection() should have an out argument to indicates if it actually handles the action When HTMLEditRules::WillDeleteSelection() tries to remove something from the end/start of a block to its last/first text node but it's contained by block elements, it tries to join the container and the block. However, JoinBlocks() always fails to join them since it's impossible operation. In this case, HTMLEditRules::WillDeleteSelection() should retry to remove something in the leaf, however, it's impossible for now because JoinBlocks() and its helper methods don't return if it handles the action actually. This patch renames |JoinBlocks()| to |TryToJoinBlocks()| for representing what it is. And this patch adds |bool* aHandled| to the helper methods. Then, *aHandled and *aCancel are now always returns the result of each method. Therefore, for merging the result of multiple helper methods, callers need to receive the result with temporary variables and merge them by themselves. Note that when they modify DOM node actually or the action should do nothing (for example, selection is across tables), aHandled is set to true. Tag #1563
* Add m-esr52 at 52.6.0Matt A. Tobin2018-02-02-0/+377