diff --git a/accessible/ipc/DocAccessibleChild.cpp b/accessible/ipc/DocAccessibleChild.cpp index 14ada99e47b..c23b6c64166 100644 --- a/accessible/ipc/DocAccessibleChild.cpp +++ b/accessible/ipc/DocAccessibleChild.cpp @@ -167,6 +167,18 @@ DocAccessibleChild::RecvValue(const uint64_t& aID, nsString* aValue) return true; } +bool +DocAccessibleChild::RecvHelp(const uint64_t& aID, nsString* aHelp) +{ + Accessible* acc = IdToAccessible(aID); + if (!acc) { + return true; + } + + acc->Help(*aHelp); + return true; +} + bool DocAccessibleChild::RecvDescription(const uint64_t& aID, nsString* aDesc) { diff --git a/accessible/ipc/DocAccessibleChild.h b/accessible/ipc/DocAccessibleChild.h index 4525776a795..d9cc9421e3a 100644 --- a/accessible/ipc/DocAccessibleChild.h +++ b/accessible/ipc/DocAccessibleChild.h @@ -70,6 +70,8 @@ public: virtual bool RecvValue(const uint64_t& aID, nsString* aValue) override; + virtual bool RecvHelp(const uint64_t& aID, nsString* aHelp) override; + /* * Get the description for the accessible with given id. */ diff --git a/accessible/ipc/PDocAccessible.ipdl b/accessible/ipc/PDocAccessible.ipdl index e2e1ebb14e8..b93c057c2ff 100644 --- a/accessible/ipc/PDocAccessible.ipdl +++ b/accessible/ipc/PDocAccessible.ipdl @@ -75,6 +75,7 @@ child: prio(high) sync State(uint64_t aID) returns(uint64_t states); prio(high) sync Name(uint64_t aID) returns(nsString name); prio(high) sync Value(uint64_t aID) returns(nsString value); + prio(high) sync Help(uint64_t aID) returns(nsString help); prio(high) sync Description(uint64_t aID) returns(nsString desc); prio(high) sync Attributes(uint64_t aID) returns(Attribute[] attributes); prio(high) sync RelationByType(uint64_t aID, uint32_t aRelationType) diff --git a/accessible/ipc/ProxyAccessible.cpp b/accessible/ipc/ProxyAccessible.cpp index 0fd852ae8d2..818e0a8ed38 100644 --- a/accessible/ipc/ProxyAccessible.cpp +++ b/accessible/ipc/ProxyAccessible.cpp @@ -95,6 +95,12 @@ ProxyAccessible::Value(nsString& aValue) const unused << mDoc->SendValue(mID, &aValue); } +void +ProxyAccessible::Help(nsString& aHelp) const +{ + unused << mDoc->SendHelp(mID, &aHelp); +} + void ProxyAccessible::Description(nsString& aDesc) const { diff --git a/accessible/ipc/ProxyAccessible.h b/accessible/ipc/ProxyAccessible.h index 5d4191a8c0a..62aa50fc722 100644 --- a/accessible/ipc/ProxyAccessible.h +++ b/accessible/ipc/ProxyAccessible.h @@ -89,6 +89,11 @@ public: */ void Value(nsString& aValue) const; + /* + * Set aHelp to the help string of the proxied accessible. + */ + void Help(nsString& aHelp) const; + /** * Set aDesc to the description of the proxied accessible. */ diff --git a/accessible/mac/mozAccessible.mm b/accessible/mac/mozAccessible.mm index 73b7aaf4bb4..d25d0a2d69d 100644 --- a/accessible/mac/mozAccessible.mm +++ b/accessible/mac/mozAccessible.mm @@ -1156,7 +1156,11 @@ struct RoleDescrComparator NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL; nsAutoString title; - [self getGeckoAccessible]->Name(title); + if (AccessibleWrap* accWrap = [self getGeckoAccessible]) + accWrap->Name(title); + else if (ProxyAccessible* proxy = [self getProxyAccessible]) + proxy->Name(title); + return nsCocoaUtils::ToNSString(title); NS_OBJC_END_TRY_ABORT_BLOCK_NIL; @@ -1167,7 +1171,11 @@ struct RoleDescrComparator NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL; nsAutoString value; - [self getGeckoAccessible]->Value(value); + if (AccessibleWrap* accWrap = [self getGeckoAccessible]) + accWrap->Value(value); + else if (ProxyAccessible* proxy = [self getProxyAccessible]) + proxy->Value(value); + return nsCocoaUtils::ToNSString(value); NS_OBJC_END_TRY_ABORT_BLOCK_NIL; @@ -1213,7 +1221,11 @@ struct RoleDescrComparator NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL; nsAutoString helpText; - [self getGeckoAccessible]->Help(helpText); + if (AccessibleWrap* accWrap = [self getGeckoAccessible]) + accWrap->Help(helpText); + else if (ProxyAccessible* proxy = [self getProxyAccessible]) + proxy->Help(helpText); + return nsCocoaUtils::ToNSString(helpText); NS_OBJC_END_TRY_ABORT_BLOCK_NIL; @@ -1259,8 +1271,13 @@ struct RoleDescrComparator - (BOOL)isEnabled { - AccessibleWrap* accWrap = [self getGeckoAccessible]; - return accWrap && ((accWrap->InteractiveState() & states::UNAVAILABLE) == 0); + if (AccessibleWrap* accWrap = [self getGeckoAccessible]) + return ((accWrap->InteractiveState() & states::UNAVAILABLE) == 0); + + if (ProxyAccessible* proxy = [self getProxyAccessible]) + return ((proxy->State() & states::UNAVAILABLE) == 0); + + return false; } // The root accessible calls this when the focused node was @@ -1338,7 +1355,7 @@ struct RoleDescrComparator - (BOOL)isExpired { - return ![self getGeckoAccessible]; + return ![self getGeckoAccessible] && ![self getProxyAccessible]; } #pragma mark -