Bug 1689936: Move pending a11y content insertions into a temporary data structure before processing them. r=eeejay

Differential Revision: https://phabricator.services.mozilla.com/D103977
This commit is contained in:
James Teh 2021-02-05 00:01:59 +00:00
Родитель 1ea87269a8
Коммит e81436a8a8
1 изменённых файлов: 8 добавлений и 2 удалений

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

@ -746,13 +746,19 @@ void NotificationController::WillRefresh(mozilla::TimeStamp aTime) {
mTextHash.Clear();
// Process content inserted notifications to update the tree.
for (auto iter = mContentInsertions.ConstIter(); !iter.Done(); iter.Next()) {
// Processing an insertion can indirectly run script (e.g. querying a XUL
// interface), which might result in another insertion being queued.
// We don't want to lose any queued insertions if this happens. Therefore, we
// move the current insertions into a temporary data structure and process
// them from there. Any insertions queued during processing will get handled
// in subsequent refresh driver ticks.
auto contentInsertions = std::move(mContentInsertions);
for (auto iter = contentInsertions.ConstIter(); !iter.Done(); iter.Next()) {
mDocument->ProcessContentInserted(iter.Key(), iter.UserData());
if (!mDocument) {
return;
}
}
mContentInsertions.Clear();
// Bind hanging child documents unless we are using IPC and the
// document has no IPC actor. If we fail to bind the child doc then