Bug 1422674: Fix IAccessible::accChild on parent process accessibles with positive indices. r=MarcoZ

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
This commit is contained in:
James Teh 2017-12-06 10:11:17 +10:00
Родитель efadeeed26
Коммит 63f0dbc751
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -1480,7 +1480,10 @@ AccessibleWrap::GetIAccessibleFor(const VARIANT& aVarChild, bool* aIsDefunct)
// accessible is part of the chrome process and is part of the xul browser
// window and the child id points in the content documents. Thus we need to
// make sure that it is never called on proxies.
if (XRE_IsParentProcess() && !IsProxy() && !sIDGen.IsChromeID(varChild.lVal)) {
// Bug 1422674: We must only handle remote ids here (< 0), not child indices.
// Child indices (> 0) are handled below for both local and remote children.
if (XRE_IsParentProcess() && !IsProxy() &&
varChild.lVal < 0 && !sIDGen.IsChromeID(varChild.lVal)) {
if (!IsRoot()) {
// Bug 1422201: accChild with a remote id is only valid on the root accessible.
// Otherwise, we might return remote accessibles which aren't descendants