Browse Source

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.
networkException 1 year ago
parent
commit
89ea444967
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp

+ 1 - 1
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":
         // 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) {
         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.
             // 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:
             // 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] {
             m_steps_to_run_when_the_result_is_ready = [this] {