2021-05-12 10:47:12 +02:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2021, Max Wipfli <mail@maxwipfli.ch>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2023-12-16 17:49:34 +03:30
|
|
|
#include <AK/ByteString.h>
|
2021-05-12 10:47:12 +02:00
|
|
|
#include <AK/Optional.h>
|
2024-11-15 04:01:23 +13:00
|
|
|
#include <LibGC/Ptr.h>
|
2021-10-15 09:57:07 -04:00
|
|
|
#include <LibWeb/Forward.h>
|
2021-05-12 10:47:12 +02:00
|
|
|
|
|
|
|
namespace Web::HTML {
|
|
|
|
|
2022-04-01 20:58:27 +03:00
|
|
|
bool prescan_should_abort(ByteBuffer const& input, size_t const& position);
|
|
|
|
bool prescan_is_whitespace_or_slash(u8 const& byte);
|
|
|
|
bool prescan_skip_whitespace_and_slashes(ByteBuffer const& input, size_t& position);
|
2023-12-16 17:49:34 +03:30
|
|
|
Optional<StringView> extract_character_encoding_from_meta_element(ByteString const&);
|
2024-11-15 04:01:23 +13:00
|
|
|
GC::Ptr<DOM::Attr> prescan_get_attribute(DOM::Document&, ByteBuffer const& input, size_t& position);
|
2023-12-16 17:49:34 +03:30
|
|
|
Optional<ByteString> run_prescan_byte_stream_algorithm(DOM::Document&, ByteBuffer const& input);
|
2024-10-10 02:04:07 +02:00
|
|
|
Optional<ByteString> run_bom_sniff(ByteBuffer const& input);
|
|
|
|
ByteString run_encoding_sniffing_algorithm(DOM::Document&, ByteBuffer const& input, Optional<MimeSniff::MimeType> maybe_mime_type = {});
|
2021-05-12 10:47:12 +02:00
|
|
|
|
|
|
|
}
|