Merge patches that got pushed while I was queueing up. a=me

This commit is contained in:
Kyle Huey 2010-12-02 11:26:38 -05:00
commit f498f89577
3 changed files with 22 additions and 16 deletions

View File

@ -491,17 +491,25 @@ nsAccDocManager::CreateDocOrRootAccessible(nsIDocument *aDocument)
// nsAccDocManager static
PLDHashOperator
nsAccDocManager::ClearDocCacheEntry(const nsIDocument* aKey,
nsRefPtr<nsDocAccessible>& aDocAccessible,
nsAccDocManager::GetFirstEntryInDocCache(const nsIDocument* aKey,
nsDocAccessible* aDocAccessible,
void* aUserArg)
{
NS_ASSERTION(aDocAccessible,
"Calling ClearDocCacheEntry with a NULL pointer!");
"No doc accessible for the object in doc accessible cache!");
*reinterpret_cast<nsDocAccessible**>(aUserArg) = aDocAccessible;
if (aDocAccessible)
aDocAccessible->Shutdown();
return PL_DHASH_STOP;
}
return PL_DHASH_REMOVE;
void
nsAccDocManager::ClearDocCache()
{
nsDocAccessible* docAcc = nsnull;
while (mDocAccessibleCache.EnumerateRead(GetFirstEntryInDocCache, static_cast<void*>(&docAcc))) {
if (docAcc)
docAcc->Shutdown();
}
}
PLDHashOperator

View File

@ -152,20 +152,17 @@ private:
nsDocAccessibleHashtable;
/**
* Shutdown and remove the document accessible from cache.
* Get first entry of the document accessible from cache.
*/
static PLDHashOperator
ClearDocCacheEntry(const nsIDocument* aKey,
nsRefPtr<nsDocAccessible>& aDocAccessible,
GetFirstEntryInDocCache(const nsIDocument* aKey,
nsDocAccessible* aDocAccessible,
void* aUserArg);
/**
* Clear the cache and shutdown the document accessibles.
*/
void ClearDocCache()
{
mDocAccessibleCache.Enumerate(ClearDocCacheEntry, static_cast<void*>(this));
}
void ClearDocCache();
struct nsSearchAccessibleInCacheArg
{

View File

@ -1,6 +1,7 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>Keyboard shortcuts tests</title>
<link rel="stylesheet" type="text/css"
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
@ -27,7 +28,7 @@
function doTest()
{
testKeyboardShortcut("input1", "");
testKeyboardShortcut("input2", "Alt+Shift+b");
testKeyboardShortcut("input2", MAC ? "⌃b" : "Alt+Shift+b");
SimpleTest.finish();
}