mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 16:28:38 +09:00
Bug 1419305 - Part 1: Use MicroTask on CustomElements correctly
Tag UXP Issue #1344
This commit is contained in:
parent
249667092c
commit
8a0e7286e0
2 changed files with 7 additions and 8 deletions
|
|
@ -1019,9 +1019,8 @@ CustomElementReactionsStack::Enqueue(Element* aElement,
|
|||
}
|
||||
|
||||
CycleCollectedJSContext* context = CycleCollectedJSContext::Get();
|
||||
RefPtr<ProcessBackupQueueRunnable> processBackupQueueRunnable =
|
||||
new ProcessBackupQueueRunnable(this);
|
||||
context->DispatchToMicroTask(processBackupQueueRunnable.forget());
|
||||
RefPtr<BackupQueueMicroTask> bqmt = new BackupQueueMicroTask(this);
|
||||
context->DispatchMicroTaskRunnable(bqmt.forget());
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -311,21 +311,21 @@ private:
|
|||
void Enqueue(Element* aElement, CustomElementReaction* aReaction);
|
||||
|
||||
private:
|
||||
class ProcessBackupQueueRunnable : public mozilla::Runnable {
|
||||
class BackupQueueMicroTask final : public mozilla::MicroTaskRunnable {
|
||||
public:
|
||||
explicit ProcessBackupQueueRunnable(CustomElementReactionsStack* aReactionStack)
|
||||
: mReactionStack(aReactionStack)
|
||||
explicit BackupQueueMicroTask(CustomElementReactionsStack* aReactionStack)
|
||||
: MicroTaskRunnable()
|
||||
, mReactionStack(aReactionStack)
|
||||
{
|
||||
MOZ_ASSERT(!mReactionStack->mIsBackupQueueProcessing,
|
||||
"mIsBackupQueueProcessing should be initially false");
|
||||
mReactionStack->mIsBackupQueueProcessing = true;
|
||||
}
|
||||
|
||||
NS_IMETHOD Run() override
|
||||
virtual void Run(AutoSlowOperation& aAso) override
|
||||
{
|
||||
mReactionStack->InvokeBackupQueue();
|
||||
mReactionStack->mIsBackupQueueProcessing = false;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue