Closed Bug 296405 Opened 19 years ago Closed 19 years ago

nsAccessible::GetLastChild broken

Categories

(Core :: Disability Access APIs, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: parente, Assigned: parente)

Details

(Keywords: access)

Attachments

(1 file, 2 obsolete files)

Using mozinspect, navigating to the last child returns the first child.
Attachment #185167 - Flags: review?(aaronleventhal)
Comment on attachment 185167 [details] [diff] [review]
Makes negative index last child index

// If aChildNum is out of ranger larger than numChildren, return null

- Nit: Spelling error on ranger

- Important: let's change the documentation for this method in
nsIAccessible.idl to reflect/clarify the new interface rules.
Attachment #185167 - Flags: review?(aaronleventhal) → review-
Attachment #185167 - Attachment is obsolete: true
Attachment #185185 - Flags: review?(aaronleventhal)
Attachment #185185 - Flags: review?(aaronleventhal) → review+
Attachment #185185 - Flags: superreview?(neil.parkwaycc.co.uk)
Comment on attachment 185185 [details] [diff] [review]
GetChildAt supports negative index (public and src)

>+  // If aChildNum is out of range larger than numChildren, return null
>   if (aChildNum >= numChildren || !mWeakShell) {
>     *aChild = nsnull;
>     return NS_ERROR_FAILURE;
>+  // If aChildNum is out of range less than zero, set aChild to last index
>+  } else if (aChildNum < 0) {
>+    aChildNum = numChildren - 1;
What if there are no children?

I'm not sure that the "out of range" phrases are necessary.
Attachment #185185 - Attachment is obsolete: true
Attachment #185197 - Flags: superreview?(neil.parkwaycc.co.uk)
Attachment #185185 - Flags: superreview?(neil.parkwaycc.co.uk)
Attachment #185197 - Flags: superreview?(neil.parkwaycc.co.uk) → superreview+
Attachment #185197 - Flags: approval1.8b3?
Attachment #185197 - Flags: approval1.8b3? → approval1.8b3+
Checking in accessible/public/nsIAccessible.idl;
/cvsroot/mozilla/accessible/public/nsIAccessible.idl,v  <--  nsIAccessible.idl
new revision: 1.41; previous revision: 1.40
done
Checking in accessible/src/base/nsAccessible.cpp;
/cvsroot/mozilla/accessible/src/base/nsAccessible.cpp,v  <--  nsAccessible.cpp
new revision: 1.154; previous revision: 1.153
done
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: