Bug 1635722 - Check node ipc docs before sending pivot boundaries. r=Jamie

The IPC docs of the first/last nodes are not guaranteed to exist. This
could happen early on when the child docs are still hanging and have not
yet been processed in the NotificationController.

Differential Revision: https://phabricator.services.mozilla.com/D81883
This commit is contained in:
Eitan Isaacson 2020-07-01 23:09:51 +00:00
Родитель aff7d7822c
Коммит 080acfd067
1 изменённых файлов: 10 добавлений и 3 удалений

Просмотреть файл

@ -165,9 +165,16 @@ void DocAccessibleWrap::CacheViewportCallback(nsITimer* aTimer,
// If first/last are null, pass the root document as pivot boundary.
if (IPCAccessibilityActive()) {
DocAccessibleChild* ipcDoc = docAcc->IPCDoc();
ipcDoc->GetPlatformExtension()->SendSetPivotBoundaries(
first ? first->Document()->IPCDoc() : ipcDoc, UNIQUE_ID(first),
last ? last->Document()->IPCDoc() : ipcDoc, UNIQUE_ID(last));
DocAccessibleChild* firstDoc =
first ? first->Document()->IPCDoc() : ipcDoc;
DocAccessibleChild* lastDoc = last ? last->Document()->IPCDoc() : ipcDoc;
if (ipcDoc && firstDoc && lastDoc) {
// One or more of the documents may not have recieved an IPC doc yet.
// In that case, just throw away this update. We will get a new one soon
// enough.
ipcDoc->GetPlatformExtension()->SendSetPivotBoundaries(
firstDoc, UNIQUE_ID(first), lastDoc, UNIQUE_ID(last));
}
} else if (SessionAccessibility* sessionAcc =
SessionAccessibility::GetInstanceFor(docAcc)) {
sessionAcc->UpdateAccessibleFocusBoundaries(