ec93f6db7e4b525495c549916a878972dfcda34d: Bug 1451672 - part 21: Refine TextEditor::TypedText() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Mon, 16 Apr 2018 23:43:36 +0900 - rev 786189
Push 107400 by bmo:gijskruitbosch+bugs@gmail.com at Sat, 21 Apr 2018 10:24:23 +0000
Bug 1451672 - part 21: Refine TextEditor::TypedText() r=m_kato According to existing comments, TextEditor::TypedText() and HTMLEditor::TypedText() are intentional bottleneck to debug. However, only for that purpose, it and its internal methods are made virtual. This really doesn't make sense. So, this patch creates TextEditor::OnInputText() for callers of TypedText() with non-empty string, TextEditor::OnInputParagraphSeparator() for callers of TypedText() with eTypeBreak (Enter key or insertParagraphSeparator), HTMLEditor::OnInputLineBreak() for callers of TypedText() with eTypeBR (Shift + Enter or insertLineBreak). Additionally, this creates internal non-virtual methods for XPCOM methods which are used as internal methods of TypedText(). One is InsertTextAsAction() for nsIPlatintextEditor.insertText(). the other is InsertParagraphSeparator() for nsIPlaintextEditor.insertLineBreak(). Although those new methods are not have "WithTransaction" postfix, they must be clearer they'll use transactions since user input and actions should be undo-able. MozReview-Commit-ID: AmOkMqovIKA
5726deba80285b649b0f19c190a9b9275282eff1: Bug 1451672 - part 20: Rename HTMLEditor::MakeDefinitionItem() and HTMLEditor::InsertBasicBlock() with "WithTransaction" postfix r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Mon, 16 Apr 2018 20:33:27 +0900 - rev 786188
Push 107400 by bmo:gijskruitbosch+bugs@gmail.com at Sat, 21 Apr 2018 10:24:23 +0000
Bug 1451672 - part 20: Rename HTMLEditor::MakeDefinitionItem() and HTMLEditor::InsertBasicBlock() with "WithTransaction" postfix r=m_kato MozReview-Commit-ID: 2D50suUnFcw
9617921cebc374474b9fb42f6543841041d4cfda: Bug 1451672 - part 19: Remove TextEditor::CreateBR() and rename TextEditor::CreateBRImpl() to TextEditor::InsertBrElementWithTransaction() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Mon, 16 Apr 2018 19:21:29 +0900 - rev 786187
Push 107400 by bmo:gijskruitbosch+bugs@gmail.com at Sat, 21 Apr 2018 10:24:23 +0000
Bug 1451672 - part 19: Remove TextEditor::CreateBR() and rename TextEditor::CreateBRImpl() to TextEditor::InsertBrElementWithTransaction() r=m_kato TextEditor::CreateBR() is just a wrapper of TextEditor::CreateBRImpl() for automatically retrieving Selection of the editor. And TextEditor::CreateBRImpl() should be renamed to TextEditor::InsertBrElementWithTransaction() for making it clearer what it does. MozReview-Commit-ID: D8sjVdLrVrd
907f07168fedfb1d6ec03c07f881c1327ae56c35: Bug 1451672 - part 18: Rename EditorBase::CloneAttributes() to EditorBase::CloneAttributesWithTransaction() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 13 Apr 2018 18:44:08 +0900 - rev 786186
Push 107400 by bmo:gijskruitbosch+bugs@gmail.com at Sat, 21 Apr 2018 10:24:23 +0000
Bug 1451672 - part 18: Rename EditorBase::CloneAttributes() to EditorBase::CloneAttributesWithTransaction() r=m_kato MozReview-Commit-ID: 5tL31gRDVc9
a6d341deddb0e73c1bba5109df5ec84b7e616020: Bug 1451672 - part 17: Rename EditorBase::InsertContainerAbove() to EditorBase::InsertContainerWithTransactionInternal() and wraps it with new inline methods, EditorBase::InsertContainerWithTransaction() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 13 Apr 2018 18:17:04 +0900 - rev 786185
Push 107400 by bmo:gijskruitbosch+bugs@gmail.com at Sat, 21 Apr 2018 10:24:23 +0000
Bug 1451672 - part 17: Rename EditorBase::InsertContainerAbove() to EditorBase::InsertContainerWithTransactionInternal() and wraps it with new inline methods, EditorBase::InsertContainerWithTransaction() r=m_kato Similar to EditorBase::ReplaceContainerWithTransaction(), EditorBase::InsertContainerAbove() may set an attribute to newly created element if it's specified. However, for avoiding the null check, let's make them as references rather than pointers and treat nsGkAtoms::_empty as nullptr for making the code safer. This patch removes "Above" from the method name since it's redundant. "Insert" sounds like inserting a node, and "Container" means to keep existing children with new element in EditorBase. MozReview-Commit-ID: 6EnkKHynYSP
1871811c637d761880fb4af87f20bfb0feff7b50: Bug 1451672 - part 16: Rename EditorBase::MoveNode() to EditorBase::MoveNodeWithTransaction() and create EditorBase::MoveNodeToEndWithTransaction() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Thu, 12 Apr 2018 23:58:52 +0900 - rev 786184
Push 107400 by bmo:gijskruitbosch+bugs@gmail.com at Sat, 21 Apr 2018 10:24:23 +0000
Bug 1451672 - part 16: Rename EditorBase::MoveNode() to EditorBase::MoveNodeWithTransaction() and create EditorBase::MoveNodeToEndWithTransaction() r=m_kato This patch renames EditorBase::MoveNode() to EditorBase::MoveNodeWithTransaction() and redesign its parameters including replacing a set of container node and offset in it to EditorDOMPointBase. However, it takes magic number -1 as meaning end of the container. Therefore, this patch adds MoveNodeToEndWithTransaction() for keeping the callers simple. MozReview-Commit-ID: BeTq5c7GQNN
3bd18c2b985162bf4fa3a5d74214861839036325: Bug 1451672 - part 15: Rename EditorBase::RemoveContainer() and HTMLEditor::RemoveBlockContainer() with "WithTransaction" postfix and make their argument |Element&| r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Thu, 12 Apr 2018 22:23:04 +0900 - rev 786183
Push 107400 by bmo:gijskruitbosch+bugs@gmail.com at Sat, 21 Apr 2018 10:24:23 +0000
Bug 1451672 - part 15: Rename EditorBase::RemoveContainer() and HTMLEditor::RemoveBlockContainer() with "WithTransaction" postfix and make their argument |Element&| r=m_kato MozReview-Commit-ID: 2toj48mqHM9
24e17127ec4875531ef46308dde8169bf35cea67: Bug 1451672 - part 14: Rename EditorBase::ReplaceContainer() to EditorBase::ReplaceContainerWithTransactionInternal() and create some wrappers of it r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Thu, 12 Apr 2018 21:45:55 +0900 - rev 786182
Push 107400 by bmo:gijskruitbosch+bugs@gmail.com at Sat, 21 Apr 2018 10:24:23 +0000
Bug 1451672 - part 14: Rename EditorBase::ReplaceContainer() to EditorBase::ReplaceContainerWithTransactionInternal() and create some wrappers of it r=m_kato The parameters of EditorBase::ReplaceContainer() are complicated. For example, if it's specified as cloning all attributes, aAttribute and aValue are ignored because CloneAttributes() removes all existing attributes but ReplaceContainer() sets attributes before calling CloneAttributes(). This method has 3 modes: 1. Just replaces aOldContainer with new element. 2. #1 and clones all attributes from aOldContainer to the new element. 3. #1 and sets aAttribute of the new element to aValue. Therefore, this patch creates 3 inline wrappers of the renamed method. MozReview-Commit-ID: IsPu2uZuU8f
979bfcb751572486dce5e69b709f916c008425ee: Bug 1451672 - part 13: Rename EditorBase::InsertTextImpl() and EditorBase::InsertTextIntoTextNodeImpl() to EditorBase::InsertTextWithTransaction() and EditorBase::InsertTextIntoTextNodeWithTransaction() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Thu, 12 Apr 2018 17:58:14 +0900 - rev 786181
Push 107400 by bmo:gijskruitbosch+bugs@gmail.com at Sat, 21 Apr 2018 10:24:23 +0000
Bug 1451672 - part 13: Rename EditorBase::InsertTextImpl() and EditorBase::InsertTextIntoTextNodeImpl() to EditorBase::InsertTextWithTransaction() and EditorBase::InsertTextIntoTextNodeWithTransaction() r=m_kato MozReview-Commit-ID: DF3HBVyu4P2
4b372e4cc463abb94c3fbc5ccaf2870ffceec894: Bug 1451672 - part 12: Create HTMLEditor::RemoveStyleSheetWithTransaction() as implementation of nsIEditorStyleSheets::RemoveStyleSheet() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Thu, 12 Apr 2018 17:20:21 +0900 - rev 786180
Push 107400 by bmo:gijskruitbosch+bugs@gmail.com at Sat, 21 Apr 2018 10:24:23 +0000
Bug 1451672 - part 12: Create HTMLEditor::RemoveStyleSheetWithTransaction() as implementation of nsIEditorStyleSheets::RemoveStyleSheet() r=m_kato MozReview-Commit-ID: BIXU3jzD1rU
4076543894020d6614e523e805b13b35e511cb45: Bug 1451672 - part 11: Rename EditorBase::SetAttribute(), EditorBase::RemoveAttribute() and EditorBase::CloneAttribute() with "WithTransaction" postfix r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Thu, 12 Apr 2018 16:58:33 +0900 - rev 786179
Push 107400 by bmo:gijskruitbosch+bugs@gmail.com at Sat, 21 Apr 2018 10:24:23 +0000
Bug 1451672 - part 11: Rename EditorBase::SetAttribute(), EditorBase::RemoveAttribute() and EditorBase::CloneAttribute() with "WithTransaction" postfix r=m_kato MozReview-Commit-ID: I8T9MNkY8Yq
81798a8610e1b350998ea29ef177fcd5a8c0b801: Bug 1451672 - part 10: Rename TextEditor::DeleteSelectionImpl() to TextEditor::DeleteSelectionWithTransaction() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 11 Apr 2018 19:11:15 +0900 - rev 786178
Push 107400 by bmo:gijskruitbosch+bugs@gmail.com at Sat, 21 Apr 2018 10:24:23 +0000
Bug 1451672 - part 10: Rename TextEditor::DeleteSelectionImpl() to TextEditor::DeleteSelectionWithTransaction() r=m_kato MozReview-Commit-ID: 8nypHV8X3js
585bed4748a744017ef8cdb2cdbfea922c3e67b2: Bug 1451672 - part 9: Create TextEditor::DeleteSelectionAsAction() as implementation of nsIEditor::DeleteSelection() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 11 Apr 2018 17:37:49 +0900 - rev 786177
Push 107400 by bmo:gijskruitbosch+bugs@gmail.com at Sat, 21 Apr 2018 10:24:23 +0000
Bug 1451672 - part 9: Create TextEditor::DeleteSelectionAsAction() as implementation of nsIEditor::DeleteSelection() r=m_kato First, EditorBase::DeleteSelection() is never used since TextEditor::DeleteSelection() overrides it but does not call it. So, this patch makes EditorBase::DeleteSelection() only returns NS_ERROR_NOT_IMPLEMENTED. Next, EditorBase::DeleteSelectionImpl() actually removes content for TextEditor::DeleteSelection(). So, it should be named as DeleteSelectionWithTransaction(). However, it'll be done in the following patch. On the other hand, its callers are EditorBase::HandleKeyPressEvent() and EditorBase::DeleteSelectionAndPrepareToCreateNode(). Fortunately, they can be moved to TextEditor simply. Therefore this patch moves the methods to TextEditor for making related methods in a place. Then, we can make the implementation of nsIEditor::TextEditor() as a non-virtual method, TextEditor::DeleteSelectionAsAction(). MozReview-Commit-ID: KXFDhW3G9lA
5e8f25ef1174d4af6ac4c16c02effa8c49c432ed: Bug 1451672 - part 8: Rename EditorBase::DeleteText() to EditorBase::DeleteTextWithTransaction() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Tue, 10 Apr 2018 16:50:06 +0900 - rev 786176
Push 107400 by bmo:gijskruitbosch+bugs@gmail.com at Sat, 21 Apr 2018 10:24:23 +0000
Bug 1451672 - part 8: Rename EditorBase::DeleteText() to EditorBase::DeleteTextWithTransaction() r=m_kato MozReview-Commit-ID: KK4dTpKbpLc
81a8389b9daaf8049ab3934904849de7dc527232: Bug 1451672 - part 7: Rename EditorBase::DeleteNode() to EditorBase::DeleteNodeWithTransaction() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Tue, 10 Apr 2018 16:23:54 +0900 - rev 786175
Push 107400 by bmo:gijskruitbosch+bugs@gmail.com at Sat, 21 Apr 2018 10:24:23 +0000
Bug 1451672 - part 7: Rename EditorBase::DeleteNode() to EditorBase::DeleteNodeWithTransaction() r=m_kato MozReview-Commit-ID: AQVVTjfXJv
28422b0eee9a95a153980bcd741d5ac7b094cb0c: Bug 1451672 - part 6: Rename EditorBase::JoinNodesImpl() to EditorBase::DoJoinNodes() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Tue, 10 Apr 2018 03:56:46 +0900 - rev 786174
Push 107400 by bmo:gijskruitbosch+bugs@gmail.com at Sat, 21 Apr 2018 10:24:23 +0000
Bug 1451672 - part 6: Rename EditorBase::JoinNodesImpl() to EditorBase::DoJoinNodes() r=m_kato MozReview-Commit-ID: 9fqa4fKkAF5
5f61649cdc967a95fccb1b13d8beaf6f97811ee5: Bug 1451672 - part 5: Rename EditorBase::JoinNodes() and related methods with "WithTransaction" postfix r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Tue, 10 Apr 2018 03:46:44 +0900 - rev 786173
Push 107400 by bmo:gijskruitbosch+bugs@gmail.com at Sat, 21 Apr 2018 10:24:23 +0000
Bug 1451672 - part 5: Rename EditorBase::JoinNodes() and related methods with "WithTransaction" postfix r=m_kato This patch renames: EditorBase::JoinNodes() -> EditorBase::JoinNodesWithTransaction() EditorBase::JoinNodeDeep() -> EditorBase::JoinNodesDeepWithTransaction() HTMLEditRules::JoinNodesSmart() -> HTMLEditRules::JoinNearestEditableNodesWithTransaction() HTMLEditRules::TryToJoinBlocks() -> HTMLEditRules::TryToJoinBlocksWithTransaction() MozReview-Commit-ID: Ao16GhAcyIZ
1f538ba260f81864adfee97c14b81a03e032f275: Bug 1451672 - part 4: Rename EditorBase::SplitNodeImpl() to EditorBase::DoSplitNode() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Tue, 10 Apr 2018 02:32:33 +0900 - rev 786172
Push 107400 by bmo:gijskruitbosch+bugs@gmail.com at Sat, 21 Apr 2018 10:24:23 +0000
Bug 1451672 - part 4: Rename EditorBase::SplitNodeImpl() to EditorBase::DoSplitNode() r=m_kato EditorBase::SplitNodeImpl() is called by SplitNodeTransaction::DoTransaction() for actually splitting a node. However, "WithoutTransaction" postfix is really redundant. Perhaps, just naming DoSplitNode() is better since "Impl" isn't unclear and not useful if somebody wants to use it as a utility method and there has already been EditorBase::SplitNode() which is an override of nsIEditor::SplitNode(). It must not be good to use same name for different purpose (EditorBase::SplitNode() creates a transaction). MozReview-Commit-ID: Akjeyp52vVv
6c75071ac1bb3dd1cf36f479fdee7e1c56c4723d: Bug 1451672 - part 3: Rename EditorBase::SplitNode() and related methods to ending with "WithTransaction" r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Tue, 10 Apr 2018 02:16:49 +0900 - rev 786171
Push 107400 by bmo:gijskruitbosch+bugs@gmail.com at Sat, 21 Apr 2018 10:24:23 +0000
Bug 1451672 - part 3: Rename EditorBase::SplitNode() and related methods to ending with "WithTransaction" r=m_kato This patch renames: EditorBase::SplitNode() -> EditorBase::SplitNodeWithTransaction() EditorBase::SplitNodeDeep() -> EditorBase::SplitNodeDeepWithTransaction() HTMLEditRules::MaybeSplitAncestorsForInsert() -> HTMLEditRules::MaybeSplitAncestorsForInsertWithTransaction() Note it might be that some callers of those methods should be renamed too. However, we should do it in follow up bug after landing those patches since we can investigate it with searchfox.org after landing patches. MozReview-Commit-ID: FfxCfaI85z5
ef997456c777746bce4b47fed65230ea64fae64e: Bug 1451672 - part 2: Rename EditorBase::InsertNode() to EditorBase::InsertNodeWithTransaction() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Tue, 10 Apr 2018 01:34:29 +0900 - rev 786170
Push 107400 by bmo:gijskruitbosch+bugs@gmail.com at Sat, 21 Apr 2018 10:24:23 +0000
Bug 1451672 - part 2: Rename EditorBase::InsertNode() to EditorBase::InsertNodeWithTransaction() r=m_kato MozReview-Commit-ID: 4n5EVvUKrux
(0) -300000 -100000 -30000 -10000 -3000 -1000 -300 -100 -50 -20 +20 +50 +100 +300 +1000 +3000 +10000 +30000 tip