LibWeb: Only take runnable tasks from the HTML task queue

We were previously willing to execute tasks before they had become
runnable.
This commit is contained in:
Andreas Kling 2021-10-03 15:38:11 +02:00
commit bbfde63f79
Notes: sideshowbarker 2024-07-18 03:08:55 +09:00
5 changed files with 23 additions and 6 deletions

View file

@ -25,4 +25,11 @@ void Task::execute()
m_steps();
}
// https://html.spec.whatwg.org/#concept-task-runnable
bool Task::is_runnable() const
{
// A task is runnable if its document is either null or fully active.
return !m_document || m_document->is_fully_active();
}
}