summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Encoding
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-09-25 17:03:42 +0100
committerLinus Groh <mail@linusgroh.de>2022-09-25 19:13:31 +0100
commitad04d7ac9b88ecea572cf517f6e01ccf1e95073d (patch)
treeed33bb942b1bdef7163972425057435a7d8eeaf9 /Userland/Libraries/LibWeb/Encoding
parentc0eda779287d4b1305046164cd0a8ee5a5799e0b (diff)
downloadserenity-ad04d7ac9b88ecea572cf517f6e01ccf1e95073d.zip
LibWeb: Move ExceptionOr from DOM/ to WebIDL/
This is a concept fully defined in the Web IDL spec and doesn't belong in the DOM directory/namespace - not even DOMException, despite the name :^)
Diffstat (limited to 'Userland/Libraries/LibWeb/Encoding')
-rw-r--r--Userland/Libraries/LibWeb/Encoding/TextDecoder.cpp6
-rw-r--r--Userland/Libraries/LibWeb/Encoding/TextDecoder.h6
2 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Libraries/LibWeb/Encoding/TextDecoder.cpp b/Userland/Libraries/LibWeb/Encoding/TextDecoder.cpp
index 7556094ead..99e9e896d2 100644
--- a/Userland/Libraries/LibWeb/Encoding/TextDecoder.cpp
+++ b/Userland/Libraries/LibWeb/Encoding/TextDecoder.cpp
@@ -12,11 +12,11 @@
namespace Web::Encoding {
-DOM::ExceptionOr<JS::NonnullGCPtr<TextDecoder>> TextDecoder::create_with_global_object(HTML::Window& window, FlyString encoding)
+WebIDL::ExceptionOr<JS::NonnullGCPtr<TextDecoder>> TextDecoder::create_with_global_object(HTML::Window& window, FlyString encoding)
{
auto decoder = TextCodec::decoder_for(encoding);
if (!decoder)
- return DOM::SimpleException { DOM::SimpleExceptionType::TypeError, String::formatted("Invalid encoding {}", encoding) };
+ return WebIDL::SimpleException { WebIDL::SimpleExceptionType::TypeError, String::formatted("Invalid encoding {}", encoding) };
return JS::NonnullGCPtr(*window.heap().allocate<TextDecoder>(window.realm(), window, *decoder, move(encoding), false, false));
}
@@ -35,7 +35,7 @@ TextDecoder::TextDecoder(HTML::Window& window, TextCodec::Decoder& decoder, FlyS
TextDecoder::~TextDecoder() = default;
// https://encoding.spec.whatwg.org/#dom-textdecoder-decode
-DOM::ExceptionOr<String> TextDecoder::decode(JS::Handle<JS::Object> const& input) const
+WebIDL::ExceptionOr<String> TextDecoder::decode(JS::Handle<JS::Object> const& input) const
{
// FIXME: Implement the streaming stuff.
diff --git a/Userland/Libraries/LibWeb/Encoding/TextDecoder.h b/Userland/Libraries/LibWeb/Encoding/TextDecoder.h
index f5f52e508e..fe37ccec45 100644
--- a/Userland/Libraries/LibWeb/Encoding/TextDecoder.h
+++ b/Userland/Libraries/LibWeb/Encoding/TextDecoder.h
@@ -11,8 +11,8 @@
#include <LibJS/Forward.h>
#include <LibTextCodec/Decoder.h>
#include <LibWeb/Bindings/PlatformObject.h>
-#include <LibWeb/DOM/ExceptionOr.h>
#include <LibWeb/Forward.h>
+#include <LibWeb/WebIDL/ExceptionOr.h>
namespace Web::Encoding {
@@ -21,11 +21,11 @@ class TextDecoder : public Bindings::PlatformObject {
WEB_PLATFORM_OBJECT(TextDecoder, Bindings::PlatformObject);
public:
- static DOM::ExceptionOr<JS::NonnullGCPtr<TextDecoder>> create_with_global_object(HTML::Window&, FlyString encoding);
+ static WebIDL::ExceptionOr<JS::NonnullGCPtr<TextDecoder>> create_with_global_object(HTML::Window&, FlyString encoding);
virtual ~TextDecoder() override;
- DOM::ExceptionOr<String> decode(JS::Handle<JS::Object> const&) const;
+ WebIDL::ExceptionOr<String> decode(JS::Handle<JS::Object> const&) const;
FlyString const& encoding() const { return m_encoding; }
bool fatal() const { return m_fatal; }