Bug 544017 - Fix DEBUG_A11Y compile path and move TestChildCache to DEBUG; r=surkov

This commit is contained in:
David Bolter 2010-02-09 08:29:22 -05:00
parent 7aeccf6123
commit 4593919aab
3 changed files with 12 additions and 11 deletions

View File

@ -3012,7 +3012,7 @@ nsAccessible::CacheChildren()
void
nsAccessible::TestChildCache(nsAccessible *aCachedChild)
{
#ifdef DEBUG_A11Y
#ifdef DEBUG
// All cached accessible nodes should be in the parent
// It will assert if not all the children were created
// when they were first cached, and no invalidation
@ -3020,12 +3020,13 @@ nsAccessible::TestChildCache(nsAccessible *aCachedChild)
PRUint32 childCount = mChildren.Length();
if (childCount == 0) {
NS_ASSERTION(mAreChildrenInitialized,
"Children are stored but not initailzied!");
"Children are stored but not initialized!");
return;
}
nsAccessible *child;
for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
nsAccessible *child = GetChildAt(childIdx);
child = GetChildAt(childIdx);
if (child == aCachedChild)
break;
}

View File

@ -301,6 +301,11 @@ public:
virtual nsresult AppendTextTo(nsAString& aText, PRUint32 aStartOffset,
PRUint32 aLength);
/**
* Assert if child not in parent's cache.
*/
void TestChildCache(nsAccessible *aCachedChild);
protected:
//////////////////////////////////////////////////////////////////////////////
@ -311,11 +316,6 @@ protected:
*/
virtual void CacheChildren();
/**
* Assert if child not in parent's cache.
*/
void TestChildCache(nsAccessible *aCachedChild);
/**
* Cache children if necessary. Return true if the accessible is defunct.
*/

View File

@ -542,7 +542,7 @@ NS_IMETHODIMP nsDocAccessible::GetAssociatedEditor(nsIEditor **aEditor)
NS_IMETHODIMP nsDocAccessible::GetCachedAccessNode(void *aUniqueID, nsIAccessNode **aAccessNode)
{
GetCacheEntry(mAccessNodeCache, aUniqueID, aAccessNode); // Addrefs for us
#ifdef DEBUG_A11Y
#ifdef DEBUG
// All cached accessible nodes should be in the parent
// It will assert if not all the children were created
// when they were first cached, and no invalidation
@ -1956,11 +1956,11 @@ nsDocAccessible::InvalidateCacheSubtree(nsIContent *aChild,
printf("[Show %s %s]\n", NS_ConvertUTF16toUTF8(localName).get(), hasAccessible);
else if (aChangeType == nsIAccessibilityService::FRAME_SIGNIFICANT_CHANGE)
printf("[Layout change %s %s]\n", NS_ConvertUTF16toUTF8(localName).get(), hasAccessible);
else if (aChangeType == nsIAccessibleEvent::NODE_APPEND)
else if (aChangeType == nsIAccessibilityService::NODE_APPEND)
printf("[Create %s %s]\n", NS_ConvertUTF16toUTF8(localName).get(), hasAccessible);
else if (aChangeType == nsIAccessibilityService::NODE_REMOVE)
printf("[Destroy %s %s]\n", NS_ConvertUTF16toUTF8(localName).get(), hasAccessible);
else if (aChangeEventType == nsIAccessibilityService::NODE_SIGNIFICANT_CHANGE)
else if (aChangeType == nsIAccessibilityService::NODE_SIGNIFICANT_CHANGE)
printf("[Type change %s %s]\n", NS_ConvertUTF16toUTF8(localName).get(), hasAccessible);
#endif