mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibWeb: Use Content-Type header to set document encoding
Co-authored-by: Shannon Booth <shannon@serenityos.org>
This commit is contained in:
parent
1096b64936
commit
8e342e3e23
Notes:
github-actions[bot]
2024-10-23 17:32:00 +00:00
Author: https://github.com/Gingeh
Commit: 8e342e3e23
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1879
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/shannonbooth ✅
3 changed files with 7 additions and 6 deletions
|
@ -91,9 +91,9 @@ static WebIDL::ExceptionOr<JS::NonnullGCPtr<DOM::Document>> load_html_document(H
|
|||
// causes a load event to be fired.
|
||||
else {
|
||||
// FIXME: Parse as we receive the document data, instead of waiting for the whole document to be fetched first.
|
||||
auto process_body = JS::create_heap_function(document->heap(), [document, url = navigation_params.response->url().value()](ByteBuffer data) {
|
||||
Platform::EventLoopPlugin::the().deferred_invoke([document = document, data = move(data), url = url] {
|
||||
auto parser = HTML::HTMLParser::create_with_uncertain_encoding(document, data);
|
||||
auto process_body = JS::create_heap_function(document->heap(), [document, url = navigation_params.response->url().value(), mime_type = navigation_params.response->header_list()->extract_mime_type()](ByteBuffer data) {
|
||||
Platform::EventLoopPlugin::the().deferred_invoke([document = document, data = move(data), url = url, mime_type] {
|
||||
auto parser = HTML::HTMLParser::create_with_uncertain_encoding(document, data, mime_type);
|
||||
parser->run(url);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue