diff --git a/accessible/ipc/ProxyAccessibleShared.h b/accessible/ipc/ProxyAccessibleShared.h index 8ce19fc414fee..e035edef71e9e 100644 --- a/accessible/ipc/ProxyAccessibleShared.h +++ b/accessible/ipc/ProxyAccessibleShared.h @@ -65,7 +65,7 @@ nsAtom* LandmarkRole() const; nsStaticAtom* ARIARoleAtom() const; -int32_t GetLevelInternal(); +mozilla::a11y::GroupPos GroupPosition(); void ScrollTo(uint32_t aScrollType); void ScrollToPoint(uint32_t aScrollType, int32_t aX, int32_t aY); diff --git a/accessible/ipc/other/DocAccessibleChild.cpp b/accessible/ipc/other/DocAccessibleChild.cpp index 4b7bf424c5cc2..25bf68da4e0ca 100644 --- a/accessible/ipc/other/DocAccessibleChild.cpp +++ b/accessible/ipc/other/DocAccessibleChild.cpp @@ -234,12 +234,17 @@ mozilla::ipc::IPCResult DocAccessibleChild::RecvARIARoleAtom( return IPC_OK(); } -mozilla::ipc::IPCResult DocAccessibleChild::RecvGetLevelInternal( - const uint64_t& aID, int32_t* aLevel) { +mozilla::ipc::IPCResult DocAccessibleChild::RecvGroupPosition( + const uint64_t& aID, int32_t* aLevel, int32_t* aSimilarItemsInGroup, + int32_t* aPositionInGroup) { Accessible* acc = IdToAccessible(aID); if (acc) { - *aLevel = acc->GetLevelInternal(); + GroupPos groupPos = acc->GroupPosition(); + *aLevel = groupPos.level; + *aSimilarItemsInGroup = groupPos.setSize; + *aPositionInGroup = groupPos.posInSet; } + return IPC_OK(); } diff --git a/accessible/ipc/other/DocAccessibleChild.h b/accessible/ipc/other/DocAccessibleChild.h index 9476dd2868d49..719412053dccb 100644 --- a/accessible/ipc/other/DocAccessibleChild.h +++ b/accessible/ipc/other/DocAccessibleChild.h @@ -84,8 +84,9 @@ class DocAccessibleChild : public DocAccessibleChildBase { virtual mozilla::ipc::IPCResult RecvARIARoleAtom(const uint64_t& aID, nsString* aRole) override; - virtual mozilla::ipc::IPCResult RecvGetLevelInternal( - const uint64_t& aID, int32_t* aLevel) override; + virtual mozilla::ipc::IPCResult RecvGroupPosition( + const uint64_t& aID, int32_t* aLevel, int32_t* aSimilarItemsInGroup, + int32_t* aPositionInGroup) override; virtual mozilla::ipc::IPCResult RecvAttributes( const uint64_t& aID, nsTArray* aAttributes) override; diff --git a/accessible/ipc/other/PDocAccessible.ipdl b/accessible/ipc/other/PDocAccessible.ipdl index 26b7022c3f049..64becca903fd5 100644 --- a/accessible/ipc/other/PDocAccessible.ipdl +++ b/accessible/ipc/other/PDocAccessible.ipdl @@ -137,7 +137,8 @@ child: nested(inside_sync) sync IsSearchbox(uint64_t aID) returns(bool retval); nested(inside_sync) sync LandmarkRole(uint64_t aID) returns(nsString landmark); nested(inside_sync) sync ARIARoleAtom(uint64_t aID) returns(nsString ariaRole); - nested(inside_sync) sync GetLevelInternal(uint64_t aID) returns(int32_t aLevel); + nested(inside_sync) sync GroupPosition(uint64_t aID) + returns(int32_t groupLevel, int32_t similarItemsInGroup, int32_t positionInGroup); async ScrollTo(uint64_t aID, uint32_t aScrollType); async ScrollToPoint(uint64_t aID, uint32_t aScrollType, int32_t aX, int32_t aY); diff --git a/accessible/ipc/other/ProxyAccessible.cpp b/accessible/ipc/other/ProxyAccessible.cpp index 9361cf8303176..6f28370e64f86 100644 --- a/accessible/ipc/other/ProxyAccessible.cpp +++ b/accessible/ipc/other/ProxyAccessible.cpp @@ -112,10 +112,11 @@ nsStaticAtom* ProxyAccessible::ARIARoleAtom() const { return NS_GetStaticAtom(role); } -int32_t ProxyAccessible::GetLevelInternal() { - int32_t level = 0; - Unused << mDoc->SendGetLevelInternal(mID, &level); - return level; +GroupPos ProxyAccessible::GroupPosition() { + GroupPos groupPos; + Unused << mDoc->SendGroupPosition(mID, &groupPos.level, &groupPos.setSize, + &groupPos.posInSet); + return groupPos; } void ProxyAccessible::ScrollTo(uint32_t aScrollType) { diff --git a/accessible/mac/mozHTMLAccessible.mm b/accessible/mac/mozHTMLAccessible.mm index fae1679394ec5..59aeba636ba87 100644 --- a/accessible/mac/mozHTMLAccessible.mm +++ b/accessible/mac/mozHTMLAccessible.mm @@ -29,14 +29,14 @@ - (NSString*)title { } - (id)value { - uint32_t level = 0; + GroupPos groupPos; if (AccessibleWrap* accWrap = [self getGeckoAccessible]) { - level = accWrap->GetLevelInternal(); + groupPos = accWrap->GroupPosition(); } else if (ProxyAccessible* proxy = [self getProxyAccessible]) { - level = proxy->GetLevelInternal(); + groupPos = proxy->GroupPosition(); } - return [NSNumber numberWithInt:level]; + return [NSNumber numberWithInt:groupPos.level]; } @end diff --git a/accessible/xpcom/xpcAccessible.cpp b/accessible/xpcom/xpcAccessible.cpp index 28129489ac0f9..578ed6047e083 100644 --- a/accessible/xpcom/xpcAccessible.cpp +++ b/accessible/xpcom/xpcAccessible.cpp @@ -448,9 +448,12 @@ xpcAccessible::GroupPosition(int32_t* aGroupLevel, NS_ENSURE_ARG_POINTER(aPositionInGroup); *aPositionInGroup = 0; - if (!Intl()) return NS_ERROR_FAILURE; - - GroupPos groupPos = Intl()->GroupPosition(); + GroupPos groupPos; + if (Accessible* acc = IntlGeneric().AsAccessible()) { + groupPos = acc->GroupPosition(); + } else { + groupPos = IntlGeneric().AsProxy()->GroupPosition(); + } *aGroupLevel = groupPos.level; *aSimilarItemsInGroup = groupPos.setSize; diff --git a/ipc/ipdl/sync-messages.ini b/ipc/ipdl/sync-messages.ini index 799ed6f5bea8a..bbdc7a73b763c 100644 --- a/ipc/ipdl/sync-messages.ini +++ b/ipc/ipdl/sync-messages.ini @@ -280,8 +280,8 @@ platform = notwin [PDocAccessible::ARIARoleAtom] description = Legacy a11y IPC platform = notwin -[PDocAccessible::GetLevelInternal] -description = Legacy a11y IPC +[PDocAccessible::GroupPosition] +description = Legacy a11y IPC. Platform accessibility APIs need to query content synchronously for information. platform = notwin [PDocAccessible::CaretLineNumber] description = Legacy a11y IPC