summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp
diff options
context:
space:
mode:
authorLuke Wilde <lukew@serenityos.org>2022-10-05 17:01:16 +0100
committerLinus Groh <mail@linusgroh.de>2022-10-06 22:21:17 +0100
commit102e02d336a0f6aeca61b705bc17feefae5a8f51 (patch)
tree9dd8c83d66d1b02bb25cb2f47e3452dd364a612d /Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp
parent7fc03e8967a8de6015d922614b7f1698b2f27fa5 (diff)
downloadserenity-102e02d336a0f6aeca61b705bc17feefae5a8f51.zip
LibWeb: Use DOM manipulation task source for <script> src parsing errors
See: https://github.com/whatwg/html/commit/5d34cb8 We were already using queue_an_element_task here.
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp')
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp
index 9245ae21be..e647c23119 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp
@@ -265,10 +265,10 @@ void HTMLScriptElement::prepare_script()
if (has_attribute(HTML::AttributeNames::src)) {
// 1. Let src be the value of the element's src attribute.
auto src = attribute(HTML::AttributeNames::src);
- // 2. If src is the empty string, queue a task to fire an event named error at the element, and return.
+ // 2. If src is the empty string, then queue an element task on the DOM manipulation task source given el to fire an event named error at el, and return.
if (src.is_empty()) {
dbgln("HTMLScriptElement: Refusing to run script because the src attribute is empty.");
- queue_an_element_task(HTML::Task::Source::Unspecified, [this] {
+ queue_an_element_task(HTML::Task::Source::DOMManipulation, [this] {
dispatch_event(*DOM::Event::create(realm(), HTML::EventNames::error));
});
return;
@@ -278,10 +278,10 @@ void HTMLScriptElement::prepare_script()
// 4. Parse src relative to the element's node document.
auto url = document().parse_url(src);
- // 5. If the previous step failed, queue a task to fire an event named error at the element, and return. Otherwise, let url be the resulting URL record.
+ // 5. If the previous step failed, then queue an element task on the DOM manipulation task source given el to fire an event named error at el, and return. Otherwise, let url be the resulting URL record.
if (!url.is_valid()) {
dbgln("HTMLScriptElement: Refusing to run script because the src URL '{}' is invalid.", url);
- queue_an_element_task(HTML::Task::Source::Unspecified, [this] {
+ queue_an_element_task(HTML::Task::Source::DOMManipulation, [this] {
dispatch_event(*DOM::Event::create(realm(), HTML::EventNames::error));
});
return;