HTMLEncodingDetection.h 801 B

1234567891011121314151617181920212223
  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/Optional.h>
  8. #include <AK/String.h>
  9. #include <LibWeb/Forward.h>
  10. namespace Web::HTML {
  11. bool prescan_should_abort(ByteBuffer const& input, size_t const& position);
  12. bool prescan_is_whitespace_or_slash(u8 const& byte);
  13. bool prescan_skip_whitespace_and_slashes(ByteBuffer const& input, size_t& position);
  14. Optional<StringView> extract_character_encoding_from_meta_element(String const&);
  15. JS::GCPtr<DOM::Attribute> prescan_get_attribute(DOM::Document&, ByteBuffer const& input, size_t& position);
  16. Optional<String> run_prescan_byte_stream_algorithm(DOM::Document&, ByteBuffer const& input);
  17. String run_encoding_sniffing_algorithm(DOM::Document&, ByteBuffer const& input);
  18. }