зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1790317 part 1: Make LocalAccessible::ID return 0 for the document. r=eeejay
For IPC, we use id 0 to refer to the document. However, LocalAccessible::UniqueID doesn't return 0 for documents. This meant that when sending IPC messages, we hitherto had to special case the document in each case. We don't want to mess with LocalAccessible::UniqueID, but since Accessible::ID was only introduced recently, we can set new expectations there. Thus, this patch changes LocalAccessible::ID to return 0 for documents. This means that in future, we can just use Accessible::ID when sending IPC messages. nsAccUtils::GetAccessibleByID has also been updated to handle this. Differential Revision: https://phabricator.services.mozilla.com/D157081
This commit is contained in:
Родитель
1d51c801d1
Коммит
cbf1bc1704
|
@ -473,6 +473,10 @@ Accessible* nsAccUtils::GetAccessibleByID(Accessible* aDoc, uint64_t aID) {
|
|||
}
|
||||
if (LocalAccessible* localAcc = aDoc->AsLocal()) {
|
||||
if (DocAccessible* doc = localAcc->AsDoc()) {
|
||||
if (!aID) {
|
||||
// GetAccessibleByUniqueID doesn't treat 0 as the document.
|
||||
return aDoc;
|
||||
}
|
||||
return doc->GetAccessibleByUniqueID(
|
||||
reinterpret_cast<void*>(static_cast<uintptr_t>(aID)));
|
||||
}
|
||||
|
|
|
@ -132,7 +132,7 @@ class LocalAccessible : public nsISupports, public Accessible {
|
|||
void* UniqueID() { return static_cast<void*>(this); }
|
||||
|
||||
virtual uint64_t ID() const override {
|
||||
return reinterpret_cast<uintptr_t>(this);
|
||||
return IsDoc() ? 0 : reinterpret_cast<uintptr_t>(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче