From 77c41a82bec370ae7c8998aa939bd1117a29b31a Mon Sep 17 00:00:00 2001 From: Jamie Mansfield Date: Sun, 4 Aug 2024 16:56:40 +0100 Subject: [PATCH] LibWeb: Script force async flag should default to true See: - http://wpt.live/html/semantics/scripting-1/the-script-element/async_001.htm --- .../Text/expected/HTML/script-async-attribute.txt | 2 ++ .../Text/input/HTML/script-async-attribute.html | 11 +++++++++++ Userland/Libraries/LibWeb/HTML/HTMLScriptElement.h | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 Tests/LibWeb/Text/expected/HTML/script-async-attribute.txt create mode 100644 Tests/LibWeb/Text/input/HTML/script-async-attribute.html diff --git a/Tests/LibWeb/Text/expected/HTML/script-async-attribute.txt b/Tests/LibWeb/Text/expected/HTML/script-async-attribute.txt new file mode 100644 index 00000000000..50e1116c4a2 --- /dev/null +++ b/Tests/LibWeb/Text/expected/HTML/script-async-attribute.txt @@ -0,0 +1,2 @@ +includeScript.async = false +script.async = true diff --git a/Tests/LibWeb/Text/input/HTML/script-async-attribute.html b/Tests/LibWeb/Text/input/HTML/script-async-attribute.html new file mode 100644 index 00000000000..897291dfc0b --- /dev/null +++ b/Tests/LibWeb/Text/input/HTML/script-async-attribute.html @@ -0,0 +1,11 @@ + + + diff --git a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.h b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.h index 1505d916999..a2156116918 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.h @@ -94,7 +94,7 @@ private: JS::GCPtr m_preparation_time_document; // https://html.spec.whatwg.org/multipage/scripting.html#script-force-async - bool m_force_async { false }; + bool m_force_async { true }; // https://html.spec.whatwg.org/multipage/scripting.html#already-started bool m_already_started { false };