Bug 544017 - Fix DEBUG_A11Y compile path and move TestChildCache to DEBUG; r=surkov
authorDavid Bolter <dbolter@mozilla.com>
Tue, 09 Feb 2010 08:29:22 -0500
changeset 38000 d0d1152973492801a3f146b154fb4eedafd26a52
parent 37999 95b102a398342eaa0fe9d5e7e2cdebfc9283fd23
child 38001 19dbabe331ad317c784f9a500dae0724e4e4003f
push id11560
push userdbolter@mozilla.com
push dateTue, 09 Feb 2010 13:29:56 +0000
treeherdermozilla-central@19dbabe331ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssurkov
bugs544017
milestone1.9.3a2pre
Bug 544017 - Fix DEBUG_A11Y compile path and move TestChildCache to DEBUG; r=surkov
accessible/src/base/nsAccessible.cpp
accessible/src/base/nsAccessible.h
accessible/src/base/nsDocAccessible.cpp
--- a/accessible/src/base/nsAccessible.cpp
+++ b/accessible/src/base/nsAccessible.cpp
@@ -3007,30 +3007,31 @@ nsAccessible::CacheChildren()
 
     walker.GetNextSibling();
   }
 }
 
 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
   // ever corrected parent accessible's child cache.
   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;
   }
 
   NS_ASSERTION(child == aCachedChild,
                "[TestChildCache] cached accessible wasn't found. Wrong accessible tree!");  
 #endif
 }
--- a/accessible/src/base/nsAccessible.h
+++ b/accessible/src/base/nsAccessible.h
@@ -296,32 +296,32 @@ public:
    *
    * @param aText         returned text of the accessible
    * @param aStartOffset  start offset inside of the accesible
    * @param aLength       required lenght of text
    */
   virtual nsresult AppendTextTo(nsAString& aText, PRUint32 aStartOffset,
                                 PRUint32 aLength);
 
+  /**
+   * Assert if child not in parent's cache.
+   */
+  void TestChildCache(nsAccessible *aCachedChild);
+
 protected:
 
   //////////////////////////////////////////////////////////////////////////////
   // Initializing, cache and tree traverse methods
 
   /**
    * Cache accessible children.
    */
   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.
    */
   PRBool EnsureChildren();
 
   /**
    * Return sibling accessible at the given offset.
    */
   virtual nsIAccessible* GetSiblingAtOffset(PRInt32 aOffset,
--- a/accessible/src/base/nsDocAccessible.cpp
+++ b/accessible/src/base/nsDocAccessible.cpp
@@ -537,17 +537,17 @@ NS_IMETHODIMP nsDocAccessible::GetAssoci
     NS_ADDREF(*aEditor = editor);
   }
   return NS_OK;
 }
 
 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
   // ever corrected parent accessible's child cache.
   nsRefPtr<nsAccessible> acc =
     nsAccUtils::QueryObject<nsAccessible>(*aAccessNode);
 
   if (acc) {
@@ -1951,21 +1951,21 @@ nsDocAccessible::InvalidateCacheSubtree(
   childNode->GetLocalName(localName);
   const char *hasAccessible = childAccessible ? " (acc)" : "";
   if (aChangeType == nsIAccessibilityService::FRAME_HIDE)
     printf("[Hide %s %s]\n", NS_ConvertUTF16toUTF8(localName).get(), hasAccessible);
   else if (aChangeType == nsIAccessibilityService::FRAME_SHOW)
     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
 
   nsCOMPtr<nsIAccessible> containerAccessible;
   GetAccessibleInParentChain(childNode, PR_TRUE, getter_AddRefs(containerAccessible));
   if (!containerAccessible) {
     containerAccessible = this;
   }