Bug 564411 Move all methods/attributes of nsIEditorIMESupport to nsIEditor r?smaug draft
authorMasayuki Nakano <masayuki@d-toybox.com>
Tue, 20 Dec 2016 21:47:31 +0900
changeset 451528 7b329f425b3d4c8cfbf3536bad2c1eb3485ed45c
parent 451340 aa111850569eddc8938720e3ad648c5aceade499
child 540064 002290764ab0c2c57f2db9d77d39dc4227160b01
push id39220
push usermasayuki@d-toybox.com
push dateTue, 20 Dec 2016 16:27:10 +0000
reviewerssmaug
bugs564411
milestone53.0a1
Bug 564411 Move all methods/attributes of nsIEditorIMESupport to nsIEditor r?smaug Doing QI from nsIEditor to nsIEditorIMESupport doesn't make sense because editor should always support all methods and attributes of nsIEditorIMESupport (it does NOT mean that all nsIEditor implementation need to support IME). This patch moves all of them to nsIEditor for avoiding redundant QIs. MozReview-Commit-ID: DzIKuGHG4iy
dom/base/Element.cpp
dom/base/FragmentOrElement.cpp
dom/base/nsINode.cpp
dom/events/IMEContentObserver.cpp
dom/html/nsGenericHTMLElement.cpp
dom/html/nsTextEditorState.cpp
editor/libeditor/EditorBase.h
editor/libeditor/EditorEventListener.cpp
editor/libeditor/HTMLEditor.h
editor/libeditor/HTMLEditorDataTransfer.cpp
editor/libeditor/HTMLStyleEditor.cpp
editor/libeditor/TextEditor.cpp
editor/libeditor/TextEditorDataTransfer.cpp
editor/libeditor/tests/test_bug1230473.html
editor/libeditor/tests/test_composition_event_created_in_chrome.html
editor/nsIEditor.idl
editor/nsIEditorIMESupport.idl
layout/forms/nsTextControlFrame.cpp
mobile/android/chrome/content/ActionBarHandler.js
mobile/android/chrome/content/browser.js
mobile/android/tests/browser/robocop/robocop_input.html
toolkit/content/widgets/textbox.xml
widget/tests/test_imestate.html
widget/tests/window_composition_text_querycontent.xul
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -97,17 +97,16 @@
 #include "nsIBaseWindow.h"
 #include "nsIWidget.h"
 
 #include "nsNodeInfoManager.h"
 #include "nsICategoryManager.h"
 #include "nsIDOMDocumentType.h"
 #include "nsGenericHTMLElement.h"
 #include "nsIEditor.h"
-#include "nsIEditorIMESupport.h"
 #include "nsContentCreatorFunctions.h"
 #include "nsIControllers.h"
 #include "nsView.h"
 #include "nsViewManager.h"
 #include "nsIScrollableFrame.h"
 #include "mozilla/css/StyleRule.h" /* For nsCSSSelectorList */
 #include "nsCSSRuleProcessor.h"
 #include "nsRuleProcessorData.h"
--- a/dom/base/FragmentOrElement.cpp
+++ b/dom/base/FragmentOrElement.cpp
@@ -88,17 +88,16 @@
 #include "nsIWidget.h"
 
 #include "js/GCAPI.h"
 
 #include "nsNodeInfoManager.h"
 #include "nsICategoryManager.h"
 #include "nsGenericHTMLElement.h"
 #include "nsIEditor.h"
-#include "nsIEditorIMESupport.h"
 #include "nsContentCreatorFunctions.h"
 #include "nsIControllers.h"
 #include "nsView.h"
 #include "nsViewManager.h"
 #include "nsIScrollableFrame.h"
 #include "ChildIterator.h"
 #include "mozilla/css/StyleRule.h" /* For nsCSSSelectorList */
 #include "nsRuleProcessorData.h"
@@ -259,22 +258,21 @@ nsIContent::GetDesiredIMEState()
   if (!ps) {
     return IMEState(IMEState::DISABLED);
   }
   nsPresContext* pc = ps->GetPresContext();
   if (!pc) {
     return IMEState(IMEState::DISABLED);
   }
   nsIEditor* editor = nsContentUtils::GetHTMLEditor(pc);
-  nsCOMPtr<nsIEditorIMESupport> imeEditor = do_QueryInterface(editor);
-  if (!imeEditor) {
+  if (!editor) {
     return IMEState(IMEState::DISABLED);
   }
   IMEState state;
-  imeEditor->GetPreferredIMEState(&state);
+  editor->GetPreferredIMEState(&state);
   return state;
 }
 
 bool
 nsIContent::HasIndependentSelection()
 {
   nsIFrame* frame = GetPrimaryFrame();
   return (frame && frame->GetStateBits() & NS_FRAME_INDEPENDENT_SELECTION);
--- a/dom/base/nsINode.cpp
+++ b/dom/base/nsINode.cpp
@@ -56,17 +56,16 @@
 #include "nsIDocument.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMDocumentType.h"
 #include "nsIDOMEvent.h"
 #include "nsIDOMEventListener.h"
 #include "nsIDOMMutationEvent.h"
 #include "nsIDOMNodeList.h"
 #include "nsIEditor.h"
-#include "nsIEditorIMESupport.h"
 #include "nsILinkHandler.h"
 #include "mozilla/dom/NodeInfo.h"
 #include "mozilla/dom/NodeInfoInlines.h"
 #include "nsIPresShell.h"
 #include "nsIScriptError.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsIScrollableFrame.h"
--- a/dom/events/IMEContentObserver.cpp
+++ b/dom/events/IMEContentObserver.cpp
@@ -18,17 +18,16 @@
 #include "mozilla/dom/Element.h"
 #include "nsContentUtils.h"
 #include "nsGkAtoms.h"
 #include "nsIAtom.h"
 #include "nsIContent.h"
 #include "nsIDocument.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMRange.h"
-#include "nsIEditorIMESupport.h"
 #include "nsIFrame.h"
 #include "nsINode.h"
 #include "nsIPresShell.h"
 #include "nsISelectionController.h"
 #include "nsISelectionPrivate.h"
 #include "nsISupports.h"
 #include "nsIWidget.h"
 #include "nsPresContext.h"
@@ -637,22 +636,21 @@ IMEContentObserver::IsEditorHandlingEven
 
 bool
 IMEContentObserver::IsEditorComposing() const
 {
   // Note that don't use TextComposition here. The important thing is,
   // whether the editor already started to handle composition because
   // web contents can change selection, text content and/or something from
   // compositionstart event listener which is run before EditorBase handles it.
-  nsCOMPtr<nsIEditorIMESupport> editorIMESupport = do_QueryInterface(mEditor);
-  if (NS_WARN_IF(!editorIMESupport)) {
+  if (NS_WARN_IF(!mEditor)) {
     return false;
   }
   bool isComposing = false;
-  nsresult rv = editorIMESupport->GetComposing(&isComposing);
+  nsresult rv = mEditor->GetComposing(&isComposing);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return false;
   }
   return isComposing;
 }
 
 nsresult
 IMEContentObserver::GetSelectionAndRoot(nsISelection** aSelection,
--- a/dom/html/nsGenericHTMLElement.cpp
+++ b/dom/html/nsGenericHTMLElement.cpp
@@ -72,17 +72,16 @@
 #include "mozilla/dom/HTMLFormElement.h"
 #include "nsFocusManager.h"
 #include "nsAttrValueOrString.h"
 
 #include "mozilla/InternalMutationEvent.h"
 #include "nsDOMStringMap.h"
 
 #include "nsIEditor.h"
-#include "nsIEditorIMESupport.h"
 #include "nsLayoutUtils.h"
 #include "mozAutoDocUpdate.h"
 #include "nsHtml5Module.h"
 #include "nsITextControlElement.h"
 #include "mozilla/dom/Element.h"
 #include "HTMLFieldSetElement.h"
 #include "nsTextNode.h"
 #include "HTMLBRElement.h"
@@ -1824,21 +1823,18 @@ nsGenericHTMLFormElement::GetForm(nsIDOM
 }
 
 nsIContent::IMEState
 nsGenericHTMLFormElement::GetDesiredIMEState()
 {
   nsIEditor* editor = GetEditorInternal();
   if (!editor)
     return nsGenericHTMLElement::GetDesiredIMEState();
-  nsCOMPtr<nsIEditorIMESupport> imeEditor = do_QueryInterface(editor);
-  if (!imeEditor)
-    return nsGenericHTMLElement::GetDesiredIMEState();
   IMEState state;
-  nsresult rv = imeEditor->GetPreferredIMEState(&state);
+  nsresult rv = editor->GetPreferredIMEState(&state);
   if (NS_FAILED(rv))
     return nsGenericHTMLElement::GetDesiredIMEState();
   return state;
 }
 
 nsresult
 nsGenericHTMLFormElement::BindToTree(nsIDocument* aDocument,
                                      nsIContent* aParent,
--- a/dom/html/nsTextEditorState.cpp
+++ b/dom/html/nsTextEditorState.cpp
@@ -22,17 +22,16 @@
 #include "nsIDOMHTMLInputElement.h"
 #include "nsIDOMHTMLTextAreaElement.h"
 #include "nsITransactionManager.h"
 #include "nsIControllerContext.h"
 #include "nsAttrValue.h"
 #include "nsAttrValueInlines.h"
 #include "nsGenericHTMLElement.h"
 #include "nsIDOMEventListener.h"
-#include "nsIEditorIMESupport.h"
 #include "nsIEditorObserver.h"
 #include "nsIWidget.h"
 #include "nsIDocumentEncoder.h"
 #include "nsISelectionPrivate.h"
 #include "nsPIDOMWindow.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIEditor.h"
 #include "mozilla/dom/Selection.h"
@@ -2012,20 +2011,17 @@ nsTextEditorState::SetValue(const nsAStr
       //       forcibly committing composition.
       if (nsContentUtils::IsSafeToRunScript()) {
         WeakPtr<nsTextEditorState> self(this);
         // WARNING: During this call, compositionupdate, compositionend, input
         // events will be fired.  Therefore, everything can occur.  E.g., the
         // document may be unloaded.
         mValueBeingSet = aValue;
         mIsCommittingComposition = true;
-        nsCOMPtr<nsIEditorIMESupport> editorIMESupport =
-                                        do_QueryInterface(mEditor);
-        MOZ_RELEASE_ASSERT(editorIMESupport);
-        nsresult rv = editorIMESupport->ForceCompositionEnd();
+        nsresult rv = mEditor->ForceCompositionEnd();
         if (!self.get()) {
           return true;
         }
         mIsCommittingComposition = false;
         // If this is called recursively during committing composition and
         // some of them may be skipped above.  Therefore, we need to set
         // value to the editor with the aValue of the latest call.
         newValue = mValueBeingSet;
@@ -2279,19 +2275,18 @@ nsTextEditorState::HideSelectionIfBlurre
     mSelCon->SetDisplaySelection(nsISelectionController::SELECTION_HIDDEN);
   }
 }
 
 bool
 nsTextEditorState::EditorHasComposition()
 {
   bool isComposing = false;
-  nsCOMPtr<nsIEditorIMESupport> editorIMESupport = do_QueryInterface(mEditor);
-  return editorIMESupport &&
-         NS_SUCCEEDED(editorIMESupport->GetComposing(&isComposing)) &&
+  return mEditor &&
+         NS_SUCCEEDED(mEditor->GetComposing(&isComposing)) &&
          isComposing;
 }
 
 NS_IMPL_ISUPPORTS(nsAnonDivObserver, nsIMutationObserver)
 
 void
 nsAnonDivObserver::CharacterDataChanged(nsIDocument*             aDocument,
                                         nsIContent*              aContent,
--- a/editor/libeditor/EditorBase.h
+++ b/editor/libeditor/EditorBase.h
@@ -136,18 +136,17 @@ struct IMEState;
 
 /**
  * Implementation of an editor object.  it will be the controller/focal point
  * for the main editor services. i.e. the GUIManager, publishing, transaction
  * manager, event interfaces. the idea for the event interfaces is to have them
  * delegate the actual commands to the editor independent of the XPFE
  * implementation.
  */
-class EditorBase : public nsIEditor
-                 , public nsIEditorIMESupport
+class EditorBase : public nsIEditorIMESupport
                  , public nsSupportsWeakReference
                  , public nsIPhonetic
 {
 public:
   typedef dom::Element Element;
   typedef dom::Selection Selection;
   typedef dom::Text Text;
 
--- a/editor/libeditor/EditorEventListener.cpp
+++ b/editor/libeditor/EditorEventListener.cpp
@@ -32,17 +32,16 @@
 #include "nsIDOMElement.h"              // for nsIDOMElement
 #include "nsIDOMEvent.h"                // for nsIDOMEvent
 #include "nsIDOMEventTarget.h"          // for nsIDOMEventTarget
 #include "nsIDOMKeyEvent.h"             // for nsIDOMKeyEvent
 #include "nsIDOMMouseEvent.h"           // for nsIDOMMouseEvent
 #include "nsIDOMNode.h"                 // for nsIDOMNode
 #include "nsIDocument.h"                // for nsIDocument
 #include "nsIEditor.h"                  // for EditorBase::GetSelection, etc.
-#include "nsIEditorIMESupport.h"
 #include "nsIEditorMailSupport.h"       // for nsIEditorMailSupport
 #include "nsIFocusManager.h"            // for nsIFocusManager
 #include "nsIFormControl.h"             // for nsIFormControl, etc.
 #include "nsIHTMLEditor.h"              // for nsIHTMLEditor
 #include "nsINode.h"                    // for nsINode, ::NODE_IS_EDITABLE, etc.
 #include "nsIPlaintextEditor.h"         // for nsIPlaintextEditor, etc.
 #include "nsIPresShell.h"               // for nsIPresShell
 #include "nsISelectionController.h"     // for nsISelectionController, etc.
--- a/editor/libeditor/HTMLEditor.h
+++ b/editor/libeditor/HTMLEditor.h
@@ -98,16 +98,19 @@ public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(HTMLEditor, TextEditor)
 
   HTMLEditor();
 
   bool GetReturnInParagraphCreatesNewParagraph();
   Element* GetSelectionContainer();
 
+  // nsIEditor overrides
+  NS_IMETHOD GetPreferredIMEState(widget::IMEState* aState) override;
+
   // TextEditor overrides
   NS_IMETHOD GetIsDocumentEditable(bool* aIsDocumentEditable) override;
   NS_IMETHOD BeginningOfDocument() override;
   virtual nsresult HandleKeyPressEvent(nsIDOMKeyEvent* aKeyEvent) override;
   virtual already_AddRefed<nsIContent> GetFocusedContent() override;
   virtual already_AddRefed<nsIContent> GetFocusedContentForIME() override;
   virtual bool IsActiveInDOMWindow() override;
   virtual already_AddRefed<dom::EventTarget> GetDOMEventTarget() override;
@@ -119,19 +122,16 @@ public:
   virtual bool IsEditable(nsINode* aNode) override;
   using EditorBase::IsEditable;
 
   // nsStubMutationObserver overrides
   NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
   NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED
   NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED
 
-  // nsIEditorIMESupport overrides
-  NS_IMETHOD GetPreferredIMEState(widget::IMEState* aState) override;
-
   // nsIHTMLEditor methods
   NS_DECL_NSIHTMLEDITOR
 
   // nsIHTMLObjectResizer methods (implemented in HTMLObjectResizer.cpp)
   NS_DECL_NSIHTMLOBJECTRESIZER
 
   // nsIHTMLAbsPosEditor methods (implemented in HTMLAbsPositionEditor.cpp)
   NS_DECL_NSIHTMLABSPOSEDITOR
--- a/editor/libeditor/HTMLEditorDataTransfer.cpp
+++ b/editor/libeditor/HTMLEditorDataTransfer.cpp
@@ -46,17 +46,16 @@
 #include "nsIDOMHTMLImageElement.h"
 #include "nsIDOMHTMLInputElement.h"
 #include "nsIDOMHTMLLinkElement.h"
 #include "nsIDOMHTMLObjectElement.h"
 #include "nsIDOMHTMLScriptElement.h"
 #include "nsIDOMNode.h"
 #include "nsIDocument.h"
 #include "nsIEditor.h"
-#include "nsIEditorIMESupport.h"
 #include "nsIEditorMailSupport.h"
 #include "nsIEditRules.h"
 #include "nsIFile.h"
 #include "nsIInputStream.h"
 #include "nsIMIMEService.h"
 #include "nsNameSpaceManager.h"
 #include "nsINode.h"
 #include "nsIParserUtils.h"
--- a/editor/libeditor/HTMLStyleEditor.cpp
+++ b/editor/libeditor/HTMLStyleEditor.cpp
@@ -22,17 +22,16 @@
 #include "nsDebug.h"
 #include "nsError.h"
 #include "nsGkAtoms.h"
 #include "nsIAtom.h"
 #include "nsIContent.h"
 #include "nsIContentIterator.h"
 #include "nsIDOMElement.h"
 #include "nsIEditor.h"
-#include "nsIEditorIMESupport.h"
 #include "nsIEditRules.h"
 #include "nsNameSpaceManager.h"
 #include "nsINode.h"
 #include "nsISupportsImpl.h"
 #include "nsLiteralString.h"
 #include "nsRange.h"
 #include "nsReadableUtils.h"
 #include "nsString.h"
--- a/editor/libeditor/TextEditor.cpp
+++ b/editor/libeditor/TextEditor.cpp
@@ -35,17 +35,16 @@
 #include "nsIDOMCharacterData.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMEventTarget.h"
 #include "nsIDOMKeyEvent.h"
 #include "nsIDOMNode.h"
 #include "nsIDOMNodeList.h"
 #include "nsIDocumentEncoder.h"
-#include "nsIEditorIMESupport.h"
 #include "nsIEditRules.h"
 #include "nsINode.h"
 #include "nsIPresShell.h"
 #include "nsISelectionController.h"
 #include "nsISupportsPrimitives.h"
 #include "nsITransferable.h"
 #include "nsIWeakReferenceUtils.h"
 #include "nsNameSpaceManager.h"
--- a/editor/libeditor/TextEditorDataTransfer.cpp
+++ b/editor/libeditor/TextEditorDataTransfer.cpp
@@ -23,17 +23,16 @@
 #include "nsIDOMDragEvent.h"
 #include "nsIDOMEvent.h"
 #include "nsIDOMNode.h"
 #include "nsIDOMUIEvent.h"
 #include "nsIDocument.h"
 #include "nsIDragService.h"
 #include "nsIDragSession.h"
 #include "nsIEditor.h"
-#include "nsIEditorIMESupport.h"
 #include "nsIDocShell.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIPrincipal.h"
 #include "nsIFormControl.h"
 #include "nsIPlaintextEditor.h"
 #include "nsISupportsPrimitives.h"
 #include "nsITransferable.h"
 #include "nsIVariant.h"
--- a/editor/libeditor/tests/test_bug1230473.html
+++ b/editor/libeditor/tests/test_bug1230473.html
@@ -29,24 +29,22 @@ SimpleTest.waitForFocus(()=>{
     }
     function value() {
       return isNSEditableElement() ? aEditor.value : aEditor.textContent;
     }
     function isComposing() {
       return isNSEditableElement() ?  SpecialPowers.wrap(aEditor)
                                                    .QueryInterface(SpecialPowers.Ci.nsIDOMNSEditableElement)
                                                    .editor
-                                                   .QueryInterface(SpecialPowers.Ci.nsIEditorIMESupport)
                                                    .composing :
                                       SpecialPowers.wrap(window)
                                                    .QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor)
                                                    .getInterface(SpecialPowers.Ci.nsIWebNavigation)
                                                    .QueryInterface(SpecialPowers.Ci.nsIDocShell)
                                                    .editor
-                                                   .QueryInterface(SpecialPowers.Ci.nsIEditorIMESupport)
                                                    .composing;
     }
     function clear() {
       if (isNSEditableElement()) {
         aEditor.value = "";
       } else {
         aEditor.textContent = "";
       }
--- a/editor/libeditor/tests/test_composition_event_created_in_chrome.html
+++ b/editor/libeditor/tests/test_composition_event_created_in_chrome.html
@@ -15,64 +15,62 @@
 <script type="application/javascript">
 
 // In nsEditorEventListener, when listening event is not created with proper
 // event interface, it asserts the fact.
 SimpleTest.waitForExplicitFinish();
 
 var gInputElement = document.getElementById("input");
 
-function getEditorIMESupport(aInputElement)
+function getEditor(aInputElement)
 {
   var editableElement = SpecialPowers.wrap(aInputElement).QueryInterface(SpecialPowers.Ci.nsIDOMNSEditableElement);
   ok(editableElement, "The input element doesn't have nsIDOMNSEditableElement interface");
   ok(editableElement.editor, "There is no editor for the input element");
-  var editorIMESupport = SpecialPowers.wrap(editableElement).editor.QueryInterface(SpecialPowers.Ci.nsIEditorIMESupport);
-  ok(editorIMESupport, "The input element doesn't have nsIEditorIMESupport interface");
-  return editorIMESupport;
+  return editableElement.editor;
 }
 
-var gEditorIMESupport;
+var gEditor;
 
 function testNotGenerateCompositionByCreatedEvents(aEventInterface)
 {
   var compositionEvent = document.createEvent(aEventInterface);
   if (compositionEvent.initCompositionEvent) {
     compositionEvent.initCompositionEvent("compositionstart", true, true, window, "", "");
   } else if (compositionEvent.initMouseEvent) {
     compositionEvent.initMouseEvent("compositionstart", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
   }
   gInputElement.dispatchEvent(compositionEvent);
-  ok(!gEditorIMESupport.composing, "Composition shouldn't be started with a created compositionstart event (" + aEventInterface + ")");
+  ok(!gEditor.composing, "Composition shouldn't be started with a created compositionstart event (" + aEventInterface + ")");
 
   compositionEvent = document.createEvent(aEventInterface);
   if (compositionEvent.initCompositionEvent) {
     compositionEvent.initCompositionEvent("compositionupdate", true, false, window, "abc", "");
   } else if (compositionEvent.initMouseEvent) {
     compositionEvent.initMouseEvent("compositionupdate", true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
   }
   gInputElement.dispatchEvent(compositionEvent);
-  ok(!gEditorIMESupport.composing, "Composition shouldn't be started with a created compositionupdate event (" + aEventInterface + ")");
+  ok(!gEditor.composing, "Composition shouldn't be started with a created compositionupdate event (" + aEventInterface + ")");
   is(gInputElement.value, "", "Input element shouldn't be modified with a created compositionupdate event (" + aEventInterface + ")");
 
   compositionEvent = document.createEvent(aEventInterface);
   if (compositionEvent.initCompositionEvent) {
     compositionEvent.initCompositionEvent("compositionend", true, false, window, "abc", "");
   } else if (compositionEvent.initMouseEvent) {
     compositionEvent.initMouseEvent("compositionend", true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
   }
   gInputElement.dispatchEvent(compositionEvent);
-  ok(!gEditorIMESupport.composing, "Composition shouldn't be committed with a created compositionend event (" + aEventInterface + ")");
+  ok(!gEditor.composing, "Composition shouldn't be committed with a created compositionend event (" + aEventInterface + ")");
   is(gInputElement.value, "", "Input element shouldn't be committed with a created compositionend event (" + aEventInterface + ")");
 }
 
 function doTests()
 {
   gInputElement.focus();
-  gEditorIMESupport = getEditorIMESupport(gInputElement);
+  gEditor = getEditor(gInputElement);
 
   testNotGenerateCompositionByCreatedEvents("CompositionEvent");
   testNotGenerateCompositionByCreatedEvents("MouseEvent");
 
   SimpleTest.finish();
 }
 
 SimpleTest.waitForFocus(doTests);
--- a/editor/nsIEditor.idl
+++ b/editor/nsIEditor.idl
@@ -16,16 +16,26 @@ interface nsIDocumentStateListener;
 interface nsIOutputStream;
 interface nsITransactionManager;
 interface nsITransaction;
 interface nsIEditorObserver;
 interface nsIEditActionListener;
 interface nsIInlineSpellChecker;
 interface nsITransferable;
 
+%{C++
+namespace mozilla {
+namespace widget {
+struct IMEState;
+} // namespace widget
+} // namespace mozilla
+%}
+
+native IMEState(mozilla::widget::IMEState);
+
 [scriptable, uuid(094be624-f0bf-400f-89e2-6a84baab9474)]
 interface nsIEditor  : nsISupports
 {
 %{C++
   typedef short EDirection;
   typedef short EStripWrappers;
 %}
   const short eNone = 0;
@@ -559,9 +569,24 @@ interface nsIEditor  : nsISupports
   attribute boolean suppressDispatchingInputEvent;
 
   /**
    * True if an edit action is being handled (in other words, between calls of
    * nsIEditorObserver::BeforeEditAction() and nsIEditorObserver::EditAction()
    * or nsIEditorObserver::CancelEditAction().  Otherwise, false.
    */
   [noscript] readonly attribute boolean isInEditAction;
+
+  /**
+   * forceCompositionEnd() force the composition end
+   */
+  void forceCompositionEnd();
+
+  /**
+   * Get preferred IME status of current widget.
+   */
+  [noscript] IMEState getPreferredIMEState();
+
+  /**
+   * whether this editor has active IME transaction
+   */
+  readonly attribute boolean composing;
 };
--- a/editor/nsIEditorIMESupport.idl
+++ b/editor/nsIEditorIMESupport.idl
@@ -1,40 +1,11 @@
 /* -*- 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"
-#include "domstubs.idl"
-
-%{C++
-namespace mozilla {
-namespace widget {
-struct IMEState;
-} // namespace widget
-} // namespace mozilla
-%}
-
-native IMEState(mozilla::widget::IMEState);
+#include "nsIEditor.idl"
 
 [scriptable, uuid(0ba7f490-afb8-46dd-87fc-bc6137fbc899)]
-
-interface nsIEditorIMESupport : nsISupports
+interface nsIEditorIMESupport : nsIEditor
 {
-  /**
-   * forceCompositionEnd() force the composition end
-   */
-
-  void forceCompositionEnd();
-
-  /**
-   * Get preferred IME status of current widget.
-   */
-
-  [noscript] IMEState getPreferredIMEState();
-
-  /**
-   * whether this editor has active IME transaction
-   */
-  readonly attribute boolean composing;
 };
-
--- a/layout/forms/nsTextControlFrame.cpp
+++ b/layout/forms/nsTextControlFrame.cpp
@@ -8,17 +8,16 @@
 #include "nsCOMPtr.h"
 #include "nsFontMetrics.h"
 #include "nsTextControlFrame.h"
 #include "nsIPlaintextEditor.h"
 #include "nsCaret.h"
 #include "nsCSSPseudoElements.h"
 #include "nsGenericHTMLElement.h"
 #include "nsIEditor.h"
-#include "nsIEditorIMESupport.h"
 #include "nsIPhonetic.h"
 #include "nsTextFragment.h"
 #include "nsIDOMHTMLTextAreaElement.h"
 #include "nsNameSpaceManager.h"
 #include "nsFormControlFrame.h" //for registering accesskeys
 
 #include "nsIContent.h"
 #include "nsPresContext.h"
@@ -1202,21 +1201,19 @@ nsresult
 nsTextControlFrame::GetPhonetic(nsAString& aPhonetic)
 {
   aPhonetic.Truncate(0);
 
   nsCOMPtr<nsIEditor> editor;
   nsresult rv = GetEditor(getter_AddRefs(editor));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsCOMPtr<nsIEditorIMESupport> imeSupport = do_QueryInterface(editor);
-  if (imeSupport) {
-    nsCOMPtr<nsIPhonetic> phonetic = do_QueryInterface(imeSupport);
-    if (phonetic)
-      phonetic->GetPhonetic(aPhonetic);
+  nsCOMPtr<nsIPhonetic> phonetic = do_QueryInterface(editor);
+  if (phonetic) {
+    phonetic->GetPhonetic(aPhonetic);
   }
   return NS_OK;
 }
 
 ///END NSIFRAME OVERLOADS
 /////BEGIN PROTECTED METHODS
 
 bool
--- a/mobile/android/chrome/content/ActionBarHandler.js
+++ b/mobile/android/chrome/content/ActionBarHandler.js
@@ -228,19 +228,19 @@ var ActionBarHandler = {
   /**
    * Final UI cleanup when Actionbar is closed by icon click, or where
    * we terminate selection state after before/after actionbar actions
    * (Cut, Copy, Paste, Search, Share, Call).
    */
   _clearSelection: function(element = this._targetElement, win = this._contentWindow) {
     // Commit edit compositions, and clear focus from editables.
     if (element) {
-      let imeSupport = this._getEditor(element, win).QueryInterface(Ci.nsIEditorIMESupport);
-      if (imeSupport.composing) {
-        imeSupport.forceCompositionEnd();
+      let editor = this._getEditor(element, win);
+      if (editor.composing) {
+        editor.forceCompositionEnd();
       }
       element.blur();
     }
 
     // Remove Selection from non-editables and now-unfocused contentEditables.
     if (!element || element.isContentEditable) {
       this._getSelection().removeAllRanges();
     }
@@ -341,19 +341,18 @@ var ActionBarHandler = {
       },
 
       action: function(element, win) {
         // Some Mobile keyboards such as SwiftKeyboard, provide auto-suggest
         // style highlights via composition selections in editables.
         if (element) {
           // If we have an active composition string, commit it, and 
           // ensure proper element focus.
-          let imeSupport = ActionBarHandler._getEditor(element, win).
-            QueryInterface(Ci.nsIEditorIMESupport);
-          if (imeSupport.composing) {
+          let editor = ActionBarHandler._getEditor(element, win)
+          if (editor.composing) {
             element.blur();
             element.focus();
           }
         }
 
         // Close ActionBarHandler, then selectAll, and display handles.
         ActionBarHandler._getSelectAllController(element, win).selectAll();
         UITelemetry.addEvent("action.1", "actionbar", null, "select_all");
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -4846,19 +4846,18 @@ var FormAssistant = {
 
         let editableElement = this._currentInputElement.QueryInterface(Ci.nsIDOMNSEditableElement);
 
         this._doingAutocomplete = true;
 
         // If we have an active composition string, commit it before sending
         // the autocomplete event with the text that will replace it.
         try {
-          let imeEditor = editableElement.editor.QueryInterface(Ci.nsIEditorIMESupport);
-          if (imeEditor.composing)
-            imeEditor.forceCompositionEnd();
+          if (editableElement.editor.composing)
+            editableElement.editor.forceCompositionEnd();
         } catch (e) {}
 
         editableElement.setUserInput(aData);
         this._currentInputValue = aData;
 
         let event = this._currentInputElement.ownerDocument.createEvent("Events");
         event.initEvent("DOMAutoComplete", true, true);
         this._currentInputElement.dispatchEvent(event);
--- a/mobile/android/tests/browser/robocop/robocop_input.html
+++ b/mobile/android/tests/browser/robocop/robocop_input.html
@@ -104,31 +104,29 @@
                 designMode.contentDocument.body.firstChild, pos);
           };
           setValue(val);
           designMode.contentWindow.focus();
           designMode.contentDocument.body.focus();
         },
 
         test_reflush_changes: function() {
-          let inputIme = getEditor().QueryInterface(SpecialPowers.Ci.nsIEditorIMESupport);
-          do_check_true(inputIme.composing);
+          do_check_true(getEditor().composing);
 
           // Ending the composition then setting the input value triggers the bug.
-          inputIme.forceCompositionEnd();
+          getEditor().forceCompositionEnd();
           setValue("good"); // Value that testInputConnection.java expects.
           setSelection(4);
         },
 
         test_set_selection: function() {
-          let inputIme = getEditor().QueryInterface(SpecialPowers.Ci.nsIEditorIMESupport);
-          do_check_true(inputIme.composing);
+          do_check_true(getEditor().composing);
 
           // Ending the composition then setting the selection triggers the bug.
-          inputIme.forceCompositionEnd();
+          getEditor().forceCompositionEnd();
           setSelection(3); // Offsets that testInputConnection.java expects.
         },
 
         test_bug1123514: function() {
           document.activeElement.addEventListener('input', function test_bug1123514_listener() {
             this.removeEventListener('input', test_bug1123514_listener);
 
             // Only works on input and textarea.
--- a/toolkit/content/widgets/textbox.xml
+++ b/toolkit/content/widgets/textbox.xml
@@ -191,20 +191,17 @@
               // Forward focus to actual HTML input
               this.inputField.focus();
               break;
             case this.inputField:
               if (this.mIgnoreFocus) {
                 this.mIgnoreFocus = false;
               } else if (this.clickSelectsAll) {
                 try {
-                  const nsIEditorIMESupport =
-                          Components.interfaces.nsIEditorIMESupport;
-                  let imeEditor = this.editor.QueryInterface(nsIEditorIMESupport);
-                  if (!imeEditor || !imeEditor.composing)
+                  if (!this.editor || !this.editor.composing)
                     this.editor.selectAll();
                 } catch (e) {}
               }
               break;
             default:
               // Allow other children (e.g. URL bar buttons) to get focus
               return;
           }
--- a/widget/tests/test_imestate.html
+++ b/widget/tests/test_imestate.html
@@ -1245,46 +1245,44 @@ function runEditorFlagChangeTests()
   const kIMEStateChangeFlags =
     Components.interfaces.nsIPlaintextEditor.eEditorPasswordMask |
     Components.interfaces.nsIPlaintextEditor.eEditorReadonlyMask |
     Components.interfaces.nsIPlaintextEditor.eEditorDisabledMask;
   var editor =
     window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
       getInterface(Components.interfaces.nsIWebNavigation).
       QueryInterface(Components.interfaces.nsIDocShell).editor;
-  var editorIMESupport =
-    editor.QueryInterface(Components.interfaces.nsIEditorIMESupport);
   var flags = editor.flags;
 
   // input characters
   synthesizeCompositionChange(
     { "composition":
       { "string": "\u3078\u3093\u3057\u3093",
         "clauses":
         [
           { "length": 4, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
         ]
       },
       "caret": { "start": 4, "length": 0 }
     });
 
   editor.flags &= ~kIMEStateChangeFlags;
-  ok(editorIMESupport.composing,
+  ok(editor.composing,
      description + "#1 IME composition was committed unexpectedly");
   is(gUtils.IMEStatus, gUtils.IME_STATUS_ENABLED,
      description + "#1 IME isn't enabled on HTML editor");
 
   editor.flags |= ~kIMEStateChangeFlags;
-  ok(editorIMESupport.composing,
+  ok(editor.composing,
      description + "#2 IME composition was committed unexpectedly");
   is(gUtils.IMEStatus, gUtils.IME_STATUS_ENABLED,
      description + "#2 IME isn't enabled on HTML editor");
 
   editor.flags = flags;
-  ok(editorIMESupport.composing,
+  ok(editor.composing,
      description + "#3 IME composition was committed unexpectedly");
   is(gUtils.IMEStatus, gUtils.IME_STATUS_ENABLED,
      description + "#3 IME isn't enabled on HTML editor");
 
   // cancel the composition
   synthesizeComposition({ type: "compositioncommit", data: "" });
 
   container.removeAttribute("contenteditable");
--- a/widget/tests/window_composition_text_querycontent.xul
+++ b/widget/tests/window_composition_text_querycontent.xul
@@ -96,35 +96,32 @@ var iframe2 = document.getElementById("i
 var iframe3 = document.getElementById("iframe3");
 var contenteditable;
 var windowOfContenteditable;
 var input = document.getElementById("input");
 var textareaInFrame;
 
 const nsITextInputProcessorCallback = Components.interfaces.nsITextInputProcessorCallback;
 const nsIDOMNSEditableElement = Components.interfaces.nsIDOMNSEditableElement;
-const nsIEditorIMESupport = Components.interfaces.nsIEditorIMESupport;
 const nsIInterfaceRequestor = Components.interfaces.nsIInterfaceRequestor;
 const nsIWebNavigation = Components.interfaces.nsIWebNavigation;
 const nsIDocShell = Components.interfaces.nsIDocShell;
 
 function hitEventLoop(aFunc, aTimes)
 {
   if (--aTimes) {
     setTimeout(hitEventLoop, 0, aFunc, aTimes);
   } else {
     setTimeout(aFunc, 20);
   }
 }
 
-function getEditorIMESupport(aNode)
+function getEditor(aNode)
 {
-  return aNode.QueryInterface(nsIDOMNSEditableElement).
-               editor.
-               QueryInterface(nsIEditorIMESupport);
+  return aNode.QueryInterface(nsIDOMNSEditableElement).editor;
 }
 
 function getHTMLEditorIMESupport(aWindow)
 {
   return aWindow.QueryInterface(nsIInterfaceRequestor).
                  getInterface(nsIWebNavigation).
                  QueryInterface(nsIDocShell).
                  editor;
@@ -4758,17 +4755,17 @@ function runForceCommitTest()
   is(events[1].data, "\u306E",
      "runForceCommitTest: compositionend has wrong data #2");
   is(events[0].target, textarea,
      "runForceCommitTest: The 1st event was fired on wrong event target #2");
   is(events[1].target, textarea,
      "runForceCommitTest: The 2nd event was fired on wrong event target #2");
   is(events[2].target, textarea,
      "runForceCommitTest: The 3rd event was fired on wrong event target #2");
-  ok(!getEditorIMESupport(textarea).isComposing,
+  ok(!getEditor(textarea).isComposing,
      "runForceCommitTest: the textarea still has composition #2");
   is(textarea.value, "\u306E",
      "runForceCommitTest: the textarea doesn't have the committed text #2");
 
   // Make the composition in textarea commit by click in another editor (input)
   textarea.focus();
   textarea.value = "";
   input.value = "";
@@ -4798,19 +4795,19 @@ function runForceCommitTest()
   is(events[1].data, "\u306E",
      "runForceCommitTest: compositionend has wrong data #3");
   is(events[0].target, textarea,
      "runForceCommitTest: The 1st event was fired on wrong event target #3");
   is(events[1].target, textarea,
      "runForceCommitTest: The 2nd event was fired on wrong event target #3");
   is(events[2].target, textarea,
      "runForceCommitTest: The 3rd event was fired on wrong event target #3");
-  ok(!getEditorIMESupport(textarea).isComposing,
+  ok(!getEditor(textarea).isComposing,
      "runForceCommitTest: the textarea still has composition #3");
-  ok(!getEditorIMESupport(input).isComposing,
+  ok(!getEditor(input).isComposing,
      "runForceCommitTest: the input has composition #3");
   is(textarea.value, "\u306E",
      "runForceCommitTest: the textarea doesn't have the committed text #3");
   is(input.value, "",
      "runForceCommitTest: the input has the committed text? #3");
 
   // Make the composition in textarea commit by blur()
   textarea.focus();
@@ -4841,17 +4838,17 @@ function runForceCommitTest()
   is(events[1].data, "\u306E",
      "runForceCommitTest: compositionend has wrong data #4");
   is(events[0].target, textarea,
      "runForceCommitTest: The 1st event was fired on wrong event target #4");
   is(events[1].target, textarea,
      "runForceCommitTest: The 2nd event was fired on wrong event target #4");
   is(events[2].target, textarea,
      "runForceCommitTest: The 3rd event was fired on wrong event target #4");
-  ok(!getEditorIMESupport(textarea).isComposing,
+  ok(!getEditor(textarea).isComposing,
      "runForceCommitTest: the textarea still has composition #4");
   is(textarea.value, "\u306E",
      "runForceCommitTest: the textarea doesn't have the committed text #4");
 
   // Make the composition in textarea commit by input.focus()
   textarea.focus();
   textarea.value = "";
   input.value = "";
@@ -4881,19 +4878,19 @@ function runForceCommitTest()
   is(events[1].data, "\u306E",
      "runForceCommitTest: compositionend has wrong data #5");
   is(events[0].target, textarea,
      "runForceCommitTest: The 1st event was fired on wrong event target #5");
   is(events[1].target, textarea,
      "runForceCommitTest: The 2nd event was fired on wrong event target #5");
   is(events[2].target, textarea,
      "runForceCommitTest: The 3rd event was fired on wrong event target #5");
-  ok(!getEditorIMESupport(textarea).isComposing,
+  ok(!getEditor(textarea).isComposing,
      "runForceCommitTest: the textarea still has composition #5");
-  ok(!getEditorIMESupport(input).isComposing,
+  ok(!getEditor(input).isComposing,
      "runForceCommitTest: the input has composition #5");
   is(textarea.value, "\u306E",
      "runForceCommitTest: the textarea doesn't have the committed text #5");
   is(input.value, "",
      "runForceCommitTest: the input has the committed text? #5");
 
   // Make the composition in textarea commit by click in another document's editor
   textarea.focus();
@@ -4925,19 +4922,19 @@ function runForceCommitTest()
   is(events[1].data, "\u306E",
      "runForceCommitTest: compositionend has wrong data #6");
   is(events[0].target, textarea,
      "runForceCommitTest: The 1st event was fired on wrong event target #6");
   is(events[1].target, textarea,
      "runForceCommitTest: The 2nd event was fired on wrong event target #6");
   is(events[2].target, textarea,
      "runForceCommitTest: The 3rd event was fired on wrong event target #6");
-  ok(!getEditorIMESupport(textarea).isComposing,
+  ok(!getEditor(textarea).isComposing,
      "runForceCommitTest: the textarea still has composition #6");
-  ok(!getEditorIMESupport(textareaInFrame).isComposing,
+  ok(!getEditor(textareaInFrame).isComposing,
      "runForceCommitTest: the textarea in frame has composition #6");
   is(textarea.value, "\u306E",
      "runForceCommitTest: the textarea doesn't have the committed text #6");
   is(textareaInFrame.value, "",
      "runForceCommitTest: the textarea in frame has the committed text? #6");
 
   // Make the composition in textarea commit by another document's editor's focus()
   textarea.focus();
@@ -4969,19 +4966,19 @@ function runForceCommitTest()
   is(events[1].data, "\u306E",
      "runForceCommitTest: compositionend has wrong data #7");
   is(events[0].target, textarea,
      "runForceCommitTest: The 1st event was fired on wrong event target #7");
   is(events[1].target, textarea,
      "runForceCommitTest: The 2nd event was fired on wrong event target #7");
   is(events[2].target, textarea,
      "runForceCommitTest: The 3rd event was fired on wrong event target #7");
-  ok(!getEditorIMESupport(textarea).isComposing,
+  ok(!getEditor(textarea).isComposing,
      "runForceCommitTest: the textarea still has composition #7");
-  ok(!getEditorIMESupport(textareaInFrame).isComposing,
+  ok(!getEditor(textareaInFrame).isComposing,
      "runForceCommitTest: the textarea in frame has composition #7");
   is(textarea.value, "\u306E",
      "runForceCommitTest: the textarea doesn't have the committed text #7");
   is(textareaInFrame.value, "",
      "runForceCommitTest: the textarea in frame has the committed text? #7");
 
   // Make the composition in a textarea commit by click in another editable document
   textarea.focus();
@@ -5014,17 +5011,17 @@ function runForceCommitTest()
   is(events[1].data, "\u306E",
      "runForceCommitTest: compositionend has wrong data #8");
   is(events[0].target, textarea,
      "runForceCommitTest: The 1st event was fired on wrong event target #8");
   is(events[1].target, textarea,
      "runForceCommitTest: The 2nd event was fired on wrong event target #8");
   is(events[2].target, textarea,
      "runForceCommitTest: The 3rd event was fired on wrong event target #8");
-  ok(!getEditorIMESupport(textarea).isComposing,
+  ok(!getEditor(textarea).isComposing,
      "runForceCommitTest: the textarea still has composition #8");
   ok(!getHTMLEditorIMESupport(iframe2.contentWindow).isComposing,
      "runForceCommitTest: the editable document has composition #8");
   is(textarea.value, "\u306E",
      "runForceCommitTest: the textarea doesn't have the committed text #8");
   is(iframe2.contentDocument.body.innerHTML, iframe2BodyInnerHTML,
      "runForceCommitTest: the editable document has the committed text? #8");
 
@@ -5102,17 +5099,17 @@ function runForceCommitTest()
   is(events[0].target, iframe2.contentDocument.body,
      "runForceCommitTest: The 1st event was fired on wrong event target #10");
   is(events[1].target, iframe2.contentDocument.body,
      "runForceCommitTest: The 2nd event was fired on wrong event target #10");
   is(events[2].target, iframe2.contentDocument.body,
      "runForceCommitTest: The 3rd event was fired on wrong event target #10");
   ok(!getHTMLEditorIMESupport(iframe2.contentWindow).isComposing,
      "runForceCommitTest: the editable document still has composition #10");
-  ok(!getEditorIMESupport(textarea).isComposing,
+  ok(!getEditor(textarea).isComposing,
      "runForceCommitTest: the textarea has composition #10");
   ok(iframe2.contentDocument.body.innerHTML != iframe2BodyInnerHTML &&
      iframe2.contentDocument.body.innerHTML.indexOf("\u306E") >= 0,
      "runForceCommitTest: the editable document doesn't have the committed text #10");
   is(textarea.value, "",
      "runForceCommitTest: the textarea has the committed text? #10");
 
   // Make the composition in an editable document commit by click in the another editable document
@@ -5190,17 +5187,17 @@ function runForceCommitTest()
   is(events[1].data, "\u306E",
      "runForceCommitTest: compositionend has wrong data #12");
   is(events[0].target, input,
      "runForceCommitTest: The 1st event was fired on wrong event target #12");
   is(events[1].target, input,
      "runForceCommitTest: The 2nd event was fired on wrong event target #12");
   is(events[2].target, input,
      "runForceCommitTest: The 3rd event was fired on wrong event target #12");
-  ok(!getEditorIMESupport(input).isComposing,
+  ok(!getEditor(input).isComposing,
      "runForceCommitTest: the input still has composition #12");
   is(input.value, "set value",
      "runForceCommitTest: the input doesn't have the set text #12");
 
   textarea.focus();
   textarea.value = "";
 
   synthesizeCompositionChange(
@@ -5228,17 +5225,17 @@ function runForceCommitTest()
   is(events[1].data, "\u306E",
      "runForceCommitTest: compositionend has wrong data #13");
   is(events[0].target, textarea,
      "runForceCommitTest: The 1st event was fired on wrong event target #13");
   is(events[1].target, textarea,
      "runForceCommitTest: The 2nd event was fired on wrong event target #13");
   is(events[2].target, textarea,
      "runForceCommitTest: The 3rd event was fired on wrong event target #13");
-  ok(!getEditorIMESupport(textarea).isComposing,
+  ok(!getEditor(textarea).isComposing,
      "runForceCommitTest: the textarea still has composition #13");
   is(textarea.value, "set value",
      "runForceCommitTest: the textarea doesn't have the set text #13");
 
   input.focus();
   input.value = "";
 
   synthesizeCompositionChange(
@@ -5266,17 +5263,17 @@ function runForceCommitTest()
   is(events[1].data, "\u306E",
      "runForceCommitTest: compositionend has wrong data #14");
   is(events[0].target, input,
      "runForceCommitTest: The 1st event was fired on wrong event target #14");
   is(events[1].target, input,
      "runForceCommitTest: The 2nd event was fired on wrong event target #14");
   is(events[2].target, input,
      "runForceCommitTest: The 3rd event was fired on wrong event target #14");
-  ok(!getEditorIMESupport(input).isComposing,
+  ok(!getEditor(input).isComposing,
      "runForceCommitTest: the input still has composition #14");
   is(input.value, "\u306E appended value",
      "runForceCommitTest: the input should have both composed text and appended text #14");
 
   input.focus();
   input.value = "abcd";
 
   synthesizeCompositionChange(
@@ -5378,17 +5375,17 @@ function runNestedSettingValue()
   is(events[1].data, "\u306E",
      "runNestedSettingValue: compositionend has wrong data #1");
   is(events[0].target, textarea,
      "runNestedSettingValue: The 1st event was fired on wrong event target #1");
   is(events[1].target, textarea,
      "runNestedSettingValue: The 2nd event was fired on wrong event target #1");
   is(events[2].target, textarea,
      "runNestedSettingValue: The 3rd event was fired on wrong event target #1");
-  ok(!getEditorIMESupport(textarea).isComposing,
+  ok(!getEditor(textarea).isComposing,
      "runNestedSettingValue: the textarea still has composition #1");
   is(textarea.value, "first setting value, text, compositionend, input, ",
      "runNestedSettingValue: the textarea should have all string set to value attribute");
 
   input.focus();
   input.value = "";
 
   synthesizeCompositionChange(
@@ -5418,17 +5415,17 @@ function runNestedSettingValue()
   is(events[1].data, "\u306E",
      "runNestedSettingValue: compositionend has wrong data #2");
   is(events[0].target, input,
      "runNestedSettingValue: The 1st event was fired on wrong event target #2");
   is(events[1].target, input,
      "runNestedSettingValue: The 2nd event was fired on wrong event target #2");
   is(events[2].target, input,
      "runNestedSettingValue: The 3rd event was fired on wrong event target #2");
-  ok(!getEditorIMESupport(input).isComposing,
+  ok(!getEditor(input).isComposing,
      "runNestedSettingValue: the input still has composition #2");
   is(textarea.value, "first setting value, text, compositionend, input, ",
      "runNestedSettingValue: the input should have all string set to value attribute #2");
 
   textarea.focus();
   textarea.value = "";
 
   synthesizeCompositionChange(
@@ -5458,17 +5455,17 @@ function runNestedSettingValue()
   is(events[1].data, "\u306E",
      "runNestedSettingValue: compositionend has wrong data #3");
   is(events[0].target, textarea,
      "runNestedSettingValue: The 1st event was fired on wrong event target #3");
   is(events[1].target, textarea,
      "runNestedSettingValue: The 2nd event was fired on wrong event target #3");
   is(events[2].target, textarea,
      "runNestedSettingValue: The 3rd event was fired on wrong event target #3");
-  ok(!getEditorIMESupport(textarea).isComposing,
+  ok(!getEditor(textarea).isComposing,
      "runNestedSettingValue: the textarea still has composition #3");
   is(textarea.value, "\u306Efirst setting value, text, compositionend, input, ",
      "runNestedSettingValue: the textarea should have appended by setRangeText() and all string set to value attribute #3");
 
   input.focus();
   input.value = "";
 
   synthesizeCompositionChange(
@@ -5498,17 +5495,17 @@ function runNestedSettingValue()
   is(events[1].data, "\u306E",
      "runNestedSettingValue: compositionend has wrong data #4");
   is(events[0].target, input,
      "runNestedSettingValue: The 1st event was fired on wrong event target #4");
   is(events[1].target, input,
      "runNestedSettingValue: The 2nd event was fired on wrong event target #4");
   is(events[2].target, input,
      "runNestedSettingValue: The 3rd event was fired on wrong event target #4");
-  ok(!getEditorIMESupport(input).isComposing,
+  ok(!getEditor(input).isComposing,
      "runNestedSettingValue: the input still has composition #4");
   is(textarea.value, "\u306Efirst setting value, text, compositionend, input, ",
      "runNestedSettingValue: the input should have all string appended by setRangeText() and set to value attribute #4");
 
   window.removeEventListener("compositionstart", eventHandler, true);
   window.removeEventListener("compositionupdate", eventHandler, true);
   window.removeEventListener("compositionend", eventHandler, true);
   window.removeEventListener("input", eventHandler, true);
@@ -5605,17 +5602,17 @@ function runAsyncForceCommitTest(aNextTe
   is(events[1].data, "\u306E",
      "runAsyncForceCommitTest: compositionend has wrong data #2");
   is(events[0].target, textarea,
      "runAsyncForceCommitTest: The 1st event was fired on wrong event target #2");
   is(events[1].target, textarea,
      "runAsyncForceCommitTest: The 2nd event was fired on wrong event target #2");
   is(events[2].target, textarea,
      "runAsyncForceCommitTest: The 3rd event was fired on wrong event target #2");
-  ok(!getEditorIMESupport(textarea).isComposing,
+  ok(!getEditor(textarea).isComposing,
      "runAsyncForceCommitTest: the textarea still has composition #2");
   is(textarea.value, "\u306E",
      "runAsyncForceCommitTest: the textarea doesn't have the committed text #2");
 }
 
 function runBug811755Test()
 {
   iframe2.contentDocument.body.innerHTML = "<div>content<br/></div>";
@@ -6090,17 +6087,17 @@ function runRemoveContentTest(aCallback)
     is(events[2].data, "",
        "runRemoveContentTest: compositionend has wrong data #1");
     is(events[0].target, textarea,
        "runRemoveContentTest: The 1st event was fired on wrong event target #1");
     is(events[1].target, textarea,
        "runRemoveContentTest: The 2nd event was fired on wrong event target #1");
     is(events[2].target, textarea,
        "runRemoveContentTest: The 3rd event was fired on wrong event target #1");
-    ok(!getEditorIMESupport(textarea).isComposing,
+    ok(!getEditor(textarea).isComposing,
        "runRemoveContentTest: the textarea still has composition #1");
     todo_is(textarea.value, "",
        "runRemoveContentTest: the textarea has the committed text? #1");
 
     parent.insertBefore(textarea, nextSibling);
 
     textarea.focus();
     textarea.value = "";
@@ -6115,17 +6112,17 @@ function runRemoveContentTest(aCallback)
       is(events.length, 1,
          "runRemoveContentTest: wrong event count #2");
       is(events[0].type, "compositionend",
          "runRemoveContentTest: the 1st event must be compositionend #2");
       is(events[0].data, "",
          "runRemoveContentTest: compositionupdate has wrong data #2");
       is(events[0].target, textarea,
          "runRemoveContentTest: The 1st event was fired on wrong event target #2");
-      ok(!getEditorIMESupport(textarea).isComposing,
+      ok(!getEditor(textarea).isComposing,
          "runRemoveContentTest: the textarea still has composition #2");
       is(textarea.value, "",
          "runRemoveContentTest: the textarea has the committed text? #2");
 
       parent.insertBefore(textarea, nextSibling);
 
       textarea.removeEventListener("compositionstart", eventHandler, true);
       textarea.removeEventListener("compositionupdate", eventHandler, true);