Bug 362074 - ns*TextFieldAccessible::CheckForEditor should use nsIDOMNSEditableElement. r=aaronlev.
git-svn-id: svn://10.0.0.236/trunk@216063 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -41,6 +41,7 @@
|
||||
#include "nsAccessibilityAtoms.h"
|
||||
#include "nsHTMLFormControlAccessible.h"
|
||||
#include "nsIDOMHTMLInputElement.h"
|
||||
#include "nsIDOMNSEditableElement.h"
|
||||
#include "nsIDOMNSHTMLButtonElement.h"
|
||||
#include "nsIDOMHTMLLegendElement.h"
|
||||
#include "nsIDOMHTMLTextAreaElement.h"
|
||||
@@ -417,15 +418,15 @@ void nsHTMLTextFieldAccessible::SetEditor(nsIEditor* aEditor)
|
||||
|
||||
void nsHTMLTextFieldAccessible::CheckForEditor()
|
||||
{
|
||||
nsIFrame *frame = GetFrame();
|
||||
if (frame) {
|
||||
nsITextControlFrame *textFrame;
|
||||
frame->QueryInterface(NS_GET_IID(nsITextControlFrame), (void**)&textFrame);
|
||||
if (textFrame) {
|
||||
nsCOMPtr<nsIEditor> editor;
|
||||
textFrame->GetEditor(getter_AddRefs(editor));
|
||||
SetEditor(editor);
|
||||
}
|
||||
nsCOMPtr<nsIDOMNSEditableElement> editableElt(do_QueryInterface(mDOMNode));
|
||||
if (!editableElt) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIEditor> editor;
|
||||
nsresult rv = editableElt->GetEditor(getter_AddRefs(editor));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
SetEditor(editor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#include "nsAccessibilityAtoms.h"
|
||||
#include "nsAccessibleTreeWalker.h"
|
||||
#include "nsIDOMHTMLInputElement.h"
|
||||
#include "nsIDOMNSEditableElement.h"
|
||||
#include "nsIDOMXULButtonElement.h"
|
||||
#include "nsIDOMXULCheckboxElement.h"
|
||||
#include "nsIDOMXULMenuListElement.h"
|
||||
@@ -797,23 +798,18 @@ void nsXULTextFieldAccessible::CheckForEditor()
|
||||
|
||||
nsCOMPtr<nsIDOMNode> inputField;
|
||||
textBox->GetInputField(getter_AddRefs(inputField));
|
||||
nsCOMPtr<nsIContent> inputContent = do_QueryInterface(inputField);
|
||||
if (!inputContent) {
|
||||
if (!inputField) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIPresShell> presShell = GetPresShell();
|
||||
nsIFrame *inputFrame = presShell->GetPrimaryFrameFor(inputContent);
|
||||
if (!inputFrame) {
|
||||
|
||||
nsCOMPtr<nsIDOMNSEditableElement> editableElt(do_QueryInterface(inputField));
|
||||
if (!editableElt) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsITextControlFrame *textFrame;
|
||||
inputFrame->QueryInterface(NS_GET_IID(nsITextControlFrame), (void**)&textFrame);
|
||||
if (textFrame) {
|
||||
nsCOMPtr<nsIEditor> editor;
|
||||
textFrame->GetEditor(getter_AddRefs(editor));
|
||||
|
||||
nsCOMPtr<nsIEditor> editor;
|
||||
nsresult rv = editableElt->GetEditor(getter_AddRefs(editor));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
SetEditor(editor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user