mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-28 15:28:55 +00:00
LibWeb: Bring up basic external script execution in the new parser
This only works in some narrow cases, but should be enough for our own welcome.html at least. :^)
This commit is contained in:
parent
2cb50f6750
commit
4c9c6b3a7b
Notes:
sideshowbarker
2024-07-19 06:03:49 +09:00
Author: https://github.com/awesomekling
Commit: 4c9c6b3a7b
7 changed files with 60 additions and 3 deletions
|
@ -189,7 +189,8 @@ void HTMLScriptElement::prepare_script(Badge<HTMLDocumentParser>)
|
|||
|
||||
// FIXME: Check classic vs. module script type
|
||||
|
||||
ResourceLoader::the().load(url, [this, url](auto& data, auto&) {
|
||||
// FIXME: This load should be made asynchronous and the parser should spin an event loop etc.
|
||||
ResourceLoader::the().load_sync(url, [this, url](auto& data, auto&) {
|
||||
if (data.is_null()) {
|
||||
dbg() << "HTMLScriptElement: Failed to load " << url;
|
||||
return;
|
||||
|
@ -212,6 +213,7 @@ void HTMLScriptElement::prepare_script(Badge<HTMLDocumentParser>)
|
|||
}
|
||||
|
||||
else if (has_attribute("src") && m_parser_inserted && !has_attribute("async")) {
|
||||
|
||||
document().set_pending_parsing_blocking_script({}, this);
|
||||
when_the_script_is_ready([this] {
|
||||
m_ready_to_be_parser_executed = true;
|
||||
|
@ -234,6 +236,7 @@ void HTMLScriptElement::prepare_script(Badge<HTMLDocumentParser>)
|
|||
|
||||
void HTMLScriptElement::script_became_ready()
|
||||
{
|
||||
m_script_ready = true;
|
||||
if (!m_script_ready_callback)
|
||||
return;
|
||||
m_script_ready_callback();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue