Remove unneeded nsIDOMNSHTMLInputElement interface by merging it into nsIDOMHTMLInputElement. (Bug 582303) r=jst
This commit is contained in:
@@ -44,7 +44,6 @@
|
||||
#include "nsTextEquivUtils.h"
|
||||
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMNSHTMLInputElement.h"
|
||||
#include "nsIDOMHTMLInputElement.h"
|
||||
#include "nsIDOMNSHTMLElement.h"
|
||||
#include "nsIDOMNSEditableElement.h"
|
||||
@@ -122,30 +121,23 @@ nsHTMLCheckboxAccessible::GetStateInternal(PRUint32 *aState,
|
||||
|
||||
*aState |= nsIAccessibleStates::STATE_CHECKABLE;
|
||||
|
||||
PRBool checked = PR_FALSE; // Radio buttons and check boxes can be checked
|
||||
PRBool mixed = PR_FALSE; // or mixed.
|
||||
PRBool state = PR_FALSE; // Radio buttons and check boxes can be checked or mixed
|
||||
|
||||
nsCOMPtr<nsIDOMNSHTMLInputElement> html5CheckboxElement =
|
||||
do_QueryInterface(mContent);
|
||||
|
||||
if (html5CheckboxElement) {
|
||||
html5CheckboxElement->GetIndeterminate(&mixed);
|
||||
|
||||
if (mixed) {
|
||||
*aState |= nsIAccessibleStates::STATE_MIXED;
|
||||
return NS_OK; // indeterminate can't be checked at the same time.
|
||||
}
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMHTMLInputElement> htmlCheckboxElement =
|
||||
do_QueryInterface(mContent);
|
||||
|
||||
if (htmlCheckboxElement) {
|
||||
htmlCheckboxElement->GetChecked(&checked);
|
||||
|
||||
if (checked)
|
||||
*aState |= nsIAccessibleStates::STATE_CHECKED;
|
||||
}
|
||||
htmlCheckboxElement->GetIndeterminate(&state);
|
||||
|
||||
if (state) {
|
||||
*aState |= nsIAccessibleStates::STATE_MIXED;
|
||||
} else { // indeterminate can't be checked at the same time.
|
||||
htmlCheckboxElement->GetChecked(&state);
|
||||
|
||||
if (state)
|
||||
*aState |= nsIAccessibleStates::STATE_CHECKED;
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@@ -552,7 +544,7 @@ NS_IMETHODIMP nsHTMLTextFieldAccessible::GetActionName(PRUint8 aIndex, nsAString
|
||||
NS_IMETHODIMP nsHTMLTextFieldAccessible::DoAction(PRUint8 index)
|
||||
{
|
||||
if (index == 0) {
|
||||
nsCOMPtr<nsIDOMNSHTMLElement> element(do_QueryInterface(mContent));
|
||||
nsCOMPtr<nsIDOMHTMLElement> element(do_QueryInterface(mContent));
|
||||
if ( element ) {
|
||||
return element->Focus();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user