diff options
author | Luke <luke.wilde@live.co.uk> | 2020-11-21 19:15:57 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-11-22 18:20:56 +0100 |
commit | 99502708087031172bca0e0dc423b28d82517ea8 (patch) | |
tree | 3c7d4b5050d8f7c2987474689f6f713c0a4b311c /Libraries/LibWeb/DOM/XMLHttpRequest.cpp | |
parent | e68348298f1f0905d6014c8bd5f6da2a3b6233d8 (diff) | |
download | serenity-99502708087031172bca0e0dc423b28d82517ea8.zip |
LibWeb: Add HTML::EventNames and UIEvents::EventNames
Diffstat (limited to 'Libraries/LibWeb/DOM/XMLHttpRequest.cpp')
-rw-r--r-- | Libraries/LibWeb/DOM/XMLHttpRequest.cpp | 7 |
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)); }); } |