Bug 1388006 - a11y module should use TextEditor and HTMLEditor instead of nsIEditor r=surkov
Accessibility module uses nsIEditor (and nsIPlaintextEditor). However, now, it can use TextEditor and HTMLEditor. So, it should use them. Note that this patch makes HTMLTextFieldAccessible::GetEditor() use nsITextControlElement::GetTextEditor() instead of nsIDOMNSEditableElement::GetEditor() but this won't change actual behavior since both implementation of HTMLInputElement and HTMLTextareaElement are just call shared internal methods. MozReview-Commit-ID: HxHMGVSvWFv
This commit is contained in:
@@ -15,13 +15,13 @@
|
||||
|
||||
#include "nsContentList.h"
|
||||
#include "mozilla/dom/HTMLInputElement.h"
|
||||
#include "nsIDOMNSEditableElement.h"
|
||||
#include "nsIDOMHTMLTextAreaElement.h"
|
||||
#include "nsIEditor.h"
|
||||
#include "nsIFormControl.h"
|
||||
#include "nsIPersistentProperties2.h"
|
||||
#include "nsISelectionController.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsITextControlElement.h"
|
||||
#include "nsITextControlFrame.h"
|
||||
#include "nsNameSpaceManager.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "mozilla/EventStates.h"
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/TextEditor.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
@@ -459,17 +460,16 @@ HTMLTextFieldAccessible::DoAction(uint8_t aIndex)
|
||||
return true;
|
||||
}
|
||||
|
||||
already_AddRefed<nsIEditor>
|
||||
already_AddRefed<TextEditor>
|
||||
HTMLTextFieldAccessible::GetEditor() const
|
||||
{
|
||||
nsCOMPtr<nsIDOMNSEditableElement> editableElt(do_QueryInterface(mContent));
|
||||
if (!editableElt)
|
||||
nsCOMPtr<nsITextControlElement> textControlElement =
|
||||
do_QueryInterface(mContent);
|
||||
if (!textControlElement) {
|
||||
return nullptr;
|
||||
|
||||
nsCOMPtr<nsIEditor> editor;
|
||||
editableElt->GetEditor(getter_AddRefs(editor));
|
||||
|
||||
return editor.forget();
|
||||
}
|
||||
RefPtr<TextEditor> textEditor = textControlElement->GetTextEditor();
|
||||
return textEditor.forget();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user