mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 1164976 - Make DocAccessibleParent::GetAccessible return itself when appropriate r=davidb
This commit is contained in:
parent
51d2c1b7ac
commit
f48235cf49
@ -23,14 +23,7 @@ DocAccessibleParent::RecvShowEvent(const ShowEventData& aData)
|
||||
return false;
|
||||
}
|
||||
|
||||
ProxyAccessible* parent = nullptr;
|
||||
if (aData.ID()) {
|
||||
ProxyEntry* e = mAccessibles.GetEntry(aData.ID());
|
||||
if (e)
|
||||
parent = e->mProxy;
|
||||
} else {
|
||||
parent = this;
|
||||
}
|
||||
ProxyAccessible* parent = GetAccessible(aData.ID());
|
||||
|
||||
// XXX This should really never happen, but sometimes we fail to fire the
|
||||
// required show events.
|
||||
@ -123,18 +116,13 @@ DocAccessibleParent::RecvHideEvent(const uint64_t& aRootID)
|
||||
bool
|
||||
DocAccessibleParent::RecvEvent(const uint64_t& aID, const uint32_t& aEventType)
|
||||
{
|
||||
if (!aID) {
|
||||
ProxyEvent(this, aEventType);
|
||||
return true;
|
||||
}
|
||||
|
||||
ProxyEntry* e = mAccessibles.GetEntry(aID);
|
||||
if (!e) {
|
||||
ProxyAccessible* proxy = GetAccessible(aID);
|
||||
if (!proxy) {
|
||||
NS_ERROR("no proxy for event!");
|
||||
return true;
|
||||
}
|
||||
|
||||
ProxyEvent(e->mProxy, aEventType);
|
||||
ProxyEvent(proxy, aEventType);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -94,12 +94,18 @@ public:
|
||||
/**
|
||||
* Return the accessible for given id.
|
||||
*/
|
||||
ProxyAccessible* GetAccessible(uintptr_t aID) const
|
||||
ProxyAccessible* GetAccessible(uintptr_t aID)
|
||||
{
|
||||
if (!aID)
|
||||
return this;
|
||||
|
||||
ProxyEntry* e = mAccessibles.GetEntry(aID);
|
||||
return e ? e->mProxy : nullptr;
|
||||
}
|
||||
|
||||
const ProxyAccessible* GetAccessible(uintptr_t aID) const
|
||||
{ return const_cast<DocAccessibleParent*>(this)->GetAccessible(aID); }
|
||||
|
||||
private:
|
||||
|
||||
class ProxyEntry : public PLDHashEntryHdr
|
||||
|
Loading…
Reference in New Issue
Block a user