mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 434464 - invalidate access node cache, patch by Alexander Surkov <surkov.alexander@gmail.com>, r=aaronlev
This commit is contained in:
parent
c031b61a7e
commit
fe6c72f9e1
@ -1335,11 +1335,15 @@ NS_IMETHODIMP nsAccessibilityService::GetAccessible(nsIDOMNode *aNode,
|
||||
|
||||
nsCOMPtr<nsIAccessible> newAcc;
|
||||
if (accessNode) {
|
||||
// Retrieved from cache
|
||||
// QI might not succeed if it's a node that's not accessible
|
||||
// Retrieved from cache. QI might not succeed if it's a node that's not
|
||||
// accessible. In this case try to create new accessible because one and
|
||||
// the same DOM node may be accessible or not in time (for example,
|
||||
// when it is visible or hidden).
|
||||
newAcc = do_QueryInterface(accessNode);
|
||||
NS_IF_ADDREF(*aAccessible = newAcc);
|
||||
return NS_OK;
|
||||
if (newAcc) {
|
||||
NS_ADDREF(*aAccessible = newAcc);
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIContent> content(do_QueryInterface(aNode));
|
||||
|
@ -517,8 +517,20 @@ NS_IMETHODIMP nsDocAccessible::GetCachedAccessNode(void *aUniqueID, nsIAccessNod
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDocAccessible::CacheAccessNode(void *aUniqueID, nsIAccessNode *aAccessNode)
|
||||
NS_IMETHODIMP
|
||||
nsDocAccessible::CacheAccessNode(void *aUniqueID, nsIAccessNode *aAccessNode)
|
||||
{
|
||||
// If there is an access node for the given unique ID then let's shutdown it.
|
||||
// The unique ID may be presented in the cache if originally we created
|
||||
// access node object and then we want to create accessible object when
|
||||
// DOM node is changed.
|
||||
nsCOMPtr<nsIAccessNode> accessNode;
|
||||
GetCacheEntry(mAccessNodeCache, aUniqueID, getter_AddRefs(accessNode));
|
||||
if (accessNode) {
|
||||
nsCOMPtr<nsPIAccessNode> prAccessNode = do_QueryInterface(accessNode);
|
||||
prAccessNode->Shutdown();
|
||||
}
|
||||
|
||||
PutCacheEntry(mAccessNodeCache, aUniqueID, aAccessNode);
|
||||
return NS_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user