summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb/Loader
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-12-13 18:21:52 +0100
committerAndreas Kling <kling@serenityos.org>2020-12-13 18:21:52 +0100
commit7b735b55e11685107708385cbe10b7329634838f (patch)
tree1faca6409f9244f436623e5055aff6b2f1d66410 /Libraries/LibWeb/Loader
parent024059b49b0539dc7fbd87624f6369645b247480 (diff)
downloadserenity-7b735b55e11685107708385cbe10b7329634838f.zip
LibWeb: Set the encoding of HTML documents
Now that we attach the document to the frame before parsing, we have to make sure we set the encoding on the document before parsing, or things may not turn out well.
Diffstat (limited to 'Libraries/LibWeb/Loader')
-rw-r--r--Libraries/LibWeb/Loader/FrameLoader.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/Libraries/LibWeb/Loader/FrameLoader.cpp b/Libraries/LibWeb/Loader/FrameLoader.cpp
index 9347521df4..72598378d1 100644
--- a/Libraries/LibWeb/Loader/FrameLoader.cpp
+++ b/Libraries/LibWeb/Loader/FrameLoader.cpp
@@ -260,6 +260,7 @@ void FrameLoader::resource_did_load()
auto document = DOM::Document::create();
document->set_url(url);
+ document->set_encoding(resource()->encoding());
document->set_content_type(resource()->mime_type());
frame().set_document(document);