summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb/DOM/XMLHttpRequest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries/LibWeb/DOM/XMLHttpRequest.cpp')
-rw-r--r--Libraries/LibWeb/DOM/XMLHttpRequest.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/Libraries/LibWeb/DOM/XMLHttpRequest.cpp b/Libraries/LibWeb/DOM/XMLHttpRequest.cpp
index 43e8ddeccb..092ad060c8 100644
--- a/Libraries/LibWeb/DOM/XMLHttpRequest.cpp
+++ b/Libraries/LibWeb/DOM/XMLHttpRequest.cpp
@@ -34,6 +34,7 @@
#include <LibWeb/DOM/EventListener.h>
#include <LibWeb/DOM/Window.h>
#include <LibWeb/DOM/XMLHttpRequest.h>
+#include <LibWeb/HTML/EventNames.h>
#include <LibWeb/Loader/ResourceLoader.h>
#include <LibWeb/Origin.h>
@@ -83,7 +84,7 @@ void XMLHttpRequest::send()
if (!weak_this)
return;
const_cast<XMLHttpRequest&>(*weak_this).set_ready_state(ReadyState::Done);
- const_cast<XMLHttpRequest&>(*weak_this).dispatch_event(DOM::Event::create("error"));
+ const_cast<XMLHttpRequest&>(*weak_this).dispatch_event(DOM::Event::create(HTML::EventNames::error));
return;
}
@@ -96,14 +97,14 @@ void XMLHttpRequest::send()
return;
const_cast<XMLHttpRequest&>(*weak_this).m_response = data;
const_cast<XMLHttpRequest&>(*weak_this).set_ready_state(ReadyState::Done);
- const_cast<XMLHttpRequest&>(*weak_this).dispatch_event(DOM::Event::create("load"));
+ const_cast<XMLHttpRequest&>(*weak_this).dispatch_event(DOM::Event::create(HTML::EventNames::load));
},
[weak_this = make_weak_ptr()](auto& error) {
if (!weak_this)
return;
dbg() << "XHR failed to load: " << error;
const_cast<XMLHttpRequest&>(*weak_this).set_ready_state(ReadyState::Done);
- const_cast<XMLHttpRequest&>(*weak_this).dispatch_event(DOM::Event::create("error"));
+ const_cast<XMLHttpRequest&>(*weak_this).dispatch_event(DOM::Event::create(HTML::EventNames::error));
});
}