diff options
author | Andreas Kling <kling@serenityos.org> | 2020-07-26 19:37:56 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-26 20:05:15 +0200 |
commit | 11ff9d0f17bc0cd49a61b7c4cc66036584d6d30b (patch) | |
tree | ec880ff36492c94b7854e84226bf64c3611bb20a /Libraries/LibWeb/DOM/XMLHttpRequest.cpp | |
parent | 96d13f75cf2659cba8392db5469fdef1c831ceec (diff) | |
download | serenity-11ff9d0f17bc0cd49a61b7c4cc66036584d6d30b.zip |
LibWeb: Move DOM classes into the Web::DOM namespace
LibWeb keeps growing and the Web namespace is filling up fast.
Let's put DOM stuff into Web::DOM, just like we already started doing
with SVG stuff in Web::SVG.
Diffstat (limited to 'Libraries/LibWeb/DOM/XMLHttpRequest.cpp')
-rw-r--r-- | Libraries/LibWeb/DOM/XMLHttpRequest.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Libraries/LibWeb/DOM/XMLHttpRequest.cpp b/Libraries/LibWeb/DOM/XMLHttpRequest.cpp index 46e41187ad..6dcf43dde7 100644 --- a/Libraries/LibWeb/DOM/XMLHttpRequest.cpp +++ b/Libraries/LibWeb/DOM/XMLHttpRequest.cpp @@ -38,7 +38,7 @@ namespace Web { -XMLHttpRequest::XMLHttpRequest(Window& window) +XMLHttpRequest::XMLHttpRequest(DOM::Window& window) : m_window(window) { } @@ -78,22 +78,22 @@ 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(Event::create("load")); + const_cast<XMLHttpRequest&>(*weak_this).dispatch_event(DOM::Event::create("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(Event::create("error")); + const_cast<XMLHttpRequest&>(*weak_this).dispatch_event(DOM::Event::create("error")); }); } -void XMLHttpRequest::dispatch_event(NonnullRefPtr<Event> event) +void XMLHttpRequest::dispatch_event(NonnullRefPtr<DOM::Event> event) { for (auto& listener : listeners()) { if (listener.event_name == event->type()) { - auto& function = const_cast<EventListener&>(*listener.listener).function(); + auto& function = const_cast<DOM::EventListener&>(*listener.listener).function(); auto& global_object = function.global_object(); auto* this_value = wrap(global_object, *this); JS::MarkedValueList arguments(global_object.heap()); |