From 89ea444967602c3920ff8fa1884d08b6379ed174 Mon Sep 17 00:00:00 2001 From: networkException Date: Sat, 28 Oct 2023 23:38:31 +0200 Subject: [PATCH] LibWeb: Use proper helper for appending to scripts to run after parsing Instead of appending manually to the scripts_to_execute_when_parsing_has_finished list, lets use the proper, currently unused function for this. --- Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp index daaedacb92..3637e4104f 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp @@ -492,7 +492,7 @@ void HTMLScriptElement::prepare_script() // 4. Otherwise, if el has a defer attribute or el's type is "module": else if (has_attribute(HTML::AttributeNames::defer) || m_script_type == ScriptType::Module) { // 1. Append el to its parser document's list of scripts that will execute when the document has finished parsing. - m_parser_document->scripts_to_execute_when_parsing_has_finished().append(*this); + m_parser_document->add_script_to_execute_when_parsing_has_finished({}, *this); // 2. Set el's steps to run when the result is ready to the following: m_steps_to_run_when_the_result_is_ready = [this] {