Commit a9e1bcbf authored by ginn.chen%sun.com's avatar ginn.chen%sun.com
Browse files

Bug 348007 Firefox will crash if use index = -1 to get top level

accessible
r= aaronleventhal
parent b1d2afd6
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -850,6 +850,11 @@ getChildCountCB(AtkObject *aAtkObj)
AtkObject *
refChildCB(AtkObject *aAtkObj, gint aChildIndex)
{
    // aChildIndex should not be less than zero
    if (aChildIndex < 0) {
      return nsnull;
    }

    // XXX Fix this so it is not O(n^2) to walk through the children!
    // Either we can cache the last accessed child so that we can just GetNextSibling()
    // or we should cache an array of children in each nsAccessible
+2 −0
Original line number Diff line number Diff line
@@ -626,6 +626,8 @@ NS_IMETHODIMP nsAppRootAccessible::GetChildAt(PRInt32 aChildNum,
    NS_ENSURE_SUCCESS(rv, rv);
    if (aChildNum >= NS_STATIC_CAST(PRInt32, count))
        return NS_ERROR_INVALID_ARG;
    if (aChildNum < 0)
        return NS_ERROR_INVALID_ARG;

    nsCOMPtr<nsIWeakReference> childWeakRef;
    rv = mChildren->QueryElementAt(aChildNum, NS_GET_IID(nsIWeakReference),