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
--- 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