mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 743568 - Fire name change event when a XUL row's name changes, r=surkov.
This commit is contained in:
parent
ffc1a58e54
commit
976a7cf7e1
@ -397,6 +397,7 @@ XULTreeGridRowAccessible::RowInvalidated(int32_t aStartColIdx,
|
||||
if (!treeColumns)
|
||||
return;
|
||||
|
||||
bool nameChanged = false;
|
||||
for (int32_t colIdx = aStartColIdx; colIdx <= aEndColIdx; ++colIdx) {
|
||||
nsCOMPtr<nsITreeColumn> column;
|
||||
treeColumns->GetColumnAt(colIdx, getter_AddRefs(column));
|
||||
@ -405,18 +406,14 @@ XULTreeGridRowAccessible::RowInvalidated(int32_t aStartColIdx,
|
||||
if (cellAccessible) {
|
||||
nsRefPtr<XULTreeGridCellAccessible> cellAcc = do_QueryObject(cellAccessible);
|
||||
|
||||
cellAcc->CellInvalidated();
|
||||
nameChanged |= cellAcc->CellInvalidated();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
nsAutoString name;
|
||||
Name(name);
|
||||
|
||||
if (name != mCachedName) {
|
||||
if (nameChanged)
|
||||
nsEventShell::FireEvent(nsIAccessibleEvent::EVENT_NAME_CHANGE, this);
|
||||
mCachedName = name;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@ -763,7 +760,7 @@ XULTreeGridCellAccessible::RelationByType(RelationType aType)
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// XULTreeGridCellAccessible: public implementation
|
||||
|
||||
void
|
||||
bool
|
||||
XULTreeGridCellAccessible::CellInvalidated()
|
||||
{
|
||||
|
||||
@ -780,16 +777,20 @@ XULTreeGridCellAccessible::CellInvalidated()
|
||||
nsEventShell::FireEvent(accEvent);
|
||||
|
||||
mCachedTextEquiv = textEquiv;
|
||||
return true;
|
||||
}
|
||||
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
mTreeView->GetCellText(mRow, mColumn, textEquiv);
|
||||
if (mCachedTextEquiv != textEquiv) {
|
||||
nsEventShell::FireEvent(nsIAccessibleEvent::EVENT_NAME_CHANGE, this);
|
||||
mCachedTextEquiv = textEquiv;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -106,7 +106,6 @@ protected:
|
||||
|
||||
// XULTreeItemAccessibleBase
|
||||
mutable AccessibleHashtable mAccessibleCache;
|
||||
nsString mCachedName;
|
||||
};
|
||||
|
||||
|
||||
@ -180,8 +179,9 @@ public:
|
||||
/**
|
||||
* Fire name or state change event if the accessible text or value has been
|
||||
* changed.
|
||||
* @return true if name has changed
|
||||
*/
|
||||
void CellInvalidated();
|
||||
bool CellInvalidated();
|
||||
|
||||
protected:
|
||||
// Accessible
|
||||
|
Loading…
Reference in New Issue
Block a user