Bug 246236. Accessible trees need to be invalidated when mView changes. r=ginn.chen, sr=neil

This commit is contained in:
aaronleventhal%moonset.net 2006-05-17 15:57:44 +00:00
Родитель 887b260269
Коммит c07645d387
3 изменённых файлов: 18 добавлений и 1 удалений

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

@ -228,6 +228,8 @@ const char* const docEvents[] = {
"ValueChange", "ValueChange",
// capture AlertActive events (fired whenever alert pops up) // capture AlertActive events (fired whenever alert pops up)
"AlertActive", "AlertActive",
// add ourself as a TreeViewChanged listener (custom event fired in nsTreeBodyFrame.cpp)
"TreeViewChanged",
// add ourself as a OpenStateChange listener (custom event fired in tree.xml) // add ourself as a OpenStateChange listener (custom event fired in tree.xml)
"OpenStateChange", "OpenStateChange",
// add ourself as a CheckboxStateChange listener (custom event fired in nsHTMLInputElement.cpp) // add ourself as a CheckboxStateChange listener (custom event fired in nsHTMLInputElement.cpp)
@ -566,6 +568,13 @@ NS_IMETHODIMP nsRootAccessible::HandleEvent(nsIDOMEvent* aEvent)
return NS_OK; return NS_OK;
} }
if (eventType.EqualsLiteral("TreeViewChanged")) {
NS_ENSURE_TRUE(localName.EqualsLiteral("tree"), NS_OK);
nsCOMPtr<nsIContent> treeContent = do_QueryInterface(targetNode);
return mAccService->InvalidateSubtreeFor(eventShell, treeContent,
nsIAccessibleEvent::EVENT_REORDER);
}
nsCOMPtr<nsIAccessible> accessible; nsCOMPtr<nsIAccessible> accessible;
if (NS_FAILED(mAccService->GetAccessibleInShell(targetNode, eventShell, if (NS_FAILED(mAccService->GetAccessibleInShell(targetNode, eventShell,
getter_AddRefs(accessible)))) getter_AddRefs(accessible))))

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

@ -394,7 +394,10 @@ NS_IMETHODIMP nsXULTreeAccessible::GetCachedTreeitemAccessible(PRInt32 aRow, nsI
NS_ASSERTION(mAccessNodeCache, "No accessibility cache for tree"); NS_ASSERTION(mAccessNodeCache, "No accessibility cache for tree");
NS_ASSERTION(mTree && mTreeView, "Can't get mTree or mTreeView!\n"); NS_ASSERTION(mTree && mTreeView, "Can't get mTree or mTreeView!\n");
nsCOMPtr<nsITreeColumn> col = aColumn; nsCOMPtr<nsITreeColumn> col;
#ifdef MOZ_ACCESSIBILITY_ATK
col = aColumn;
#endif
PRInt32 columnIndex = -1; PRInt32 columnIndex = -1;
if (!col && mTree) { if (!col && mTree) {

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

@ -517,6 +517,11 @@ NS_IMETHODIMP nsTreeBodyFrame::SetView(nsITreeView * aView)
// necessarily entail a full invalidation of the tree. // necessarily entail a full invalidation of the tree.
Invalidate(); Invalidate();
nsIContent *treeContent = GetBaseElement();
if (treeContent) {
FireDOMEvent(NS_LITERAL_STRING("TreeViewChanged"), treeContent);
}
if (mView) { if (mView) {
// Give the view a new empty selection object to play with, but only if it // Give the view a new empty selection object to play with, but only if it
// doesn't have one already. // doesn't have one already.