mirror of
https://github.com/RGBCube/serenity
synced 2025-05-25 22:45:06 +00:00
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:
parent
6283c098ad
commit
bbfde63f79
5 changed files with 23 additions and 6 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue