1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 17:04:59 +00:00

LibWeb: Use standardized encoding names, add encoding attribute to document

This commit is contained in:
Luke 2020-11-13 11:16:28 +00:00 committed by Andreas Kling
parent f3d2053bff
commit ed2689c00a
5 changed files with 20 additions and 5 deletions

View file

@ -135,9 +135,7 @@ RefPtr<DOM::Document> FrameLoader::create_document_from_mime_type(const ByteBuff
RefPtr<DOM::Document> document;
if (mime_type == "text/html" || mime_type == "image/svg+xml") {
HTML::HTMLDocumentParser parser(data, encoding);
parser.run(url);
document = parser.document();
document = HTML::parse_html_document(data, url, encoding);
} else if (mime_type.starts_with("image/")) {
document = create_image_document(data, url);
} else if (mime_type == "text/plain") {