Bug 1288843: Modify OuterDocAccessible so that ChildCount() and ChildAt(0) resolve RemoteChildDoc(); r=tbsaunde

MozReview-Commit-ID: EsayZhH2nY8

--HG--
extra : rebase_source : decda5eeeebab0ee899cd67d51b0490b54f8ca5f
This commit is contained in:
Aaron Klotz 2016-07-22 13:40:05 -06:00
parent c6f55e903d
commit 50740cfde5
2 changed files with 40 additions and 1 deletions

View File

@ -173,6 +173,40 @@ OuterDocAccessible::IsAcceptableChild(nsIContent* aEl) const
return false;
}
#if defined(XP_WIN)
// On Windows e10s, since we don't cache in the chrome process, these next two
// functions must be implemented so that we properly cross the chrome-to-content
// boundary when traversing.
uint32_t
OuterDocAccessible::ChildCount() const
{
uint32_t result = mChildren.Length();
if (!result && RemoteChildDoc()) {
result = 1;
}
return result;
}
Accessible*
OuterDocAccessible::GetChildAt(uint32_t aIndex) const
{
Accessible* result = AccessibleWrap::GetChildAt(aIndex);
if (result || aIndex) {
return result;
}
// If we are asking for child 0 and GetChildAt doesn't return anything, try
// to get the remote child doc and return that instead.
ProxyAccessible* remoteChild = RemoteChildDoc();
if (!remoteChild) {
return nullptr;
}
return WrapperFor(remoteChild);
}
#endif // defined(XP_WIN)
ProxyAccessible*
OuterDocAccessible::RemoteChildDoc() const
{

View File

@ -40,6 +40,11 @@ public:
virtual bool RemoveChild(Accessible* aAccessible) override;
virtual bool IsAcceptableChild(nsIContent* aEl) const override;
#if defined(XP_WIN)
virtual uint32_t ChildCount() const override;
virtual Accessible* GetChildAt(uint32_t aIndex) const override;
#endif // defined(XP_WIN)
protected:
virtual ~OuterDocAccessible() override;
};
@ -53,4 +58,4 @@ Accessible::AsOuterDoc()
} // namespace a11y
} // namespace mozilla
#endif
#endif