mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-07 18:04:46 +00:00
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:
parent
c6f55e903d
commit
50740cfde5
@ -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
|
||||
{
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user