HTMLEncodingDetection.h 798 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(const ByteBuffer& input, const size_t& position);
  12. bool prescan_is_whitespace_or_slash(const u8& byte);
  13. bool prescan_skip_whitespace_and_slashes(const ByteBuffer& input, size_t& position);
  14. Optional<StringView> extract_character_encoding_from_meta_element(String const&);
  15. RefPtr<DOM::Attribute> prescan_get_attribute(DOM::Document&, const ByteBuffer& input, size_t& position);
  16. Optional<String> run_prescan_byte_stream_algorithm(DOM::Document&, const ByteBuffer& input);
  17. String run_encoding_sniffing_algorithm(DOM::Document&, const ByteBuffer& input);
  18. }