mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-26 18:09:45 +00:00
LibWeb: Delay module script execution until current script has ended
This commit is contained in:
parent
e73e0b3c92
commit
24a7eac4ab
Notes:
github-actions[bot]
2025-10-16 14:49:17 +00:00
Author: https://github.com/tcl3
Commit: 24a7eac4ab
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6492
Reviewed-by: https://github.com/gmta ✅
3 changed files with 41 additions and 5 deletions
|
|
@ -466,11 +466,14 @@ void HTMLScriptElement::prepare_script()
|
|||
begin_delaying_document_load_event(*m_preparation_time_document);
|
||||
|
||||
auto steps = create_on_fetch_script_complete(heap(), [this](auto result) {
|
||||
// 1. Mark as ready el given result.
|
||||
if (!result)
|
||||
mark_as_ready(ResultState::Null {});
|
||||
else
|
||||
mark_as_ready(Result(*result));
|
||||
// 1. Queue an element task on the networking task source given el to perform the following steps:
|
||||
queue_an_element_task(Task::Source::Networking, [this, result = move(result)] {
|
||||
// 1. Mark as ready el given result.
|
||||
if (!result)
|
||||
mark_as_ready(ResultState::Null {});
|
||||
else
|
||||
mark_as_ready(Result(*result));
|
||||
});
|
||||
});
|
||||
|
||||
// 2. Fetch an inline module script graph, given source text, base URL, settings object, options, and with the following steps given result:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue