Bug 750191 - move IsTextInterfaceSupportCorrect under DEBUG ifdef, r=surkov, f=hub
authorMark Capella <markcapella@twcny.rr.com>
Tue, 08 May 2012 08:49:41 +0900
changeset 93428 9b7bea577a43a00963b65f0ce6b59a0704f7e34c
parent 93427 58d583e7f9b1fcc813725ed495c727d1eae4dad8
child 93429 e540d5d98b19eb26ac8644a738c49bb0bb699170
push id22634
push useremorley@mozilla.com
push dateTue, 08 May 2012 09:48:43 +0000
treeherdermozilla-central@e4f9e2eab6b1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssurkov
bugs750191
milestone15.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 750191 - move IsTextInterfaceSupportCorrect under DEBUG ifdef, r=surkov, f=hub
accessible/src/atk/nsAccessibleWrap.cpp
accessible/src/base/nsAccUtils.cpp
accessible/src/base/nsAccUtils.h
accessible/src/mac/mozAccessible.mm
accessible/src/msaa/nsAccessibleWrap.cpp
accessible/src/xul/nsXULMenuAccessible.cpp
--- a/accessible/src/atk/nsAccessibleWrap.cpp
+++ b/accessible/src/atk/nsAccessibleWrap.cpp
@@ -716,17 +716,17 @@ getDescriptionCB(AtkObject *aAtkObj)
 
 AtkRole
 getRoleCB(AtkObject *aAtkObj)
 {
   nsAccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
   if (!accWrap)
     return ATK_ROLE_INVALID;
 
-#ifdef DEBUG_A11Y
+#ifdef DEBUG
   NS_ASSERTION(nsAccUtils::IsTextInterfaceSupportCorrect(accWrap),
       "Does not support nsIAccessibleText when it should");
 #endif
 
   if (aAtkObj->role != ATK_ROLE_INVALID)
     return aAtkObj->role;
 
 #define ROLE(geckoRole, stringRole, atkRole, macRole, msaaRole, ia2Role) \
--- a/accessible/src/base/nsAccUtils.cpp
+++ b/accessible/src/base/nsAccUtils.cpp
@@ -438,44 +438,44 @@ nsAccUtils::GetLiveAttrValue(PRUint32 aR
     case ePoliteLiveAttr:
       aValue = NS_LITERAL_STRING("polite");
       return true;
   }
 
   return false;
 }
 
-#ifdef DEBUG_A11Y
+#ifdef DEBUG
 
 bool
-nsAccUtils::IsTextInterfaceSupportCorrect(nsAccessible *aAccessible)
+nsAccUtils::IsTextInterfaceSupportCorrect(nsAccessible* aAccessible)
 {
   // Don't test for accessible docs, it makes us create accessibles too
   // early and fire mutation events before we need to
   if (aAccessible->IsDoc())
     return true;
 
   bool foundText = false;
   PRInt32 childCount = aAccessible->GetChildCount();
-  for (PRint32 childIdx = 0; childIdx < childCount; childIdx++) {
-    nsAccessible *child = GetChildAt(childIdx);
+  for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
+    nsAccessible* child = aAccessible->GetChildAt(childIdx);
     if (IsText(child)) {
       foundText = true;
       break;
     }
   }
 
   if (foundText) {
     // found text child node
     nsCOMPtr<nsIAccessibleText> text = do_QueryObject(aAccessible);
     if (!text)
       return false;
   }
 
-  return true; 
+  return true;
 }
 #endif
 
 PRUint32
 nsAccUtils::TextLength(nsAccessible *aAccessible)
 {
   if (!IsText(aAccessible))
     return 1;
--- a/accessible/src/base/nsAccUtils.h
+++ b/accessible/src/base/nsAccUtils.h
@@ -265,17 +265,17 @@ public:
    *
    * @param  aRule   [in] rule constant (see ELiveAttrRule in nsAccMap.h)
    * @param  aValue  [out] object attribute value
    *
    * @return         true if object attribute should be exposed
    */
   static bool GetLiveAttrValue(PRUint32 aRule, nsAString& aValue);
 
-#ifdef DEBUG_A11Y
+#ifdef DEBUG
   /**
    * Detect whether the given accessible object implements nsIAccessibleText,
    * when it is text or has text child node.
    */
   static bool IsTextInterfaceSupportCorrect(nsAccessible *aAccessible);
 #endif
 
   /**
--- a/accessible/src/mac/mozAccessible.mm
+++ b/accessible/src/mac/mozAccessible.mm
@@ -448,17 +448,17 @@ GetNativeFromGeckoAccessible(nsIAccessib
   mGeckoAccessible->GetBounds (&x, &y, &width, &height);  
   return [NSValue valueWithSize:NSMakeSize (width, height)];
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
 }
 
 - (NSString*)role
 {
-#ifdef DEBUG_A11Y
+#ifdef DEBUG
   NS_ASSERTION(nsAccUtils::IsTextInterfaceSupportCorrect(mGeckoAccessible),
                "Does not support nsIAccessibleText when it should");
 #endif
 
 #define ROLE(geckoRole, stringRole, atkRole, macRole, msaaRole, ia2Role) \
   case roles::geckoRole: \
     return macRole;
 
--- a/accessible/src/msaa/nsAccessibleWrap.cpp
+++ b/accessible/src/msaa/nsAccessibleWrap.cpp
@@ -367,17 +367,17 @@ STDMETHODIMP nsAccessibleWrap::get_accRo
 
   nsAccessible* xpAccessible = GetXPAccessibleFor(varChild);
   if (!xpAccessible)
     return E_INVALIDARG;
 
   if (xpAccessible->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
-#ifdef DEBUG_A11Y
+#ifdef DEBUG
   NS_ASSERTION(nsAccUtils::IsTextInterfaceSupportCorrect(xpAccessible),
                "Does not support nsIAccessibleText when it should");
 #endif
 
   a11y::role geckoRole = xpAccessible->Role();
   PRUint32 msaaRole = 0;
 
 #define ROLE(_geckoRole, stringRole, atkRole, macRole, _msaaRole, ia2Role) \
@@ -1665,17 +1665,17 @@ nsAccessibleWrap::FirePlatformEvent(AccE
   nsIContent* cnt = accessible->GetContent();
   if (cnt) {
     cnt->Tag()->ToString(tag);
     nsIAtom* aid = cnt->GetID();
     if (aid)
       aid->ToUTF8String(id);
   }
 
-#ifdef DEBUG_A11Y
+#ifdef DEBUG
   printf("\n\nMSAA event: event: %d, target: %s@id='%s', childid: %d, hwnd: %d\n\n",
          eventType, NS_ConvertUTF16toUTF8(tag).get(), id.get(),
          childID, hWnd);
 #endif
 
   // Fire MSAA event for client area window.
   ::NotifyWinEvent(winEvent, hWnd, OBJID_CLIENT, childID);
 
--- a/accessible/src/xul/nsXULMenuAccessible.cpp
+++ b/accessible/src/xul/nsXULMenuAccessible.cpp
@@ -458,33 +458,29 @@ nsXULMenupopupAccessible::
   mSelectControl = do_QueryInterface(mContent->GetParent());
 }
 
 PRUint64
 nsXULMenupopupAccessible::NativeState()
 {
   PRUint64 state = nsAccessible::NativeState();
 
-#ifdef DEBUG_A11Y
+#ifdef DEBUG
   // We are onscreen if our parent is active
-  bool isActive = mContent->HasAttr(kNameSpaceID_None,
-                                      nsGkAtoms::menuactive);
+  bool isActive = mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::menuactive);
   if (!isActive) {
     nsAccessible* parent = Parent();
-    if (!parent)
-      return state;
-
-    nsIContent *parentContent = parnet->GetContent();
-    NS_ENSURE_TRUE(parentContent, state);
-
-    isActive = parentContent->HasAttr(kNameSpaceID_None,
-                                      nsGkAtoms::open);
+    if (parent) {
+      nsIContent* parentContent = parent->GetContent();
+      if (parentContent)
+        isActive = parentContent->HasAttr(kNameSpaceID_None, nsGkAtoms::open);
+    }
   }
 
-  NS_ASSERTION(isActive || states & states::INVISIBLE,
+  NS_ASSERTION(isActive || (state & states::INVISIBLE),
                "XULMenupopup doesn't have INVISIBLE when it's inactive");
 #endif
 
   if (state & states::INVISIBLE)
     state |= states::OFFSCREEN | states::COLLAPSED;
 
   return state;
 }