Bug 403262. nsIAccessible::groupPositioN() does not expose the proper number of similar items in group. r=surkov, a=mtschrep
authoraaronleventhal@moonset.net
Mon, 12 Nov 2007 19:03:29 -0800
changeset 7888 cb33f1c7d8509631d3566011bdfe14fb2290bb0d
parent 7887 28f6a94edb58e37960b90eecd1b5c34fafc09c41
child 7889 ba283792af2cdb8a0f9eed15e05a9515968a1bdd
push idunknown
push userunknown
push dateunknown
reviewerssurkov, mtschrep
bugs403262
milestone1.9b2pre
Bug 403262. nsIAccessible::groupPositioN() does not expose the proper number of similar items in group. r=surkov, a=mtschrep
accessible/public/nsIAccessible.idl
accessible/src/base/nsAccessible.cpp
--- a/accessible/public/nsIAccessible.idl
+++ b/accessible/public/nsIAccessible.idl
@@ -181,17 +181,18 @@ interface nsIAccessible : nsISupports
    */
   readonly attribute nsIPersistentProperties attributes;
 
   /**
    * Returns grouping information. Used for tree items, list items, tab panel
    * labels, radio buttons, etc. Also used for collectons of non-text objects.
    *
    * @param groupLevel - 1-based, similar to ARIA 'level' property
-   * @param similarItemsInGroup - 1-based, similar to ARIA 'setsize' property
+   * @param similarItemsInGroup - 1-based, similar to ARIA 'setsize' property,
+   *                              inclusive of the current item
    * @param positionInGroup - 1-based, similar to ARIA 'posinset' property
    */
   void groupPosition(out long aGroupLevel, out long aSimilarItemsInGroup,
                      out long aPositionInGroup);
 
   /**
    * Accessible child which contains the coordinate at (x, y) in screen pixels.
    * If the point is in the current accessible but not in a child, the
--- a/accessible/src/base/nsAccessible.cpp
+++ b/accessible/src/base/nsAccessible.cpp
@@ -2201,17 +2201,17 @@ nsAccessible::GroupPosition(PRInt32 *aGr
   nsAccUtils::GetAccGroupAttrs(attributes, &level, &posInSet, &setSize);
 
   if (!posInSet && !setSize)
     return NS_OK;
 
   *aGroupLevel = level;
 
   *aPositionInGroup = posInSet;
-  *aSimilarItemsInGroup = setSize - 1;
+  *aSimilarItemsInGroup = setSize;
 
   return NS_OK;
 }
 
 PRBool nsAccessible::MappedAttrState(nsIContent *aContent, PRUint32 *aStateInOut,
                                      nsStateMapEntry *aStateMapEntry)
 {
   // Return true if we should continue