mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-27 17:47:34 +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();
|
CycleCollectedJSContext* context = CycleCollectedJSContext::Get();
|
||||||
RefPtr<ProcessBackupQueueRunnable> processBackupQueueRunnable =
|
RefPtr<BackupQueueMicroTask> bqmt = new BackupQueueMicroTask(this);
|
||||||
new ProcessBackupQueueRunnable(this);
|
context->DispatchMicroTaskRunnable(bqmt.forget());
|
||||||
context->DispatchToMicroTask(processBackupQueueRunnable.forget());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -311,21 +311,21 @@ private:
|
||||||
void Enqueue(Element* aElement, CustomElementReaction* aReaction);
|
void Enqueue(Element* aElement, CustomElementReaction* aReaction);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class ProcessBackupQueueRunnable : public mozilla::Runnable {
|
class BackupQueueMicroTask final : public mozilla::MicroTaskRunnable {
|
||||||
public:
|
public:
|
||||||
explicit ProcessBackupQueueRunnable(CustomElementReactionsStack* aReactionStack)
|
explicit BackupQueueMicroTask(CustomElementReactionsStack* aReactionStack)
|
||||||
: mReactionStack(aReactionStack)
|
: MicroTaskRunnable()
|
||||||
|
, mReactionStack(aReactionStack)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(!mReactionStack->mIsBackupQueueProcessing,
|
MOZ_ASSERT(!mReactionStack->mIsBackupQueueProcessing,
|
||||||
"mIsBackupQueueProcessing should be initially false");
|
"mIsBackupQueueProcessing should be initially false");
|
||||||
mReactionStack->mIsBackupQueueProcessing = true;
|
mReactionStack->mIsBackupQueueProcessing = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHOD Run() override
|
virtual void Run(AutoSlowOperation& aAso) override
|
||||||
{
|
{
|
||||||
mReactionStack->InvokeBackupQueue();
|
mReactionStack->InvokeBackupQueue();
|
||||||
mReactionStack->mIsBackupQueueProcessing = false;
|
mReactionStack->mIsBackupQueueProcessing = false;
|
||||||
return NS_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue