1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:37:36 +00:00

LibWeb/MimeSniff: Add sniffing in an image context

This commit is contained in:
Kemal Zebari 2023-11-30 12:45:58 -08:00 committed by Andrew Kaster
parent ea15501f37
commit 02ea85da2c
3 changed files with 100 additions and 7 deletions

View file

@ -12,7 +12,8 @@ namespace Web::MimeSniff {
enum class SniffingContext {
None,
Browsing
Browsing,
Image
};
struct SniffingConfiguration {
@ -40,6 +41,7 @@ private:
ErrorOr<void> supplied_mime_type_detection_algorithm(StringView scheme, Optional<MimeType> supplied_type);
ErrorOr<void> mime_type_sniffing_algorithm();
ErrorOr<void> context_specific_sniffing_algorithm(SniffingContext sniffing_context);
ErrorOr<void> rules_for_sniffing_images_specifically();
// https://mimesniff.spec.whatwg.org/#supplied-mime-type
// A supplied MIME type, the MIME type determined by the supplied MIME type detection algorithm.