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 // nsAccDocManager static
PLDHashOperator PLDHashOperator
nsAccDocManager::ClearDocCacheEntry(const nsIDocument* aKey, nsAccDocManager::GetFirstEntryInDocCache(const nsIDocument* aKey,
nsRefPtr<nsDocAccessible>& aDocAccessible, nsDocAccessible* aDocAccessible,
void* aUserArg) void* aUserArg)
{ {
NS_ASSERTION(aDocAccessible, 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) return PL_DHASH_STOP;
aDocAccessible->Shutdown(); }
return PL_DHASH_REMOVE; void
nsAccDocManager::ClearDocCache()
{
nsDocAccessible* docAcc = nsnull;
while (mDocAccessibleCache.EnumerateRead(GetFirstEntryInDocCache, static_cast<void*>(&docAcc))) {
if (docAcc)
docAcc->Shutdown();
}
} }
PLDHashOperator PLDHashOperator

View File

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

View File

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