Backout 386fac446673 (bug 751497) for compilation failures

This commit is contained in:
Ed Morley 2012-05-11 09:34:07 +01:00
Родитель 720758f4b7
Коммит 4489feda9b
2 изменённых файлов: 32 добавлений и 17 удалений

Просмотреть файл

@ -265,12 +265,9 @@ nsHTMLSelectOptionAccessible::NativeState()
// because we don't want EDITABLE or SELECTABLE_TEXT
PRUint64 state = nsAccessible::NativeState();
nsAccessible* select = GetSelect();
if (!select)
return state;
PRUint64 selectState = select->State();
if (selectState & states::INVISIBLE)
PRUint64 selectState = 0;
nsIContent* selectContent = GetSelectState(&selectState);
if (!selectContent || selectState & states::INVISIBLE)
return state;
// Focusable and selectable
@ -394,6 +391,30 @@ nsHTMLSelectOptionAccessible::ContainerWidget() const
return mParent && mParent->IsListControl() ? mParent : nsnull;
}
////////////////////////////////////////////////////////////////////////////////
// nsHTMLSelectOptionAccessible: private methods
nsIContent*
nsHTMLSelectOptionAccessible::GetSelectState(PRUint64* aState)
{
*aState = 0;
nsIContent* selectNode = mContent;
while (selectNode && selectNode->Tag() != nsGkAtoms::select) {
selectNode = selectNode->GetParent();
}
if (selectNode) {
nsAccessible* select = mDoc->GetAccessible(selectNode);
if (select) {
*aState = select->State();
return selectNode;
}
}
return nsnull;
}
////////////////////////////////////////////////////////////////////////////////
// nsHTMLSelectOptGroupAccessible
////////////////////////////////////////////////////////////////////////////////

Просмотреть файл

@ -133,17 +133,11 @@ public:
private:
/**
* Return a select accessible the option belongs to if any.
* Get Select element's accessible state
* @param aState, Select element state
* @return Select element content, returns null if not avaliable
*/
nsAccessible* GetSelect() const
{
if (mParent && mParent->IsListControl()) {
nsAccessible* combobox = mParent->Parent();
return combobox && combobox->IsCombobox() ? combobox : mParent;
}
return nsnull;
}
nsIContent* GetSelectState(PRUint64* aState);
/**
* Return a combobox accessible the option belongs to if any.
@ -152,7 +146,7 @@ private:
{
if (mParent && mParent->IsListControl()) {
nsAccessible* combobox = mParent->Parent();
return combobox && combobox->IsCombobox() ? combobox : nsnull;
return combobox->IsCombobox() ? combobox : nsnull;
}
return nsnull;