HTMLEncodingDetection.h 866 B

123456789101112131415161718192021222324
  1. /*
  2. * Copyright (c) 2021, Max Wipfli <mail@maxwipfli.ch>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/DeprecatedString.h>
  8. #include <AK/Optional.h>
  9. #include <LibJS/Heap/GCPtr.h>
  10. #include <LibWeb/Forward.h>
  11. namespace Web::HTML {
  12. bool prescan_should_abort(ByteBuffer const& input, size_t const& position);
  13. bool prescan_is_whitespace_or_slash(u8 const& byte);
  14. bool prescan_skip_whitespace_and_slashes(ByteBuffer const& input, size_t& position);
  15. Optional<StringView> extract_character_encoding_from_meta_element(DeprecatedString const&);
  16. JS::GCPtr<DOM::Attr> prescan_get_attribute(DOM::Document&, ByteBuffer const& input, size_t& position);
  17. Optional<DeprecatedString> run_prescan_byte_stream_algorithm(DOM::Document&, ByteBuffer const& input);
  18. DeprecatedString run_encoding_sniffing_algorithm(DOM::Document&, ByteBuffer const& input);
  19. }