Re: Firefox 4 beta 8 -> get_accChild() returns E_INVALIDARG
David Bolter <[email protected]> Mon, 10 Jan 2011 09:47:01 -0500
| Newsgroups | gmane.comp.mozilla.accessibility |
|---|---|
| Message-ID | <[email protected]> |
Hi Sylvain, I'd like to help. Can you provide me with your test case? Feel free to contact me off-list if appropriate. Cheers, David On 10/01/11 9:08 AM, Sylvain wrote: > Hi all, > > This code was OK on beta 6, but fails on beta 8 (not tested on beta > 7). This code simply tries to get the first child of an object: > > hr=AccessibleObjectFromWindow(w,(DWORD)OBJID_CLIENT,IID_IAccessible, > (void**)&pTopAccessible); > hr=pTopAccessible->accNavigate(0x1009,vtStart,&vtResult); // > NAVRELATION_EMBEDS = 0x1009 > pIDispatch=(IDispatch*)vtResult.lVal; > hr=pIDispatch->QueryInterface(IID_IAccessible, (void**)&pAccessible); > hr=pAccessible->get_accChildCount(&lCount); > // ==> value of lCount is 6 in my example > vtChild.vt=VT_I4; > vtChild.lVal=1; > hr=pAccessible->get_accChild(vtChild,&pIDispatch); => hr=S_OK > ... > vtChild.lVal=6; > hr=pAccessible->get_accChild(vtChild,&pIDispatch); => hr=E_INVALIDARG! > > Do you have an idea? Not sure, but I guess there is a bug in the > Firefox code: I suppose there is a test like this in the > get_accChild() method: > if (vtChild.lVal>= lCount) return E_INVALIDARG; // where lCount is > the number of childs. > As the childs are 1 based and not 0 based, the right code should be: > if (vtChild.lVal> lCount) return E_INVALIDARG; // where lCount is the > number of childs. > > Thanks! > > Sylvain > _______________________________________________ > dev-accessibility mailing list > [email protected] > https://lists.mozilla.org/listinfo/dev-accessibility