mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-29 20:07:30 +09:00
Bug 1419305 - Part 2: Keep processing remaining elements in ElementQueue even if some of elements are already unlinked
Tag UXP Issue #1344
This commit is contained in:
parent
8a0e7286e0
commit
506795f384
1 changed files with 5 additions and 4 deletions
|
|
@ -1034,6 +1034,8 @@ CustomElementReactionsStack::InvokeBackupQueue()
|
||||||
// we don't need to pass global object for error reporting.
|
// we don't need to pass global object for error reporting.
|
||||||
InvokeReactions(&mBackupQueue, nullptr);
|
InvokeReactions(&mBackupQueue, nullptr);
|
||||||
}
|
}
|
||||||
|
MOZ_ASSERT(mBackupQueue.IsEmpty(),
|
||||||
|
"There are still some reactions in BackupQueue not being consumed!?!");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -1050,15 +1052,14 @@ CustomElementReactionsStack::InvokeReactions(ElementQueue* aElementQueue,
|
||||||
for (uint32_t i = 0; i < aElementQueue->Length(); ++i) {
|
for (uint32_t i = 0; i < aElementQueue->Length(); ++i) {
|
||||||
Element* element = aElementQueue->ElementAt(i);
|
Element* element = aElementQueue->ElementAt(i);
|
||||||
|
|
||||||
if (!element) {
|
// ElementQueue hold a element's strong reference, it should not be a nullptr.
|
||||||
continue;
|
MOZ_ASSERT(element);
|
||||||
}
|
|
||||||
|
|
||||||
RefPtr<CustomElementData> elementData = element->GetCustomElementData();
|
RefPtr<CustomElementData> elementData = element->GetCustomElementData();
|
||||||
if (!elementData) {
|
if (!elementData) {
|
||||||
// This happens when the document is destroyed and the element is already
|
// This happens when the document is destroyed and the element is already
|
||||||
// unlinked, no need to fire the callbacks in this case.
|
// unlinked, no need to fire the callbacks in this case.
|
||||||
return;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto& reactions = elementData->mReactionQueue;
|
auto& reactions = elementData->mReactionQueue;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue