1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:28:11 +00:00

AK+LibWeb: Move decode forgiving base64 under Web::Infra namespace

Since the forgiving base64 is part of the web infra standard
This commit is contained in:
Arda Cinar 2023-01-10 11:49:06 +03:00 committed by Linus Groh
parent 4ab2954210
commit 283187afc5
6 changed files with 133 additions and 101 deletions

View file

@ -50,6 +50,7 @@
#include <LibWeb/HTML/WindowProxy.h>
#include <LibWeb/HighResolutionTime/Performance.h>
#include <LibWeb/HighResolutionTime/TimeOrigin.h>
#include <LibWeb/Infra/Base64.h>
#include <LibWeb/Infra/CharacterTypes.h>
#include <LibWeb/Layout/InitialContainingBlock.h>
#include <LibWeb/Page/Page.h>
@ -1410,7 +1411,7 @@ JS_DEFINE_NATIVE_FUNCTION(Window::atob)
// Otherwise, the user agent must convert data to a byte sequence whose nth byte is the eight-bit representation of the nth code point of data
// and then must apply forgiving-base64 encode to that byte sequence and return the result.
auto decoded = AK::decode_forgiving_base64(StringView(deprecated_string));
auto decoded = Infra::decode_forgiving_base64(StringView(deprecated_string));
if (decoded.is_error())
return vm.throw_completion<JS::TypeError>(JS::ErrorType::InvalidFormat, "Base64");