Bug 785091 - Remove nsIEditorObserver, r=ehsan
authorMark Capella <markcapella@twcny.rr.com>
Mon, 17 Sep 2012 11:14:56 -0400
changeset 110828 f4a470dfb0b2c4e6542940b76b1b3830497a1ff6
parent 110827 cf303be47402657cf5dbadef5b33636624e14516
child 110829 2d18e210141786bc5cb9e9b8190fab27312a9058
push id2248
push userakeybl@mozilla.com
push dateMon, 08 Oct 2012 19:23:44 +0000
treeherdermozilla-aurora@118a3b748323 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs785091
milestone18.0a1
Bug 785091 - Remove nsIEditorObserver, r=ehsan
content/html/content/src/nsTextEditorState.cpp
editor/idl/Makefile.in
editor/idl/nsIEditor.idl
editor/idl/nsIEditorObserver.idl
editor/libeditor/base/EditActionListener.h
editor/libeditor/base/nsEditor.cpp
editor/libeditor/base/nsEditor.h
layout/forms/nsTextControlFrame.cpp
--- a/content/html/content/src/nsTextEditorState.cpp
+++ b/content/html/content/src/nsTextEditorState.cpp
@@ -21,17 +21,17 @@
 #include "nsIControllers.h"
 #include "nsIDOMHTMLInputElement.h"
 #include "nsIDOMHTMLTextAreaElement.h"
 #include "nsITransactionManager.h"
 #include "nsIControllerContext.h"
 #include "nsAttrValue.h"
 #include "nsGenericHTMLElement.h"
 #include "nsIDOMEventListener.h"
-#include "nsIEditorObserver.h"
+#include "EditActionListener.h"
 #include "nsINativeKeyBindings.h"
 #include "nsIDocumentEncoder.h"
 #include "nsISelectionPrivate.h"
 #include "nsPIDOMWindow.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIEditor.h"
 #include "nsTextEditRules.h"
 #include "mozilla/Selection.h"
@@ -610,17 +610,17 @@ nsTextInputSelectionImpl::CheckVisibilit
   nsCOMPtr<nsISelectionController> shell = do_QueryReferent(mPresShellWeak);
   NS_ENSURE_TRUE(shell, NS_ERROR_FAILURE);
 
   return shell->CheckVisibilityContent(aNode, aStartOffset, aEndOffset, aRetval);
 }
 
 class nsTextInputListener : public nsISelectionListener,
                             public nsIDOMEventListener,
-                            public nsIEditorObserver,
+                            public EditActionListener,
                             public nsSupportsWeakReference
 {
 public:
   /** the default constructor
    */ 
   explicit nsTextInputListener(nsITextControlElement* aTxtCtrlElement);
   /** the default destructor. virtual due to the possibility of derivation.
    */
@@ -635,17 +635,17 @@ public:
   void SetValueChanged(bool aSetValueChanged) { mSetValueChanged = aSetValueChanged; }
 
   NS_DECL_ISUPPORTS
 
   NS_DECL_NSISELECTIONLISTENER
 
   NS_DECL_NSIDOMEVENTLISTENER
 
-  NS_DECL_NSIEDITOROBSERVER
+  virtual void EditAction();
 
 protected:
 
   nsresult  UpdateTextInputCommands(const nsAString& commandsToUpdate);
 
   NS_HIDDEN_(nsINativeKeyBindings*) GetKeyBindings();
 
 protected:
@@ -692,19 +692,18 @@ nsTextInputListener::nsTextInputListener
 , mSetValueChanged(true)
 {
 }
 
 nsTextInputListener::~nsTextInputListener() 
 {
 }
 
-NS_IMPL_ISUPPORTS4(nsTextInputListener,
+NS_IMPL_ISUPPORTS3(nsTextInputListener,
                    nsISelectionListener,
-                   nsIEditorObserver,
                    nsISupportsWeakReference,
                    nsIDOMEventListener)
 
 // BEGIN nsIDOMSelectionListener
 
 NS_IMETHODIMP
 nsTextInputListener::NotifySelectionChanged(nsIDOMDocument* aDoc, nsISelection* aSel, int16_t aReason)
 {
@@ -825,19 +824,17 @@ nsTextInputListener::HandleEvent(nsIDOME
     if (handled) {
       aEvent->PreventDefault();
     }
   }
 
   return NS_OK;
 }
 
-// BEGIN nsIEditorObserver
-
-NS_IMETHODIMP
+void
 nsTextInputListener::EditAction()
 {
   nsWeakFrame weakFrame = mFrame;
 
   nsITextControlFrame* frameBase = do_QueryFrame(mFrame);
   nsTextControlFrame* frame = static_cast<nsTextControlFrame*> (frameBase);
   NS_ASSERTION(frame, "Where is our frame?");
   //
@@ -856,35 +853,30 @@ nsTextInputListener::EditAction()
     // Modify the menu if undo or redo items are different
     UpdateTextInputCommands(NS_LITERAL_STRING("undo"));
 
     mHadUndoItems = numUndoItems != 0;
     mHadRedoItems = numRedoItems != 0;
   }
 
   if (!weakFrame.IsAlive()) {
-    return NS_OK;
+    return;
   }
 
   // Make sure we know we were changed (do NOT set this to false if there are
   // no undo items; JS could change the value and we'd still need to save it)
   if (mSetValueChanged) {
     frame->SetValueChanged(true);
   }
 
   if (!mSettingValue) {
     mTxtCtrlElement->OnValueChanged(true);
   }
-
-  return NS_OK;
 }
 
-// END nsIEditorObserver
-
-
 nsresult
 nsTextInputListener::UpdateTextInputCommands(const nsAString& commandsToUpdate)
 {
   nsIContent* content = mFrame->GetContent();
   NS_ENSURE_TRUE(content, NS_ERROR_FAILURE);
   
   nsCOMPtr<nsIDocument> doc = content->GetDocument();
   NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);
@@ -1354,17 +1346,17 @@ nsTextEditorState::PrepareEditor(const n
 
   if (!mEditorInitialized) {
     newEditor->PostCreate();
     mEverInited = true;
     mEditorInitialized = true;
   }
 
   if (mTextListener)
-    newEditor->AddEditorObserver(mTextListener);
+    newEditor->SetEditorObserver(mTextListener);
 
   // Restore our selection after being bound to a new frame
   if (mSelectionCached) {
     if (mRestoringSelection) // paranoia
       mRestoringSelection->Revoke();
     mRestoringSelection = new RestoreSelectionState(this, mBoundFrame);
     if (mRestoringSelection) {
       nsContentUtils::AddScriptRunner(mRestoringSelection);
@@ -1378,17 +1370,17 @@ nsTextEditorState::PrepareEditor(const n
 }
 
 void
 nsTextEditorState::DestroyEditor()
 {
   // notify the editor that we are going away
   if (mEditorInitialized) {
     if (mTextListener)
-      mEditor->RemoveEditorObserver(mTextListener);
+      mEditor->RemoveEditorObserver();
 
     mEditor->PreDestroy(true);
     mEditorInitialized = false;
   }
 }
 
 void
 nsTextEditorState::UnbindFromFrame(nsTextControlFrame* aFrame)
--- a/editor/idl/Makefile.in
+++ b/editor/idl/Makefile.in
@@ -14,17 +14,16 @@ MODULE          := editor
 GRE_MODULE      := 1
 
 XPIDLSRCS       := \
                 nsIDocumentStateListener.idl \
                 nsIEditActionListener.idl \
                 nsIEditor.idl \
                 nsIEditorIMESupport.idl \
                 nsIEditorMailSupport.idl \
-                nsIEditorObserver.idl \
                 nsIEditorSpellCheck.idl \
                 nsIEditorStyleSheets.idl \
                 nsIHTMLEditor.idl \
                 nsIHTMLObjectResizer.idl \
                 nsIHTMLAbsPosEditor.idl \
                 nsIHTMLObjectResizeListener.idl \
                 nsIHTMLInlineTableEditor.idl \
                 nsIPlaintextEditor.idl \
--- a/editor/idl/nsIEditor.idl
+++ b/editor/idl/nsIEditor.idl
@@ -2,38 +2,44 @@
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 #include "domstubs.idl"
 
+%{C++
+  class EditActionListener;
+%}
+
+[ptr] native EditActionListener(EditActionListener);
+
 interface nsIURI;
 interface nsIAtom;
 interface nsIContent;
 interface nsISelection;
 interface nsISelectionController;
 interface nsIDocumentStateListener;
 interface nsIOutputStream;
 interface nsITransactionManager;
 interface nsITransaction;
-interface nsIEditorObserver;
 interface nsIEditActionListener;
 interface nsIInlineSpellChecker;
 interface nsITransferable;
 
-[scriptable, uuid(7ad59e28-f3d5-4e14-8ea3-794ad4a86de3)]
+[scriptable, uuid(12efa18c-920a-47cd-94a1-4052f245f76c)]
 
 interface nsIEditor  : nsISupports
 {
 %{C++
   typedef short EDirection;
   typedef short EStripWrappers;
 %}
+
   const short eNone = 0;
   const short eNext = 1;
   const short ePrevious = 2;
   const short eNextWord = 3;
   const short ePreviousWord = 4;
   const short eToBeginningOfLine = 5;
   const short eToEndOfLine = 6;
 
@@ -507,20 +513,20 @@ interface nsIEditor  : nsISupports
 
 
   /* ------------ Various listeners methods --------------
    * nsIEditor holds strong references to the editor observers, action listeners
    * and document state listeners.
    */
 
   /** add an EditorObserver to the editors list of observers. */
-  void addEditorObserver(in nsIEditorObserver observer);
+  void setEditorObserver(in EditActionListener observer);
 
   /** Remove an EditorObserver from the editor's list of observers. */
-  void removeEditorObserver(in nsIEditorObserver observer);
+  void removeEditorObserver();
 
   /** add an EditActionListener to the editors list of listeners. */
   void addEditActionListener(in nsIEditActionListener listener);
 
   /** Remove an EditActionListener from the editor's list of listeners. */
   void removeEditActionListener(in nsIEditActionListener listener);
 
   /** Add a DocumentStateListener to the editors list of doc state listeners. */
deleted file mode 100644
--- a/editor/idl/nsIEditorObserver.idl
+++ /dev/null
@@ -1,26 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-
-/*
-Editor Observer interface to outside world
-*/
-
-[scriptable, uuid(a6cf9125-15b3-11d2-932e-00805f8add32)]
-
-/**
- * A generic editor observer interface. 
- * <P>
- * nsIEditorObserver is the interface used by applications wishing to be notified
- * when the editor has completed a user action. 
- *
- */
-interface nsIEditorObserver : nsISupports {
-  /** 
-   * Called after the editor completes a user action.
-   */
-  void EditAction();
-};
new file mode 100644
--- /dev/null
+++ b/editor/libeditor/base/EditActionListener.h
@@ -0,0 +1,17 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifndef __editActionListener_h__
+#define __editActionListener_h__
+
+class EditActionListener
+{
+public:
+
+  virtual void EditAction() = 0;
+
+};
+
+#endif /* __editActionListener_h__ */
--- a/editor/libeditor/base/nsEditor.cpp
+++ b/editor/libeditor/base/nsEditor.cpp
@@ -6,16 +6,17 @@
 #include <stdio.h>                      // for NULL, stdout
 #include <string.h>                     // for strcmp
 
 #include "ChangeAttributeTxn.h"         // for ChangeAttributeTxn
 #include "CreateElementTxn.h"           // for CreateElementTxn
 #include "DeleteNodeTxn.h"              // for DeleteNodeTxn
 #include "DeleteRangeTxn.h"             // for DeleteRangeTxn
 #include "DeleteTextTxn.h"              // for DeleteTextTxn
+#include "EditActionListener.h"         // for EditActionListener
 #include "EditAggregateTxn.h"           // for EditAggregateTxn
 #include "EditTxn.h"                    // for EditTxn
 #include "IMETextTxn.h"                 // for IMETextTxn
 #include "InsertElementTxn.h"           // for InsertElementTxn
 #include "InsertTextTxn.h"              // for InsertTextTxn
 #include "JoinElementTxn.h"             // for JoinElementTxn
 #include "PlaceholderTxn.h"             // for PlaceholderTxn
 #include "SplitElementTxn.h"            // for SplitElementTxn
@@ -65,17 +66,16 @@
 #include "nsIDOMNamedNodeMap.h"         // for nsIDOMNamedNodeMap
 #include "nsIDOMNode.h"                 // for nsIDOMNode, etc
 #include "nsIDOMNodeList.h"             // for nsIDOMNodeList
 #include "nsIDOMRange.h"                // for nsIDOMRange
 #include "nsIDOMText.h"                 // for nsIDOMText
 #include "nsIDocument.h"                // for nsIDocument
 #include "nsIDocumentStateListener.h"   // for nsIDocumentStateListener
 #include "nsIEditActionListener.h"      // for nsIEditActionListener
-#include "nsIEditorObserver.h"          // for nsIEditorObserver
 #include "nsIEditorSpellCheck.h"        // for nsIEditorSpellCheck
 #include "nsIEnumerator.h"              // for nsIEnumerator, etc
 #include "nsIFrame.h"                   // for nsIFrame
 #include "nsIInlineSpellChecker.h"      // for nsIInlineSpellChecker, etc
 #include "nsIMEStateManager.h"          // for nsIMEStateManager
 #include "nsINameSpaceManager.h"        // for kNameSpaceID_None, etc
 #include "nsINode.h"                    // for nsINode, etc
 #include "nsIObserverService.h"         // for nsIObserverService
@@ -131,16 +131,17 @@ extern nsIParserService *sParserService;
 // nsEditor: base editor class implementation
 //
 //---------------------------------------------------------------------------
 
 nsEditor::nsEditor()
 :  mPlaceHolderName(nullptr)
 ,  mSelState(nullptr)
 ,  mPhonetic(nullptr)
+,  mEditActionListener(nullptr)
 ,  mModCount(0)
 ,  mFlags(0)
 ,  mUpdateCount(0)
 ,  mPlaceHolderBatch(0)
 ,  mAction(EditAction::none)
 ,  mHandlingActionCount(0)
 ,  mIMETextOffset(0)
 ,  mIMEBufferLength(0)
@@ -170,17 +171,16 @@ NS_IMPL_CYCLE_COLLECTION_CLASS(nsEditor)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsEditor)
  NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mRootElement)
  NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mInlineSpellChecker)
  NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mTxnMgr)
  NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mIMETextRangeList)
  NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mIMETextNode)
  NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMARRAY(mActionListeners)
- NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMARRAY(mEditorObservers)
  NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMARRAY(mDocStateListeners)
  NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mEventTarget)
  NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mEventListener)
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsEditor)
  nsIDocument* currentDoc =
    tmp->mRootElement ? tmp->mRootElement->GetCurrentDoc() : nullptr;
@@ -189,17 +189,16 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(
    return NS_SUCCESS_INTERRUPTED_TRAVERSE;
  }
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mRootElement)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mInlineSpellChecker)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mTxnMgr, nsITransactionManager)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mIMETextRangeList)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mIMETextNode)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMARRAY(mActionListeners)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMARRAY(mEditorObservers)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMARRAY(mDocStateListeners)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mEventTarget)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mEventListener)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsEditor)
  NS_INTERFACE_MAP_ENTRY(nsIPhonetic)
  NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
@@ -441,17 +440,17 @@ nsEditor::PreDestroy(bool aDestroyingFra
     mInlineSpellChecker->Cleanup(aDestroyingFrames);
 
   // tell our listeners that the doc is going away
   NotifyDocumentListeners(eDocumentToBeDestroyed);
 
   // Unregister event listeners
   RemoveEventListeners();
   mActionListeners.Clear();
-  mEditorObservers.Clear();
+  mEditActionListener = nullptr;
   mDocStateListeners.Clear();
   mInlineSpellChecker = nullptr;
   mSpellcheckCheckboxState = eTriUnset;
   mRootElement = nullptr;
 
   mDidPreDestroy = true;
   return NS_OK;
 }
@@ -978,17 +977,17 @@ nsEditor::EndPlaceHolderTransaction()
         // For now just removing the assert.
       }
       // notify editor observers of action but if composing, it's done by
       // text event handler.
       if (!mInIMEMode) NotifyEditorObservers();
     }
   }
   mPlaceHolderBatch--;
-  
+
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsEditor::ShouldTxnSetSelection(bool *aResult)
 {
   NS_ENSURE_TRUE(aResult, NS_ERROR_NULL_POINTER);
   *aResult = mShouldTxnSetSelection;
@@ -1757,44 +1756,31 @@ nsEditor::MoveNode(nsIDOMNode *aNode, ns
 
   // Hold a reference so aNode doesn't go away when we remove it (bug 772282)
   nsCOMPtr<nsIDOMNode> node = aNode;
   res = DeleteNode(node);
   NS_ENSURE_SUCCESS(res, res);
   return InsertNode(node, aParent, aOffset);
 }
 
-
 NS_IMETHODIMP
-nsEditor::AddEditorObserver(nsIEditorObserver *aObserver)
-{
-  // we don't keep ownership of the observers.  They must
-  // remove themselves as observers before they are destroyed.
-  
+nsEditor::SetEditorObserver(EditActionListener* aObserver)
+{
   NS_ENSURE_TRUE(aObserver, NS_ERROR_NULL_POINTER);
-
-  // Make sure the listener isn't already on the list
-  if (mEditorObservers.IndexOf(aObserver) == -1) 
-  {
-    if (!mEditorObservers.AppendObject(aObserver))
-      return NS_ERROR_FAILURE;
-  }
-
+  MOZ_ASSERT(!mEditActionListener);
+
+  mEditActionListener = aObserver;
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
-nsEditor::RemoveEditorObserver(nsIEditorObserver *aObserver)
-{
-  NS_ENSURE_TRUE(aObserver, NS_ERROR_FAILURE);
-
-  if (!mEditorObservers.RemoveObject(aObserver))
-    return NS_ERROR_FAILURE;
-
+nsEditor::RemoveEditorObserver()
+{
+  mEditActionListener = nullptr;
   return NS_OK;
 }
 
 class EditorInputEventDispatcher : public nsRunnable
 {
 public:
   EditorInputEventDispatcher(nsEditor* aEditor,
                              bool aIsTrusted,
@@ -1828,36 +1814,37 @@ public:
   }
 
 private:
   nsRefPtr<nsEditor> mEditor;
   nsCOMPtr<nsIContent> mTarget;
   bool mIsTrusted;
 };
 
-void nsEditor::NotifyEditorObservers(void)
-{
-  for (int32_t i = 0; i < mEditorObservers.Count(); i++) {
-    mEditorObservers[i]->EditAction();
+void
+nsEditor::NotifyEditorObservers(void)
+{
+  if (mEditActionListener) {
+    mEditActionListener->EditAction();
   }
 
   if (!mDispatchInputEvent) {
     return;
   }
 
   // We don't need to dispatch multiple input events if there is a pending
   // input event.  However, it may have different event target.  If we resolved
   // this issue, we need to manage the pending events in an array.  But it's
   // overwork.  We don't need to do it for the very rare case.
 
   nsCOMPtr<nsIContent> target = GetInputEventTargetContent();
   NS_ENSURE_TRUE(target, );
 
   nsContentUtils::AddScriptRunner(
-     new EditorInputEventDispatcher(this, mHandlingTrustedAction, target));
+    new EditorInputEventDispatcher(this, mHandlingTrustedAction, target));
 }
 
 NS_IMETHODIMP
 nsEditor::AddEditActionListener(nsIEditActionListener *aListener)
 {
   NS_ENSURE_TRUE(aListener, NS_ERROR_NULL_POINTER);
 
   // Make sure the listener isn't already on the list
--- a/editor/libeditor/base/nsEditor.h
+++ b/editor/libeditor/base/nsEditor.h
@@ -49,17 +49,16 @@ class nsIDOMEvent;
 class nsIDOMEventListener;
 class nsIDOMEventTarget;
 class nsIDOMKeyEvent;
 class nsIDOMNode;
 class nsIDOMRange;
 class nsIDocument;
 class nsIDocumentStateListener;
 class nsIEditActionListener;
-class nsIEditorObserver;
 class nsIInlineSpellChecker;
 class nsINode;
 class nsIPresShell;
 class nsIPrivateTextRangeList;
 class nsISelection;
 class nsISupports;
 class nsITransaction;
 class nsIWidget;
@@ -855,17 +854,17 @@ protected:
   nsWeakPtr        mPlaceHolderTxn;      // weak reference to placeholder for begin/end batch purposes
   nsWeakPtr        mDocWeak;             // weak reference to the nsIDOMDocument
   nsIAtom          *mPlaceHolderName;    // name of placeholder transaction
   nsSelectionState *mSelState;           // saved selection state for placeholder txn batching
   nsString         *mPhonetic;
 
   // various listeners
   nsCOMArray<nsIEditActionListener> mActionListeners;  // listens to all low level actions on the doc
-  nsCOMArray<nsIEditorObserver> mEditorObservers;  // just notify once per high level change
+  EditActionListener* mEditActionListener;  // just notify once per high level change
   nsCOMArray<nsIDocumentStateListener> mDocStateListeners;// listen to overall doc state (dirty or not, just created, etc)
 
   nsSelectionState  mSavedSel;           // cached selection for nsAutoSelectionReset
   nsRangeUpdater    mRangeUpdater;       // utility class object for maintaining preserved ranges
 
   uint32_t          mModCount;     // number of modifications (for undo/redo stack)
   uint32_t          mFlags;        // behavior flags. See nsIPlaintextEditor.idl for the flags we use.
 
--- a/layout/forms/nsTextControlFrame.cpp
+++ b/layout/forms/nsTextControlFrame.cpp
@@ -17,17 +17,16 @@
 #include "nsISelectionListener.h"
 #include "nsIController.h"
 #include "nsIControllers.h"
 #include "nsIControllerContext.h"
 #include "nsGenericHTMLElement.h"
 #include "nsIEditorIMESupport.h"
 #include "nsIPhonetic.h"
 #include "nsTextFragment.h"
-#include "nsIEditorObserver.h"
 #include "nsEditProperty.h"
 #include "nsIDOMHTMLTextAreaElement.h"
 #include "nsINameSpaceManager.h"
 #include "nsINodeInfo.h"
 #include "nsFormControlFrame.h" //for registering accesskeys
 
 #include "nsIContent.h"
 #include "nsIAtom.h"