mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 751497 - replace nsHTMLSelectOptionAccessible::GetSelectState by nice inline, r=surkov, f=hub
This commit is contained in:
parent
d227b8bcca
commit
76151d0a62
@ -265,9 +265,12 @@ nsHTMLSelectOptionAccessible::NativeState()
|
||||
// because we don't want EDITABLE or SELECTABLE_TEXT
|
||||
PRUint64 state = nsAccessible::NativeState();
|
||||
|
||||
PRUint64 selectState = 0;
|
||||
nsIContent* selectContent = GetSelectState(&selectState);
|
||||
if (!selectContent || selectState & states::INVISIBLE)
|
||||
nsAccessible* select = GetSelect();
|
||||
if (!select)
|
||||
return state;
|
||||
|
||||
PRUint64 selectState = select->State();
|
||||
if (selectState & states::INVISIBLE)
|
||||
return state;
|
||||
|
||||
// Focusable and selectable
|
||||
@ -391,30 +394,6 @@ 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,11 +133,17 @@ public:
|
||||
private:
|
||||
|
||||
/**
|
||||
* Get Select element's accessible state
|
||||
* @param aState, Select element state
|
||||
* @return Select element content, returns null if not avaliable
|
||||
* Return a select accessible the option belongs to if any.
|
||||
*/
|
||||
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.
|
||||
@ -146,7 +152,7 @@ private:
|
||||
{
|
||||
if (mParent && mParent->IsListControl()) {
|
||||
nsAccessible* combobox = mParent->Parent();
|
||||
return combobox->IsCombobox() ? combobox : nsnull;
|
||||
return combobox && combobox->IsCombobox() ? combobox : nsnull;
|
||||
}
|
||||
|
||||
return nsnull;
|
||||
|
Loading…
Reference in New Issue
Block a user