LibWeb/HTML: Use MimeType::is_xml() in HTMLObjectElement for DRYness
Now that we implement this member function, let's use it to keep things DRY.
This commit is contained in:
parent
fd157b9a71
commit
dcff48356f
Notes:
sideshowbarker
2024-07-17 09:39:38 +09:00
Author: https://github.com/kemzeb Commit: https://github.com/SerenityOS/serenity/commit/dcff48356f Pull-request: https://github.com/SerenityOS/serenity/pull/21423
1 changed files with 1 additions and 5 deletions
|
@ -229,11 +229,7 @@ static bool is_xml_mime_type(StringView resource_type)
|
|||
if (!mime_type.has_value())
|
||||
return false;
|
||||
|
||||
// An XML MIME type is any MIME type whose subtype ends in "+xml" or whose essence is "text/xml" or "application/xml". [RFC7303]
|
||||
if (mime_type->subtype().ends_with_bytes("+xml"sv))
|
||||
return true;
|
||||
|
||||
return mime_type->essence().is_one_of("text/xml"sv, "application/xml"sv);
|
||||
return mime_type->is_xml();
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-object-element:plugin-11
|
||||
|
|
Loading…
Add table
Reference in a new issue