Bug 1422201 changed GetIAccessibleFor so it only handles remote ids when called on the root accessible.
However, this breaks webextension popup documents.
These popups have their own HWND, so the root accessible of that HWND needs to handle accChild for ids in remote documents within that HWND.
Therefore, expand the restriction to cover the root accessible of any HWND, not just the main HWND.
MozReview-Commit-ID: 69v4XSeQLcS
--HG--
extra : rebase_source : bf5c5e0a475424b2276800d1a10ab1a46c136bd6
In the next changeset we will remove the nsIDOMXULPopupElement interface, which
was only used to make sure that this role is set. There wasn't a test covering
this case yet, so this changeset adds one.
Note that we are using a mochitest-browser test as opposed to directly testing
markup like `<panel><richlistbox /></panel>` in a mochitest-chrome test so that
we'll actually be able to catch a regression if the markup for the awesomebar changes.
MozReview-Commit-ID: KGaxQZTDq69
--HG--
extra : rebase_source : 671b718fd010b5f6a2036a695d2c4c03c8b64654
Previously, in the parent process, we were treating positive child ids as remote unique ids.
This of course failed when searching remote documents and returned early.
Make sure we only treat ids as remote if they are less than 0.
Ids above 0 are child indices and are handled later in the code for both local and remote children.
MozReview-Commit-ID: 2KmFj6rTXTV
--HG--
extra : rebase_source : 273496a3f6420d184f71795095937638e1e3e2ca
Previously, we could return remote accessibles which weren't actually descendants of the accessible on which accChild was called.
For example, calling accChild on a local document with the id of a remote document would happily return the remote accessible.
This confused clients such as NVDA which use accChild to check whether something is a descendant of a document.
MozReview-Commit-ID: 8mJ4m6RC3r2
--HG--
extra : rebase_source : c56040d84e09c2b9ede94985cdd94606c27160a3
When querying text attributes, Gecko can return an end offset less than the requested offset in some rare cases, which isn't valid.
This is perhaps because the text mutated during the attribute fetching loop for some reason, making the requested offset invalid.
We now check the end offset and break out of the loop in this case.
This fixes a freeze after sending a message in OX Mail with NVDA.
MozReview-Commit-ID: 1lVSLAdOcS7
--HG--
extra : rebase_source : 048fbed8ddc591f62c17d559483bfe2f1542431c
Both Provider and Handler need to release the interfaces in StaticIA2Data.
Therefore, move this into a common function to avoid duplication pain in future.
MozReview-Commit-ID: 7J4iuvDa8m2
--HG--
extra : rebase_source : 98c97b51c27c318ba987787518cfd70bda8967d4
We need to clean up the VARIANT and BSTRs in DynamicIA2Data in the handler as well.
We do this in two places:
1. Before reading a new payload (because we need to clean up the existing payload); and
2. When we're being destroyed.
MozReview-Commit-ID: GvO7csuxtwZ
--HG--
extra : rebase_source : 92cc9a64deddee07bbbc77e53117c15351816778
DynamicIA2Data contains several BSTRs that need to be freed with SysFreeString.
Previously, we just did a ZeroMemory without actually freeing them.
This cleanup code is placed in a header file so it can be used by AccessibleHandler as well.
MozReview-Commit-ID: 4SWuK9oMRYZ
--HG--
extra : rebase_source : e7358752e7eee1bae000e4005832bfc48c9342af
If a client requests all text (via IAccessibleText::text with IA2_TEXT_OFFSET_LENGTH), it's quite likely they will want all other information about the text as well; i.e. embedded objects and attributes.
Therefore, fetch all of this using a single cross-process call.
The text is immediately returned to the client.
The hyperlinks and attributes are cached for later return to the client when they call the appropriate methods.
They are only cached for one call; i.e. after the client retrieves them, the cache is dropped.
This makes memory management simpler and lowers the risk of cache invalidation problems.
MozReview-Commit-ID: FgFkX8J7wg1
--HG--
extra : rebase_source : e521d6ca7b00fcf1aad1f0ada299bac4c4b85c50
This allows the handler to fetch all text information in a single cross-process call when appropriate.
Normally, it would be a minimum of 3 calls, plus one call for each additional attribute run.
MozReview-Commit-ID: K5x9bAWiWWJ
--HG--
extra : rebase_source : fbf89ff79d7afcff6bcc32ff940f9e06c1e7f136
We want to be able to cache data related to both IAccessibleText and IAccessibleHypertext2 in a single call.
This is difficult with the tearoff because separate instances of the tearoff get created for the two interfaces.
Ensuring we use the same instance means working around reference cycles.
We could maintain a separate cache object, but that makes things more complex.
Therefore, it's much simpler to get rid of the tearoff.
A few things to note:
1. ResolveAccHypertext has been renamed to ResolveIAHypertext for consistency with the rest of AccessibleHandler.
2. mAccHypertextProxy has been renamed to mIAHypertextPassThru for consistency with the rest of AccessibleHandler.
3. mIAHypertextPassThru is a weak reference (just like the rest of the passthru pointers) because it refers to a proxy interface and the proxy aggregates the handler.
Thus, we release it immediately to avoid reference cycles.
When it was a tearoff, this was not the case; it was a strong reference.
MozReview-Commit-ID: 8NwPA0T1MFX
--HG--
extra : rebase_source : 57c4d19516d01b820bb3b4c1a9974ff3b889ed64
As per the spec, if there are no hyperlinks, the hyperlinks array should be set to null and S_FALSE should be returned.
This saves pointless memory management when there are no hyperlinks.
MozReview-Commit-ID: 9wsiXBely6G
--HG--
extra : rebase_source : bc1f6b8a04205939b322393674414365fd89f39a
For elements such as divs which have no enumerated MSAA role, we return a string.
First, we try the ARIA role, and failing that, we use the tag name.
However, if the author specifies role="", we previously failed.
Instead, we now fall back to the tag name for an empty role string.
That is, we treat the non-existence of the attribute or an empty string value the same way.
Although this is invalid markup, it occurs in the wild, and accRole failing breaks handler caching.
Note that this patch also removes a check for msaaRole != ROLE_SYSTEM_CLIENT when getting a string role.
This check is now pointless because we've already returned earlier if msaaRole != USE_ROLE_STRING.
That is, msaaRole can only be USE_ROLE_STRING at this point.
MozReview-Commit-ID: 7PVvU5V2uO4
--HG--
extra : rebase_source : 7aa1baee31393291ed15e8d6687e6a2d576f858c
Previously, it was querying for IID_IAccessibleHypertext, but this is actually an IAccessibleHypertext2 pointer.
This meant we were crashing when trying to call an IAccessibleHypertext2 method.
This was a regression introduced in bug 1419362.
MozReview-Commit-ID: 7akjIfNuIh3
--HG--
extra : rebase_source : 18e126e3b47bc5a8f486870a285668a7f85e95c9
The base implementation of accFocus can't handle the case when a remote document has focus and just returns no focus (VT_EMPTY).
Override accFocus on the root accessible to try the accessible for the remote document in the active tab in this case.
This fixes focus loss with NVDA when dismissing the System menu.
MozReview-Commit-ID: 1jhAv08rDFU
--HG--
extra : rebase_source : 7381b397724f21ba894dc94a051996e5d96c642d
Key accessibility off of the tag name instead of the role attribute
and load styles in global.css instead of <resources>
MozReview-Commit-ID: Epv0rHHzbz0
--HG--
extra : rebase_source : 2239c8ccca8d899b4c4144faab7212f120f00e23