mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:57:45 +00:00
LibWeb/MimeSniff: Add MimeType::is_image()
This commit is contained in:
parent
2c0f6d8c7b
commit
d2c88faf00
2 changed files with 8 additions and 0 deletions
|
@ -238,6 +238,13 @@ ErrorOr<void> MimeType::set_parameter(String name, String value)
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://mimesniff.spec.whatwg.org/#image-mime-type
|
||||||
|
bool MimeType::is_image() const
|
||||||
|
{
|
||||||
|
// An image MIME type is a MIME type whose type is "image".
|
||||||
|
return type() == "image"sv;
|
||||||
|
}
|
||||||
|
|
||||||
// https://mimesniff.spec.whatwg.org/#xml-mime-type
|
// https://mimesniff.spec.whatwg.org/#xml-mime-type
|
||||||
bool MimeType::is_xml() const
|
bool MimeType::is_xml() const
|
||||||
{
|
{
|
||||||
|
|
|
@ -26,6 +26,7 @@ public:
|
||||||
String const& subtype() const { return m_subtype; }
|
String const& subtype() const { return m_subtype; }
|
||||||
OrderedHashMap<String, String> const& parameters() const { return m_parameters; }
|
OrderedHashMap<String, String> const& parameters() const { return m_parameters; }
|
||||||
|
|
||||||
|
bool is_image() const;
|
||||||
bool is_xml() const;
|
bool is_xml() const;
|
||||||
bool is_html() const;
|
bool is_html() const;
|
||||||
bool is_javascript() const;
|
bool is_javascript() const;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue