Bug 1574852 - part 3: Get rid of `HTMLEditRules::InitFields()` r=m_kato
authorMasayuki Nakano <masayuki@d-toybox.com>
Wed, 21 Aug 2019 07:14:09 +0000
changeset 489136 c51084cb4fb042d39f33cfe458cda6de59aad49a
parent 489135 72a225ec2ee24773735596ec1a66fd878c88d98a
child 489137 5ad6f4f0edeb8b9dff2c53d7b3fee508501390cd
push id36465
push userdvarga@mozilla.com
push dateWed, 21 Aug 2019 16:47:43 +0000
treeherdermozilla-central@4ab60925635c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersm_kato
bugs1574852
milestone70.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 1574852 - part 3: Get rid of `HTMLEditRules::InitFields()` r=m_kato It's called immediately before setting `mHTMLEditor` and sets `mHTMLEditor` to `nullptr`. So, it does nothing actually. We can get rid of it. Differential Revision: https://phabricator.services.mozilla.com/D42771
editor/libeditor/HTMLEditRules.cpp
editor/libeditor/HTMLEditRules.h
--- a/editor/libeditor/HTMLEditRules.cpp
+++ b/editor/libeditor/HTMLEditRules.cpp
@@ -184,30 +184,23 @@ class MOZ_RAII AutoSetTemporaryAncestorL
 };
 
 /********************************************************
  * mozilla::HTMLEditRules
  ********************************************************/
 
 HTMLEditRules::HTMLEditRules() : mHTMLEditor(nullptr), mInitialized(false) {
   mIsHTMLEditRules = true;
-  InitFields();
-}
-
-void HTMLEditRules::InitFields() {
-  mHTMLEditor = nullptr;
 }
 
 nsresult HTMLEditRules::Init(TextEditor* aTextEditor) {
   if (NS_WARN_IF(!aTextEditor) || NS_WARN_IF(!aTextEditor->AsHTMLEditor())) {
     return NS_ERROR_INVALID_ARG;
   }
 
-  InitFields();
-
   mHTMLEditor = aTextEditor->AsHTMLEditor();
   if (NS_WARN_IF(!mHTMLEditor)) {
     return NS_ERROR_FAILURE;
   }
 
   AutoSafeEditorData setData(*this, *mHTMLEditor);
 
   nsresult rv = TextEditRules::Init(aTextEditor);
--- a/editor/libeditor/HTMLEditRules.h
+++ b/editor/libeditor/HTMLEditRules.h
@@ -115,18 +115,16 @@ class HTMLEditRules : public TextEditRul
 
   HTMLEditor& HTMLEditorRef() const {
     MOZ_ASSERT(mData);
     return mData->HTMLEditorRef();
   }
 
   enum RulesEndpoint { kStart, kEnd };
 
-  void InitFields();
-
   /**
    * Called before inserting something into the editor.
    * This method may removes mBougsNode if there is.  Therefore, this method
    * might cause destroying the editor.
    *
    * @param aCancel             Returns true if the operation is canceled.
    *                            This can be nullptr.
    */