Bug 1451672 - part 23: Rename HTMLEditor::Set*BackgroundColor() to HTMLEditor::Set*BackgroundColorWithTransaction() r?m_kato draft
authorMasayuki Nakano <masayuki@d-toybox.com>
Tue, 17 Apr 2018 00:02:39 +0900
changeset 786106 fcc0ef13b8c774ec303363d3b32a977ffcb4d0d9
parent 786105 659884d421ecab1de2df9f23b09a414eedc82014
child 786107 08bd519d88ab5e918d701e2aca4d1cfe4b2e6d40
push id107393
push usermasayuki@d-toybox.com
push dateSat, 21 Apr 2018 04:40:12 +0000
reviewersm_kato
bugs1451672
milestone61.0a1
Bug 1451672 - part 23: Rename HTMLEditor::Set*BackgroundColor() to HTMLEditor::Set*BackgroundColorWithTransaction() r?m_kato MozReview-Commit-ID: 7kUahOPZCwE
editor/libeditor/HTMLEditor.cpp
editor/libeditor/HTMLEditor.h
--- 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);