mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 17:49:40 +00:00
LibWeb: Forbid interleaving execution of HTML tasks with same source
From HTML spec https://html.spec.whatwg.org/#definitions-3 "... Note that in this setup, the processing model still enforces that the user agent would never process events from any one task source out of order." I can't come up with an example that is fixed by this change. However, debugging a bug caused by violating this assumption from the spec is likely to be very painful.
This commit is contained in:
parent
ba633882bf
commit
664611bae4
Notes:
sideshowbarker
2024-07-16 22:51:10 +09:00
Author: https://github.com/kalenikaliaksandr
Commit: 664611bae4
Pull-request: https://github.com/SerenityOS/serenity/pull/23903
3 changed files with 46 additions and 1 deletions
|
@ -39,6 +39,10 @@ public:
|
|||
TaskQueue& microtask_queue() { return *m_microtask_queue; }
|
||||
TaskQueue const& microtask_queue() const { return *m_microtask_queue; }
|
||||
|
||||
bool is_task_source_blocked(Task::Source source) const;
|
||||
void block_task_source(Task::Source source);
|
||||
void unblock_task_source(Task::Source source);
|
||||
|
||||
void spin_until(NOESCAPE JS::SafeFunction<bool()> goal_condition);
|
||||
void spin_processing_tasks_with_source_until(Task::Source, NOESCAPE JS::SafeFunction<bool()> goal_condition);
|
||||
void process();
|
||||
|
@ -113,6 +117,8 @@ private:
|
|||
bool m_execution_paused { false };
|
||||
|
||||
bool m_skip_event_loop_processing_steps { false };
|
||||
|
||||
Array<bool, to_underlying(Task::Source::UniqueTaskSourceStart)> m_blocked_task_sources;
|
||||
};
|
||||
|
||||
EventLoop& main_thread_event_loop();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue