Bug 1463985 - part 15: Rename EditSubAction::makeList to EditSubAction::eCreateOrChangeList r=m_kato
authorMasayuki Nakano <masayuki@d-toybox.com>
Mon, 28 May 2018 22:36:19 +0900
changeset 477319 cb5ca0c5432e28b7d68d9bce7213cc1c5b40d352
parent 477318 a45bfcf3f9db8e6e761fbd3ad6212d39a936c421
child 477320 e14543d6c02f5a3fd611d0bc6e133cd0307d6b73
push id1757
push userffxbld-merge
push dateFri, 24 Aug 2018 17:02:43 +0000
treeherdermozilla-release@736023aebdb1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersm_kato
bugs1463985
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1463985 - part 15: Rename EditSubAction::makeList to EditSubAction::eCreateOrChangeList r=m_kato MozReview-Commit-ID: 4Mkh3Mfm6fY
editor/libeditor/EditAction.h
editor/libeditor/HTMLEditRules.cpp
editor/libeditor/HTMLEditor.cpp
editor/libeditor/TextEditRules.h
--- a/editor/libeditor/EditAction.h
+++ b/editor/libeditor/EditAction.h
@@ -64,17 +64,20 @@ enum class EditSubAction : int32_t
 
   // eSetText indicates to set editor value to new value.
   eSetText,
 
   // eInsertParagraphSeparator indicates to insert paragraph separator, <br> or
   // \n at least to break current line.
   eInsertParagraphSeparator,
 
-  makeList,
+  // eCreateOrChangeList indicates to create new list or change existing list
+  // type.
+  eCreateOrChangeList,
+
   indent,
   outdent,
   align,
   makeBasicBlock,
   removeList,
   makeDefListItem,
   insertElement,
   insertQuotation,
--- a/editor/libeditor/HTMLEditRules.cpp
+++ b/editor/libeditor/HTMLEditRules.cpp
@@ -81,17 +81,17 @@ enum
  *  first some helpful functors we will use
  ********************************************************/
 
 static bool
 IsStyleCachePreservingSubAction(EditSubAction aEditSubAction)
 {
   return aEditSubAction == EditSubAction::eDeleteSelectedContent ||
          aEditSubAction == EditSubAction::eInsertParagraphSeparator ||
-         aEditSubAction == EditSubAction::makeList ||
+         aEditSubAction == EditSubAction::eCreateOrChangeList ||
          aEditSubAction == EditSubAction::indent ||
          aEditSubAction == EditSubAction::outdent ||
          aEditSubAction == EditSubAction::align ||
          aEditSubAction == EditSubAction::makeBasicBlock ||
          aEditSubAction == EditSubAction::removeList ||
          aEditSubAction == EditSubAction::makeDefListItem ||
          aEditSubAction == EditSubAction::insertElement ||
          aEditSubAction == EditSubAction::insertQuotation;
@@ -690,17 +690,17 @@ HTMLEditRules::WillDoAction(Selection* a
     case EditSubAction::loadHTML:
       return WillLoadHTML();
     case EditSubAction::eInsertParagraphSeparator:
       UndefineCaretBidiLevel();
       return WillInsertBreak(aCancel, aHandled);
     case EditSubAction::eDeleteSelectedContent:
       return WillDeleteSelection(aInfo.collapsedAction, aInfo.stripWrappers,
                                  aCancel, aHandled);
-    case EditSubAction::makeList:
+    case EditSubAction::eCreateOrChangeList:
       return WillMakeList(aInfo.blockType, aInfo.entireList,
                           aInfo.bulletType, aCancel, aHandled);
     case EditSubAction::indent:
       return WillIndent(aCancel, aHandled);
     case EditSubAction::outdent:
       return WillOutdent(aCancel, aHandled);
     case EditSubAction::setAbsolutePosition:
       return WillAbsolutePosition(aCancel, aHandled);
@@ -3797,18 +3797,18 @@ HTMLEditRules::MoveBlock(Element& aLeftB
                          int32_t aLeftOffset,
                          int32_t aRightOffset)
 {
   MOZ_ASSERT(IsEditorDataAvailable());
 
   nsTArray<OwningNonNull<nsINode>> arrayOfNodes;
   // GetNodesFromPoint is the workhorse that figures out what we wnat to move.
   nsresult rv = GetNodesFromPoint(EditorDOMPoint(&aRightBlock, aRightOffset),
-                                  EditSubAction::makeList, arrayOfNodes,
-                                  TouchContent::yes);
+                                  EditSubAction::eCreateOrChangeList,
+                                  arrayOfNodes, TouchContent::yes);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return EditActionIgnored(rv);
   }
 
   EditActionResult ret(NS_OK);
   for (uint32_t i = 0; i < arrayOfNodes.Length(); i++) {
     // get the node to act on
     if (IsBlockNode(arrayOfNodes[i])) {
@@ -4501,17 +4501,17 @@ HTMLEditRules::WillRemoveList(bool* aCan
   nsresult rv = NormalizeSelection();
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   AutoSelectionRestorer selectionRestorer(&SelectionRef(), &HTMLEditorRef());
 
   nsTArray<RefPtr<nsRange>> arrayOfRanges;
-  GetPromotedRanges(arrayOfRanges, EditSubAction::makeList);
+  GetPromotedRanges(arrayOfRanges, EditSubAction::eCreateOrChangeList);
 
   // use these ranges to contruct a list of nodes to act on.
   nsTArray<OwningNonNull<nsINode>> arrayOfNodes;
   rv = GetListActionNodes(arrayOfNodes, EntireList::no, TouchContent::yes);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
@@ -7577,17 +7577,17 @@ HTMLEditRules::GetNodesForOperation(
       }
     }
   }
 
 
   // Post-process the list to break up inline containers that contain br's, but
   // only for operations that might care, like making lists or paragraphs
   if (aEditSubAction == EditSubAction::makeBasicBlock ||
-      aEditSubAction == EditSubAction::makeList ||
+      aEditSubAction == EditSubAction::eCreateOrChangeList ||
       aEditSubAction == EditSubAction::align ||
       aEditSubAction == EditSubAction::setAbsolutePosition ||
       aEditSubAction == EditSubAction::indent ||
       aEditSubAction == EditSubAction::outdent) {
     for (int32_t i = aOutArrayOfNodes.Length() - 1; i >= 0; i--) {
       OwningNonNull<nsINode> node = aOutArrayOfNodes[i];
       // XXX Why do we run this loop even when aTouchContent is "no"?
       if (aTouchContent == TouchContent::yes && IsInlineNode(node) &&
@@ -7647,17 +7647,17 @@ HTMLEditRules::GetListActionNodes(
     }
   }
 
   {
     // We don't like other people messing with our selection!
     AutoTransactionsConserveSelection dontChangeMySelection(&HTMLEditorRef());
 
     // contruct a list of nodes to act on.
-    nsresult rv = GetNodesFromSelection(EditSubAction::makeList,
+    nsresult rv = GetNodesFromSelection(EditSubAction::eCreateOrChangeList,
                                         aOutArrayOfNodes, aTouchContent);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
   }
 
   // Pre-process our list of nodes
   for (int32_t i = aOutArrayOfNodes.Length() - 1; i >= 0; i--) {
--- a/editor/libeditor/HTMLEditor.cpp
+++ b/editor/libeditor/HTMLEditor.cpp
@@ -2017,24 +2017,24 @@ HTMLEditor::MakeOrChangeList(const nsASt
 
   // Protect the edit rules object from dying
   RefPtr<TextEditRules> rules(mRules);
 
   bool cancel, handled;
 
   AutoPlaceholderBatch beginBatching(this);
   AutoTopLevelEditSubActionNotifier maybeTopLevelEditSubAction(
-                                      *this, EditSubAction::makeList,
+                                      *this, EditSubAction::eCreateOrChangeList,
                                       nsIEditor::eNext);
 
   // pre-process
   RefPtr<Selection> selection = GetSelection();
   NS_ENSURE_TRUE(selection, NS_ERROR_NULL_POINTER);
 
-  EditSubActionInfo subActionInfo(EditSubAction::makeList);
+  EditSubActionInfo subActionInfo(EditSubAction::eCreateOrChangeList);
   subActionInfo.blockType = &aListType;
   subActionInfo.entireList = entireList;
   subActionInfo.bulletType = &aBulletType;
   nsresult rv =
     rules->WillDoAction(selection, subActionInfo, &cancel, &handled);
   if (cancel || NS_FAILED(rv)) {
     return rv;
   }
--- a/editor/libeditor/TextEditRules.h
+++ b/editor/libeditor/TextEditRules.h
@@ -546,17 +546,17 @@ public:
 
   // EditSubAction::eDeleteSelectedContent
   nsIEditor::EDirection collapsedAction;
   nsIEditor::EStripWrappers stripWrappers;
 
   // EditSubAction::removeList
   bool bOrdered;
 
-  // EditSubAction::makeList
+  // EditSubAction::eCreateOrChangeList
   bool entireList;
   const nsAString* bulletType;
 
   // EditSubAction::align
   const nsAString* alignType;
 
   // EditSubAction::makeBasicBlock
   const nsAString* blockType;