зеркало из https://github.com/mozilla/pjs.git
Bug 751497 - replace nsHTMLSelectOptionAccessible::GetSelectState by nice inline, r=surkov, f=hub
This commit is contained in:
Родитель
516b8dd8ec
Коммит
e6ff7ad6ad
|
@ -265,9 +265,12 @@ nsHTMLSelectOptionAccessible::NativeState()
|
||||||
// because we don't want EDITABLE or SELECTABLE_TEXT
|
// because we don't want EDITABLE or SELECTABLE_TEXT
|
||||||
PRUint64 state = nsAccessible::NativeState();
|
PRUint64 state = nsAccessible::NativeState();
|
||||||
|
|
||||||
PRUint64 selectState = 0;
|
nsAccessible* select = GetSelect();
|
||||||
nsIContent* selectContent = GetSelectState(&selectState);
|
if (!select)
|
||||||
if (!selectContent || selectState & states::INVISIBLE)
|
return state;
|
||||||
|
|
||||||
|
PRUint64 selectState = select->State();
|
||||||
|
if (selectState & states::INVISIBLE)
|
||||||
return state;
|
return state;
|
||||||
|
|
||||||
// Focusable and selectable
|
// Focusable and selectable
|
||||||
|
@ -391,30 +394,6 @@ nsHTMLSelectOptionAccessible::ContainerWidget() const
|
||||||
return mParent && mParent->IsListControl() ? mParent : nsnull;
|
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
|
// nsHTMLSelectOptGroupAccessible
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -133,11 +133,17 @@ public:
|
||||||
private:
|
private:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Select element's accessible state
|
* Return a select accessible the option belongs to if any.
|
||||||
* @param aState, Select element state
|
|
||||||
* @return Select element content, returns null if not avaliable
|
|
||||||
*/
|
*/
|
||||||
nsIContent* GetSelectState(PRUint64* aState);
|
nsAccessible* GetSelect() const
|
||||||
|
{
|
||||||
|
if (mParent && mParent->IsListControl()) {
|
||||||
|
nsAccessible* combobox = mParent->Parent();
|
||||||
|
return combobox && combobox->IsCombobox() ? combobox : mParent;
|
||||||
|
}
|
||||||
|
|
||||||
|
return nsnull;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a combobox accessible the option belongs to if any.
|
* Return a combobox accessible the option belongs to if any.
|
||||||
|
@ -146,7 +152,7 @@ private:
|
||||||
{
|
{
|
||||||
if (mParent && mParent->IsListControl()) {
|
if (mParent && mParent->IsListControl()) {
|
||||||
nsAccessible* combobox = mParent->Parent();
|
nsAccessible* combobox = mParent->Parent();
|
||||||
return combobox->IsCombobox() ? combobox : nsnull;
|
return combobox && combobox->IsCombobox() ? combobox : nsnull;
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsnull;
|
return nsnull;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче