зеркало из https://github.com/mozilla/gecko-dev.git
Bug 246236. Accessible trees need to be invalidated when mView changes. r=ginn.chen, sr=neil
This commit is contained in:
Родитель
887b260269
Коммит
c07645d387
|
@ -228,6 +228,8 @@ const char* const docEvents[] = {
|
|||
"ValueChange",
|
||||
// capture AlertActive events (fired whenever alert pops up)
|
||||
"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)
|
||||
"OpenStateChange",
|
||||
// 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;
|
||||
}
|
||||
|
||||
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;
|
||||
if (NS_FAILED(mAccService->GetAccessibleInShell(targetNode, eventShell,
|
||||
getter_AddRefs(accessible))))
|
||||
|
|
|
@ -394,7 +394,10 @@ NS_IMETHODIMP nsXULTreeAccessible::GetCachedTreeitemAccessible(PRInt32 aRow, nsI
|
|||
NS_ASSERTION(mAccessNodeCache, "No accessibility cache for tree");
|
||||
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;
|
||||
|
||||
if (!col && mTree) {
|
||||
|
|
|
@ -517,6 +517,11 @@ NS_IMETHODIMP nsTreeBodyFrame::SetView(nsITreeView * aView)
|
|||
// necessarily entail a full invalidation of the tree.
|
||||
Invalidate();
|
||||
|
||||
nsIContent *treeContent = GetBaseElement();
|
||||
if (treeContent) {
|
||||
FireDOMEvent(NS_LITERAL_STRING("TreeViewChanged"), treeContent);
|
||||
}
|
||||
|
||||
if (mView) {
|
||||
// Give the view a new empty selection object to play with, but only if it
|
||||
// doesn't have one already.
|
||||
|
|
Загрузка…
Ссылка в новой задаче