Bug 380669. More states for HTML option accessibles. r=surkov

This commit is contained in:
aaronleventhal@moonset.net 2007-05-16 06:59:06 -07:00
parent 21495439b2
commit 01b65aa1a4

View File

@ -593,15 +593,11 @@ nsIFrame* nsHTMLSelectOptionAccessible::GetBoundsFrame()
NS_IMETHODIMP
nsHTMLSelectOptionAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
{
*aState = 0;
if (aExtraState) {
*aExtraState = 0;
}
if (!mDOMNode) {
if (aExtraState) {
*aExtraState = nsIAccessibleStates::EXT_STATE_DEFUNCT;
}
return NS_OK;
// Upcall to nsAccessible, but skip nsHyperTextAccessible impl
// because we don't want EXT_STATE_EDITABLE or EXT_STATE_SELECTABLE_TEXT
nsresult rv = nsAccessible::GetState(aState, aExtraState);
if (NS_FAILED(rv)) {
return rv;
}
PRUint32 selectState;
@ -632,6 +628,9 @@ nsHTMLSelectOptionAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
*aState |= nsIAccessibleStates::STATE_OFFSCREEN;
}
else {
// XXX list frames are weird, don't rely on nsAccessible's general
// visibility implementation unless they get reimplemented in layout
*aState &= ~nsIAccessibleStates::STATE_OFFSCREEN;
// <select> is not collapsed: compare bounds to calculate STATE_OFFSCREEN
nsCOMPtr<nsIAccessible> listAccessible = GetParent();
if (listAccessible) {