Bug 1451672 - part 23: Rename HTMLEditor::Set*BackgroundColor() to HTMLEditor::Set*BackgroundColorWithTransaction() r?m_kato
MozReview-Commit-ID: 7kUahOPZCwE
--- a/editor/libeditor/HTMLEditor.cpp
+++ b/editor/libeditor/HTMLEditor.cpp
@@ -2766,17 +2766,17 @@ HTMLEditor::InsertLinkAroundSelection(ns
rv = SetInlineProperty(nsGkAtoms::a, name, value);
NS_ENSURE_SUCCESS(rv, rv);
}
}
return NS_OK;
}
nsresult
-HTMLEditor::SetHTMLBackgroundColor(const nsAString& aColor)
+HTMLEditor::SetHTMLBackgroundColorWithTransaction(const nsAString& aColor)
{
MOZ_ASSERT(IsInitialized(), "The HTMLEditor hasn't been initialized yet");
// Find a selected or enclosing table element to set background on
nsCOMPtr<nsIDOMElement> domElement;
int32_t selectedCount;
nsAutoString tagName;
nsresult rv = GetSelectedOrParentTableElement(tagName, &selectedCount,
@@ -4337,17 +4337,17 @@ HTMLEditor::SetIsCSSEnabled(bool aIsCSSP
flags |= eEditorNoCSSMask;
}
return SetFlags(flags);
}
// Set the block background color
nsresult
-HTMLEditor::SetCSSBackgroundColor(const nsAString& aColor)
+HTMLEditor::SetCSSBackgroundColorWithTransaction(const nsAString& aColor)
{
NS_ENSURE_TRUE(mRules, NS_ERROR_NOT_INITIALIZED);
CommitComposition();
// Protect the edit rules object from dying
RefPtr<TextEditRules> rules(mRules);
RefPtr<Selection> selection = GetSelection();
@@ -4493,21 +4493,21 @@ HTMLEditor::SetCSSBackgroundColor(const
NS_IMETHODIMP
HTMLEditor::SetBackgroundColor(const nsAString& aColor)
{
if (IsCSSEnabled()) {
// if we are in CSS mode, we have to apply the background color to the
// containing block (or the body if we have no block-level element in
// the document)
- return SetCSSBackgroundColor(aColor);
+ return SetCSSBackgroundColorWithTransaction(aColor);
}
// but in HTML mode, we can only set the document's background color
- return SetHTMLBackgroundColor(aColor);
+ return SetHTMLBackgroundColorWithTransaction(aColor);
}
/**
* NodesSameType() does these nodes have the same tag?
*/
bool
HTMLEditor::AreNodesSameType(nsIContent* aNode1,
nsIContent* aNode2)
--- a/editor/libeditor/HTMLEditor.h
+++ b/editor/libeditor/HTMLEditor.h
@@ -184,18 +184,18 @@ public:
nsresult GetCellFromRange(nsRange* aRange, nsIDOMElement** aCell);
// Miscellaneous
/**
* This sets background on the appropriate container element (table, cell,)
* or calls into nsTextEditor to set the page background.
*/
- nsresult SetCSSBackgroundColor(const nsAString& aColor);
- nsresult SetHTMLBackgroundColor(const nsAString& aColor);
+ nsresult SetCSSBackgroundColorWithTransaction(const nsAString& aColor);
+ nsresult SetHTMLBackgroundColorWithTransaction(const nsAString& aColor);
/**
* GetBlockNodeParent() returns parent or nearest ancestor of aNode if
* there is a block parent. If aAncestorLimiter is not nullptr,
* this stops looking for the result.
*/
static Element* GetBlockNodeParent(nsINode* aNode,
nsINode* aAncestorLimiter = nullptr);