bug 673689 - fix some new places where nsIAccessibleRole::ROLE_FOO was added r=me
authorTrevor Saunders <trev.saunders@gmail.com>
Wed, 11 Jan 2012 23:42:47 -0500
changeset 85501 90a2cc46965d1a0e4e6f651f7417e9ad45d806a6
parent 85500 0ef29ddd07e54d636e64586bc09130e1f315a3e9
child 85502 b3b1353ad67758903838bfea7823881faba97850
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs673689
milestone12.0a1
bug 673689 - fix some new places where nsIAccessibleRole::ROLE_FOO was added r=me
accessible/src/base/nsAccessible.cpp
accessible/src/base/nsDocAccessible.h
accessible/src/mac/mozAccessible.h
accessible/src/mac/mozAccessible.mm
--- a/accessible/src/base/nsAccessible.cpp
+++ b/accessible/src/base/nsAccessible.cpp
@@ -596,21 +596,19 @@ nsAccessible::VisibilityState()
 {
   PRUint64 vstates = states::INVISIBLE | states::OFFSCREEN;
 
   // We need to check the parent chain for visibility.
   nsAccessible* accessible = this;
   do {
     // We don't want background tab page content to be aggressively invisible.
     // Otherwise this foils screen reader virtual buffer caches.
-	  PRUint32 role = accessible->Role();
-    if (role == nsIAccessibleRole::ROLE_PROPERTYPAGE ||
-        role == nsIAccessibleRole::ROLE_PANE) {
+    roles::Role role = accessible->Role();
+    if (role == roles::PROPERTYPAGE || role == roles::PANE)
       break;
-    }
 
     nsIFrame* frame = accessible->GetFrame();
     if (!frame)
       return vstates;
 
     const nsIView* view = frame->GetView();
     if (view && view->GetVisibility() == nsViewVisibility_kHide)
       return vstates;
--- a/accessible/src/base/nsDocAccessible.h
+++ b/accessible/src/base/nsDocAccessible.h
@@ -204,19 +204,19 @@ public:
    */
   nsresult FireDelayedAccessibleEvent(AccEvent* aEvent);
 
   /**
    * Fire value change event on the given accessible if applicable.
    */
   inline void MaybeNotifyOfValueChange(nsAccessible* aAccessible)
   {
-    PRUint32 role = aAccessible->Role();
-    if (role == nsIAccessibleRole::ROLE_ENTRY ||
-        role == nsIAccessibleRole::ROLE_COMBOBOX) {
+    mozilla::a11y::role role = aAccessible->Role();
+    if (role == mozilla::a11y::roles::ENTRY ||
+        role == mozilla::a11y::roles::COMBOBOX) {
       nsRefPtr<AccEvent> valueChangeEvent =
         new AccEvent(nsIAccessibleEvent::EVENT_VALUE_CHANGE, aAccessible,
                      eAutoDetect, AccEvent::eRemoveDupes);
       FireDelayedAccessibleEvent(valueChangeEvent);
     }
   }
 
   /**
--- a/accessible/src/mac/mozAccessible.h
+++ b/accessible/src/mac/mozAccessible.h
@@ -67,17 +67,17 @@
    * in |expire|, and prevent any potential harm that could come from someone using us
    * after this point.
    */
   BOOL mIsExpired;
   
   /**
    * The nsIAccessible role of our gecko accessible.
    */
-  PRUint32        mRole;
+  mozilla::a11y::role        mRole;
 }
 
 // inits with the gecko owner.
 - (id)initWithAccessible:(nsAccessibleWrap*)geckoParent;
 
 // our accessible parent (AXParent)
 - (id <mozAccessible>)parent;
 
--- a/accessible/src/mac/mozAccessible.mm
+++ b/accessible/src/mac/mozAccessible.mm
@@ -249,18 +249,17 @@ GetLocalizedString(const nsString& aStri
     return [self position];
   if ([attribute isEqualToString:NSAccessibilitySubroleAttribute])
     return [self subrole];
   if ([attribute isEqualToString:NSAccessibilityEnabledAttribute])
     return [NSNumber numberWithBool:[self isEnabled]];
   if ([attribute isEqualToString:NSAccessibilityValueAttribute])
     return [self value];
   if ([attribute isEqualToString:NSAccessibilityRoleDescriptionAttribute]) {
-    if ((mRole == nsIAccessibleRole::ROLE_INTERNAL_FRAME) 
-        || (mRole == nsIAccessibleRole::ROLE_DOCUMENT_FRAME))
+    if (mRole == roles::INTERNAL_FRAME || mRole == roles::DOCUMENT_FRAME)
       return GetLocalizedString(NS_LITERAL_STRING("htmlContent")) ? : @"HTML Content";
 
     return NSAccessibilityRoleDescription([self role], nil);
   }
   
   if ([attribute isEqualToString:NSAccessibilityDescriptionAttribute])
     return [self customDescription];
   if ([attribute isEqualToString:NSAccessibilityFocusedAttribute])