Bug 1328558 - Remove unused insertElement member from TextEditRules. r?masayuki draft
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Wed, 04 Jan 2017 18:51:44 +0900
changeset 456103 414076e8e9d0c4ec9ecc126132ad25bfc25f61aa
parent 455971 a2741dd43eeae54f4dd7423bd832a761481c56ce
child 541143 4d02582688937b93a61ef3dbed8043a7d097e794
push id40400
push userbmo:m_kato@ga2.so-net.ne.jp
push dateThu, 05 Jan 2017 00:59:53 +0000
reviewersmasayuki
bugs1328558
milestone53.0a1
Bug 1328558 - Remove unused insertElement member from TextEditRules. r?masayuki Remove insertElement from TextEditRules due to unused. Also, comments into TextEditRules is out of date. We should update it using currect enum. MozReview-Commit-ID: B1wczFWh2Ya
editor/libeditor/HTMLEditor.cpp
editor/libeditor/TextEditRules.h
--- a/editor/libeditor/HTMLEditor.cpp
+++ b/editor/libeditor/HTMLEditor.cpp
@@ -1514,17 +1514,16 @@ HTMLEditor::InsertElementAtSelection(nsI
   RefPtr<Selection> selection = GetSelection();
   if (!selection) {
     return NS_ERROR_FAILURE;
   }
 
   // hand off to the rules system, see if it has anything to say about this
   bool cancel, handled;
   TextRulesInfo ruleInfo(EditAction::insertElement);
-  ruleInfo.insertElement = aElement;
   nsresult rv = rules->WillDoAction(selection, &ruleInfo, &cancel, &handled);
   if (cancel || NS_FAILED(rv)) {
     return rv;
   }
 
   if (!handled) {
     if (aDeleteSelection) {
       if (!IsBlockNode(element)) {
--- a/editor/libeditor/TextEditRules.h
+++ b/editor/libeditor/TextEditRules.h
@@ -264,42 +264,40 @@ public:
     , maxLength(-1)
     , collapsedAction(nsIEditor::eNext)
     , stripWrappers(nsIEditor::eStrip)
     , bOrdered(false)
     , entireList(false)
     , bulletType(nullptr)
     , alignType(nullptr)
     , blockType(nullptr)
-    , insertElement(nullptr)
   {}
 
-  // kInsertText
+  // EditAction::insertText / EditAction::insertIMEText
   const nsAString* inString;
   nsAString* outString;
   const nsAString* outputFormat;
   int32_t maxLength;
 
-  // kDeleteSelection
+  // EditAction::deleteSelection
   nsIEditor::EDirection collapsedAction;
   nsIEditor::EStripWrappers stripWrappers;
 
-  // kMakeList
+  // EditAction::removeList
   bool bOrdered;
+
+  // EditAction::makeList
   bool entireList;
   const nsAString* bulletType;
 
-  // kAlign
+  // EditAction::align
   const nsAString* alignType;
 
-  // kMakeBasicBlock
+  // EditAction::makeBasicBlock
   const nsAString* blockType;
-
-  // kInsertElement
-  const nsIDOMElement* insertElement;
 };
 
 /**
  * Stack based helper class for StartOperation()/EndOperation() sandwich.
  * This class sets a bool letting us know to ignore any rules sniffing
  * that tries to occur reentrantly.
  */
 class MOZ_STACK_CLASS AutoLockRulesSniffing final