Commit fe28a3ec authored by Trevor Saunders's avatar Trevor Saunders
Browse files

bug 671926 - dexpcom GetNumActions() r=surkov

parent f2f032e2
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -409,11 +409,8 @@ nsAccessibleWrap::CreateMaiInterfaces(void)
    interfacesBits |= 1 << MAI_INTERFACE_COMPONENT;

  // Add Action interface if the action count is more than zero.
    PRUint8 actionCount = 0;
    nsresult rv = GetNumActions(&actionCount);
    if (NS_SUCCEEDED(rv) && actionCount > 0) {
  if (ActionCount() > 0)
    interfacesBits |= 1 << MAI_INTERFACE_ACTION;
    }

    //nsIAccessibleText
    nsCOMPtr<nsIAccessibleText> accessInterfaceText;
+2 −7
Original line number Diff line number Diff line
@@ -74,12 +74,7 @@ gint
getActionCountCB(AtkAction *aAction)
{
  nsAccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aAction));
    if (!accWrap)
        return 0;

    PRUint8 num = 0;
    nsresult rv = accWrap->GetNumActions(&num);
    return (NS_FAILED(rv)) ? 0 : static_cast<gint>(num);
  return accWrap ? accWrap->ActionCount() : 0;
}

const gchar *
+10 −9
Original line number Diff line number Diff line
@@ -1849,20 +1849,21 @@ nsAccessible::NativeRole()

// readonly attribute PRUint8 numActions
NS_IMETHODIMP
nsAccessible::GetNumActions(PRUint8 *aNumActions)
nsAccessible::GetNumActions(PRUint8* aActionCount)
{
  NS_ENSURE_ARG_POINTER(aNumActions);
  *aNumActions = 0;

  NS_ENSURE_ARG_POINTER(aActionCount);
  *aActionCount = 0;
  if (IsDefunct())
    return NS_ERROR_FAILURE;

  PRUint32 actionRule = GetActionRule(State());
  if (actionRule == eNoAction)
  *aActionCount = ActionCount();
  return NS_OK;
}

  *aNumActions = 1;
  return NS_OK;
PRUint8
nsAccessible::ActionCount()
{
  return GetActionRule(State()) == eNoAction ? 0 : 1;
}

/* DOMString getAccActionName (in PRUint8 index); */
+6 −1
Original line number Diff line number Diff line
@@ -418,6 +418,11 @@ public:
  //////////////////////////////////////////////////////////////////////////////
  // ActionAccessible

  /**
   * Return the number of actions that can be performed on this accessible.
   */
  virtual PRUint8 ActionCount();

  /**
   * Return access key, such as Alt+D.
   */
@@ -676,7 +681,7 @@ protected:

  /**
   * Return the action rule based on ARIA enum constants EActionRule
   * (see nsARIAMap.h). Used by GetNumActions() and GetActionName().
   * (see nsARIAMap.h). Used by ActionCount() and GetActionName().
   *
   * @param aStates  [in] states of the accessible
   */
+3 −5
Original line number Diff line number Diff line
@@ -237,12 +237,10 @@ nsApplicationAccessible::TakeFocus()
  return NS_OK;
}

NS_IMETHODIMP
nsApplicationAccessible::GetNumActions(PRUint8 *aNumActions)
PRUint8
nsApplicationAccessible::ActionCount()
{
  NS_ENSURE_ARG_POINTER(aNumActions);
  *aNumActions = 0;
  return NS_OK;
  return 0;
}

NS_IMETHODIMP
Loading