Bug 1463985 - part 6: Rename EditSubAction::splitNode and EditSubAction::joinNode to EditSubAction::eSplitNode and EditSubAction::eJoinNodes r?m_kato draft
authorMasayuki Nakano <masayuki@d-toybox.com>
Mon, 28 May 2018 21:25:20 +0900
changeset 801976 d9855f71eec6d9b8bd31e8f4a5d7a19398404798
parent 801975 fd15a357ba7bf35f139c7a532a961b43d0ffebbe
child 801977 236528341d05252ef13dce18f114846cebd4a218
push id111796
push usermasayuki@d-toybox.com
push dateThu, 31 May 2018 06:40:56 +0000
reviewersm_kato
bugs1463985
milestone62.0a1
Bug 1463985 - part 6: Rename EditSubAction::splitNode and EditSubAction::joinNode to EditSubAction::eSplitNode and EditSubAction::eJoinNodes r?m_kato MozReview-Commit-ID: Lk0UKyzWK8d
editor/libeditor/EditAction.h
editor/libeditor/EditorBase.cpp
--- a/editor/libeditor/EditAction.h
+++ b/editor/libeditor/EditAction.h
@@ -28,18 +28,21 @@ enum class EditSubAction : int32_t
   eInsertNode,
 
   // eCreateNode indicates to create a new node and insert it into the DOM tree.
   eCreateNode,
 
   // eDeleteNode indicates to remove a node from the DOM tree.
   eDeleteNode,
 
-  splitNode,
-  joinNode,
+  // eSplitNode indicates to split a node to 2 nodes.
+  eSplitNode,
+
+  // eJoinNodes indicates to join 2 nodes.
+  eJoinNodes,
 
   deleteText = 1003,
 
   // Text edit commands
   insertText = 2000,
   insertIMEText,
   deleteSelection,
   setTextProperty,
--- a/editor/libeditor/EditorBase.cpp
+++ b/editor/libeditor/EditorBase.cpp
@@ -1494,17 +1494,17 @@ EditorBase::SplitNodeWithTransaction(
   if (NS_WARN_IF(!aStartOfRightNode.IsSet()) ||
       NS_WARN_IF(!aStartOfRightNode.GetContainerAsContent())) {
     aError.Throw(NS_ERROR_INVALID_ARG);
     return nullptr;
   }
   MOZ_ASSERT(aStartOfRightNode.IsSetAndValid());
 
   AutoTopLevelEditSubActionNotifier maybeTopLevelEditSubAction(
-                                      *this, EditSubAction::splitNode,
+                                      *this, EditSubAction::eSplitNode,
                                       nsIEditor::eNext);
 
   // XXX Unfortunately, storing offset of the split point in
   //     SplitNodeTransaction is necessary for now.  We should fix this
   //     in a follow up bug.
   Unused << aStartOfRightNode.Offset();
 
   RefPtr<SplitNodeTransaction> transaction =
@@ -1561,17 +1561,17 @@ EditorBase::JoinNodes(nsINode* aLeftNode
 nsresult
 EditorBase::JoinNodesWithTransaction(nsINode& aLeftNode,
                                      nsINode& aRightNode)
 {
   nsCOMPtr<nsINode> parent = aLeftNode.GetParentNode();
   MOZ_ASSERT(parent);
 
   AutoTopLevelEditSubActionNotifier maybeTopLevelEditSubAction(
-                                      *this, EditSubAction::joinNode,
+                                      *this, EditSubAction::eJoinNodes,
                                       nsIEditor::ePrevious);
 
   // Remember some values; later used for saved selection updating.
   // Find the offset between the nodes to be joined.
   int32_t offset = parent->ComputeIndexOf(&aRightNode);
   // Find the number of children of the lefthand node
   uint32_t oldLeftNodeLen = aLeftNode.Length();