I got help from a Firefox dev team working on accessibility to resolve this issue in my initial tests atleast.
It turns out that Firefox does not natively support Microsoft UIA, it however does support Microsoft MSAA which is an older accessibility framework. Thus Firefox relies on an MSAA Proxy for supporting UIA, this proxy consumes MSAA information and provides it to requests via UIA API.
The runtimeId(unique id for elements) generation in MSAA and its compatibility with UIA via proxy is not well documented as far as the Firefox dev team knows. This might cause the above problem when using UIA for tree traversal.
The Firefox team indicated that adding a boolean preference to about:config in Firefox will provide limited and experimental support to UIA and runtimeids should be in that limited support.
I added this value in about:config and was able to get positive
results in the preliminary tests that I performed
.
To add this value to Firefox config.
Start a Firefox instance
Type "about:config" in the address bar
Once the config screen is shown, Right Click+New+Boolean.
Add a preference called "accessibility.uia.enable" and make sure the
value is "true"