Re: Firefox 56+ : IAccessible.accNavigate(NAVRELATION_EMBEDS) fails with 0x80004005 (E_FAIL)

James Teh <[email protected]> Wed, 29 Nov 2017 17:32:24 +1000
Newsgroups gmane.comp.mozilla.accessibility
Message-ID <[email protected]>
Were you setting the pref to force enable remote accessibility or to disable it? Those prefs are no longer necessary. Multi-process accessibility is now enabled by default. It'd be good if you can re-run these tests with a clean profile and no prefs changed.


Sent from a mobile device

> On 29 Nov 2017, at 5:25 pm, Sylvain Werdefroy <[email protected]> wrote:
> 
> Hi Jamie,
> 
> Thanks for the test case!
> 
> First of all: as my Firefox 58 was freshly reinstalled on my computer, the browser.tabs.remote.force-enable was not configured, that's why the test I ran yesterday failed... sorry for that.
> 
> Now here are the results:
> 
> Open Firefox and load example.com in the 1st tab:
> Window 0003086A
> accNavigate result -2147467259
> accNavigate result 0
> 
> Test passed!
> 
> But now try to open a 2nd tab, load example.com in this tab, close the 1st one, run the test case:
> Window 0003086A
> accNavigate result -2147467259
> accNavigate result -2147467259
> accNavigate result -2147467259
> accNavigate result -2147467259
> accNavigate result -2147467259
> 
> It seems to be a problem with multiple tabs... for example this test case always fails:
> 
> Open Firefox, open a 2nd tab, example.com in this tab, close the 1st one, run the test case:
> Window 000E08BE
> accNavigate result -2147467259
> accNavigate result -2147467259
> accNavigate result -2147467259
> accNavigate result -2147467259
> accNavigate result -2147467259
> 
> And this one fails randomly:
> 
> Open Firefox, open a 2nd tab, example.com in this tab, run the test case:
> 
> Sometimes it fails:
> Window 00120890
> accNavigate result -2147467259
> accNavigate result -2147467259
> accNavigate result -2147467259
> accNavigate result -2147467259
> accNavigate result -2147467259
> 
> Somtimes it succeeds:
> Window 00110338
> accNavigate result -2147467259
> accNavigate result 0
> 
> Please note my Firefox version has been upgraded, I now run a 58.0b7.
> 
> Sylvain
> 
>> On Wed, Nov 29, 2017 at 3:12 AM, James Teh <[email protected]> wrote:
>> Hi Sylvain,
>> 
>> I can't reproduce this in Windows 10 with Firefox 58b6 64 bit. I wrote my own complete test case so we can test with exactly the same code. It'd be great if you could compile the following C++ code. Then, start Firefox, load example.com and run the test case. Here's the code:
>> 
>> ---
>> 
>> // embeds.cpp: Test NAVRELATION_EMBEDS.
>> // Compile with:
>> //   cl /EHsc embeds.cpp user32.lib oleacc.lib ole32.lib oleaut32.lib
>> 
>> #include <windows.h>
>> #include <oleacc.h>
>> #include <iostream>
>> 
>> using namespace std;
>> 
>> // Tweak as needed to find the Firefox window.
>> // This title works if using a Firefox release
>> // with example.com loaded in the active tab.
>> const char WINDOW_TITLE[] = "Example Domain - Mozilla Firefox";
>> 
>> const long NAVRELATION_EMBEDS = 0x1009;
>> 
>> int main()
>> {
>>   CoInitialize(NULL);
>>   HWND window = FindWindow("MozillaWindowClass", WINDOW_TITLE);
>>   cout << "Window " << window << endl;
>>   if (!window) {
>>     cout << "Failed to get window" << endl;
>>     return 1;
>>   }
>>   IAccessible* rootAcc;
>>   HRESULT hr = AccessibleObjectFromWindow(window, OBJID_CLIENT,
>>     IID_IAccessible, (void**)&rootAcc);
>>   if (FAILED(hr)) {
>>     cout << "AccessibleObjectFromWindow failed with " << hr << endl;
>>     return 1;
>>   }
>>   VARIANT child;
>>   child.vt = VT_I4;
>>   child.lVal = CHILDID_SELF;
>>   VARIANT target;
>>   for (int i = 0; i < 5; ++i) {
>>     hr = rootAcc->accNavigate(NAVRELATION_EMBEDS, child, &target);
>>     cout << "accNavigate result " << hr << endl;
>>     if (hr == S_OK) {
>>       target.pdispVal->Release();
>>       break;
>>     }
>>     Sleep(1000);
>>   }
>>   rootAcc->Release();
>> }
>> 
>> ---
>> 
>> When I do this, I get the following:
>> 
>> Window 006F0AFE
>> accNavigate result -2147467259
>> accNavigate result 0
>> 
>> So, the first try fails, but the second succeeds.
>> 
>> Jamie
>> 
>>> On Wed, Nov 29, 2017 at 2:12 AM, <[email protected]> wrote:
>>> Hi Jamie,
>>> 
>>> Thanks for your answer. Unfortunately, this does not fix the problem, including when focusing the Firefox window before calling accNavigate().
>>> 
>>> Here is my source code:
>>> // w is the main Firefox window handle ("MozillaWindowClass")
>>> hr=AccessibleObjectFromWindow(w,(DWORD)OBJID_CLIENT,IID_IAccessible,(void**)&pAccessible);
>>> if (FAILED(hr)) { TRACE((TRACE_ERROR,_F_,"AccessibleObjectFromWindow(IID_IAccessible)=0x%08lx",hr)); goto end; }
>>> 
>>> for (int i=0;i<50;i++) // test every second
>>> {
>>>         hr=pAccessible->accNavigate(0x1009,vtMe,&vtResult); // NAVRELATION_EMBEDS = 0x1009
>>>         TRACE((TRACE_DEBUG,_F_,"accNavigate(NAVRELATION_EMBEDS)=0x%08lx",hr));
>>>         if (hr==S_OK) break;
>>>         Sleep(1000);
>>> }
>>> 
>>> And the result is:
>>> 28/11-16:36:55:949 accNavigate(NAVRELATION_EMBEDS)=0x80004005
>>> 28/11-16:36:56:955 accNavigate(NAVRELATION_EMBEDS)=0x80004005
>>> 28/11-16:36:57:959 accNavigate(NAVRELATION_EMBEDS)=0x80004005
>>> 28/11-16:36:58:965 accNavigate(NAVRELATION_EMBEDS)=0x80004005
>>> 28/11-16:36:59:969 accNavigate(NAVRELATION_EMBEDS)=0x80004005
>>> ...
>>> 
>>> My testing environment is Windows 10 (10.0.15063) and Firefox 58.0b6 (64 bits).
>>> 
>>> Thanks!
>>> 
>>> Sylvain
>>> _______________________________________________
>>> dev-accessibility mailing list
>>> [email protected]
>>> https://lists.mozilla.org/listinfo/dev-accessibility
>> 
>