bug 1088148 - Notify the main process of new child docs after firing events r=davidb
If we notify the parent process about new child documents before we notify it of events it is possible the parent process's tree is out of sync with ours, and doesn't contain the outer doc accessible for the new document. SO we need to first notify the parent of changes in the accessible tree for the document, and then we can notify it of new child documents. We must also make sure when we serialize a subtree that is being created to not include the sub document or its accessible tree.
This commit is contained in:
@@ -220,15 +220,6 @@ NotificationController::WillRefresh(mozilla::TimeStamp aTime)
|
||||
Accessible* outerDocAcc = mDocument->GetAccessible(ownerContent);
|
||||
if (outerDocAcc && outerDocAcc->AppendChild(childDoc)) {
|
||||
if (mDocument->AppendChildDocument(childDoc)) {
|
||||
if (IPCAccessibilityActive()) {
|
||||
DocAccessibleChild* ipcDoc = new DocAccessibleChild(childDoc);
|
||||
childDoc->SetIPCDoc(ipcDoc);
|
||||
auto contentChild = dom::ContentChild::GetSingleton();
|
||||
DocAccessibleChild* parentIPCDoc = mDocument->IPCDoc();
|
||||
uint64_t id = reinterpret_cast<uintptr_t>(outerDocAcc->UniqueID());
|
||||
contentChild->SendPDocAccessibleConstructor(ipcDoc, parentIPCDoc,
|
||||
id);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -240,7 +231,8 @@ NotificationController::WillRefresh(mozilla::TimeStamp aTime)
|
||||
childDoc->Shutdown();
|
||||
}
|
||||
}
|
||||
mHangingChildDocuments.Clear();
|
||||
|
||||
nsTArray<nsRefPtr<DocAccessible>> newChildDocs = Move(mHangingChildDocuments);
|
||||
|
||||
// If the document is ready and all its subdocuments are completely loaded
|
||||
// then process the document load.
|
||||
@@ -282,6 +274,20 @@ NotificationController::WillRefresh(mozilla::TimeStamp aTime)
|
||||
mObservingState = eRefreshProcessing;
|
||||
|
||||
ProcessEventQueue();
|
||||
|
||||
if (IPCAccessibilityActive()) {
|
||||
size_t newDocCount = newChildDocs.Length();
|
||||
for (size_t i = 0; i < newDocCount; i++) {
|
||||
DocAccessible* childDoc = newChildDocs[i];
|
||||
DocAccessibleChild* ipcDoc = new DocAccessibleChild(childDoc);
|
||||
childDoc->SetIPCDoc(ipcDoc);
|
||||
auto contentChild = dom::ContentChild::GetSingleton();
|
||||
DocAccessibleChild* parentIPCDoc = mDocument->IPCDoc();
|
||||
uint64_t id = reinterpret_cast<uintptr_t>(childDoc->Parent()->UniqueID());
|
||||
contentChild->SendPDocAccessibleConstructor(ipcDoc, parentIPCDoc, id);
|
||||
}
|
||||
}
|
||||
|
||||
mObservingState = eRefreshObserving;
|
||||
if (!mDocument)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user