mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 22:38:51 +00:00
LibWeb: Implement <script src> execution for non-blocking scripts
This commit is contained in:
parent
c34da16089
commit
01900801e3
Notes:
sideshowbarker
2024-07-18 03:36:29 +09:00
Author: https://github.com/awesomekling
Commit: 01900801e3
1 changed files with 8 additions and 3 deletions
|
@ -411,10 +411,15 @@ void HTMLScriptElement::prepare_script()
|
|||
// The element must be added to the set of scripts that will execute as soon as possible of the element's preparation-time document.
|
||||
// FIXME: This should add to a set, not a list.
|
||||
m_preparation_time_document->add_script_to_execute_as_soon_as_possible({}, *this);
|
||||
// FIXME: When the script is ready, execute the script block and then remove the element
|
||||
// from the set of scripts that will execute as soon as possible.
|
||||
|
||||
TODO();
|
||||
// When the script is ready, execute the script block and then remove the element
|
||||
// from the set of scripts that will execute as soon as possible.
|
||||
when_the_script_is_ready([this] {
|
||||
execute_script();
|
||||
m_preparation_time_document->scripts_to_execute_as_soon_as_possible().remove_first_matching([&](auto& entry) {
|
||||
return entry == this;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// FIXME: -> If the element does not have a src attribute, and the element is "parser-inserted",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue