зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1826858 - Eliminate LinkAt sync IPDL call. r=nlapre
No need for this. Differential Revision: https://phabricator.services.mozilla.com/D175291
This commit is contained in:
Родитель
d0f21eb1bc
Коммит
55ac968c09
|
@ -18,27 +18,16 @@ using namespace mozilla::a11y;
|
|||
extern "C" {
|
||||
|
||||
static AtkHyperlink* getLinkCB(AtkHypertext* aText, gint aLinkIndex) {
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
AtkObject* atkHyperLink = nullptr;
|
||||
if (accWrap) {
|
||||
HyperTextAccessible* hyperText = accWrap->AsHyperText();
|
||||
NS_ENSURE_TRUE(hyperText, nullptr);
|
||||
|
||||
LocalAccessible* hyperLink = hyperText->LinkAt(aLinkIndex);
|
||||
if (!hyperLink || !hyperLink->IsLink()) {
|
||||
return nullptr;
|
||||
if (Accessible* acc = GetInternalObj(ATK_OBJECT(aText))) {
|
||||
if (HyperTextAccessibleBase* hyperText = acc->AsHyperTextBase()) {
|
||||
Accessible* linkAcc = hyperText->LinkAt(aLinkIndex);
|
||||
AtkObject* atkHyperLink = GetWrapperFor(linkAcc);
|
||||
NS_ENSURE_TRUE(IS_MAI_OBJECT(atkHyperLink), nullptr);
|
||||
return MAI_ATK_OBJECT(atkHyperLink)->GetAtkHyperlink();
|
||||
}
|
||||
|
||||
atkHyperLink = AccessibleWrap::GetAtkObject(hyperLink);
|
||||
} else if (RemoteAccessible* proxy = GetProxy(ATK_OBJECT(aText))) {
|
||||
RemoteAccessible* proxyLink = proxy->LinkAt(aLinkIndex);
|
||||
if (!proxyLink) return nullptr;
|
||||
|
||||
atkHyperLink = GetWrapperFor(proxyLink);
|
||||
}
|
||||
|
||||
NS_ENSURE_TRUE(IS_MAI_OBJECT(atkHyperLink), nullptr);
|
||||
return MAI_ATK_OBJECT(atkHyperLink)->GetAtkHyperlink();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static gint getLinkCountCB(AtkHypertext* aText) {
|
||||
|
|
|
@ -119,8 +119,6 @@ RemoteAccessible* AnchorAt(uint32_t aIndex);
|
|||
|
||||
uint32_t LinkCount();
|
||||
|
||||
RemoteAccessible* LinkAt(const uint32_t& aIndex);
|
||||
|
||||
RemoteAccessible* TableOfACell();
|
||||
|
||||
uint32_t ColIdx();
|
||||
|
|
|
@ -680,24 +680,6 @@ mozilla::ipc::IPCResult DocAccessibleChild::RecvLinkCount(const uint64_t& aID,
|
|||
return IPC_OK();
|
||||
}
|
||||
|
||||
mozilla::ipc::IPCResult DocAccessibleChild::RecvLinkAt(const uint64_t& aID,
|
||||
const uint32_t& aIndex,
|
||||
uint64_t* aIDOfLink,
|
||||
bool* aOk) {
|
||||
*aIDOfLink = 0;
|
||||
*aOk = false;
|
||||
HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
|
||||
if (acc) {
|
||||
LocalAccessible* link = acc->LinkAt(aIndex);
|
||||
if (link) {
|
||||
*aIDOfLink = reinterpret_cast<uint64_t>(link->UniqueID());
|
||||
*aOk = true;
|
||||
}
|
||||
}
|
||||
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
mozilla::ipc::IPCResult DocAccessibleChild::RecvLinkIndexAtOffset(
|
||||
const uint64_t& aID, const uint32_t& aOffset, int32_t* aIndex) {
|
||||
HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
|
||||
|
|
|
@ -237,11 +237,6 @@ class DocAccessibleChild : public DocAccessibleChildBase {
|
|||
virtual mozilla::ipc::IPCResult RecvLinkCount(const uint64_t& aID,
|
||||
uint32_t* aCount) override;
|
||||
|
||||
virtual mozilla::ipc::IPCResult RecvLinkAt(const uint64_t& aID,
|
||||
const uint32_t& aIndex,
|
||||
uint64_t* aIDOfLink,
|
||||
bool* aOk) override;
|
||||
|
||||
virtual mozilla::ipc::IPCResult RecvLinkIndexAtOffset(
|
||||
const uint64_t& aID, const uint32_t& aOffset, int32_t* aIndex) override;
|
||||
|
||||
|
|
|
@ -246,7 +246,6 @@ child:
|
|||
[Nested=inside_sync] sync AnchorAt(uint64_t aID, uint32_t aIndex) returns(uint64_t aIDOfAnchor, bool aOk);
|
||||
|
||||
[Nested=inside_sync] sync LinkCount(uint64_t aID) returns(uint32_t aCount);
|
||||
[Nested=inside_sync] sync LinkAt(uint64_t aID, uint32_t aIndex) returns(uint64_t aIDOfLink, bool aOk);
|
||||
[Nested=inside_sync] sync LinkIndexAtOffset(uint64_t aID, uint32_t aOffset) returns(int32_t aIndex);
|
||||
|
||||
[Nested=inside_sync] sync TableOfACell(uint64_t aID) returns(uint64_t aTableID, bool aOk);
|
||||
|
|
|
@ -458,13 +458,6 @@ uint32_t RemoteAccessible::LinkCount() {
|
|||
return retVal;
|
||||
}
|
||||
|
||||
RemoteAccessible* RemoteAccessible::LinkAt(const uint32_t& aIndex) {
|
||||
uint64_t linkID = 0;
|
||||
bool ok = false;
|
||||
Unused << mDoc->SendLinkAt(mID, aIndex, &linkID, &ok);
|
||||
return ok ? mDoc->GetAccessible(linkID) : nullptr;
|
||||
}
|
||||
|
||||
int32_t RemoteAccessible::LinkIndexAtOffset(uint32_t aOffset) {
|
||||
if (StaticPrefs::accessibility_cache_enabled_AtStartup()) {
|
||||
return RemoteAccessibleBase<RemoteAccessible>::LinkIndexAtOffset(aOffset);
|
||||
|
|
Загрузка…
Ссылка в новой задаче