1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2026-01-13 01:31:00 +00:00
serenity/Userland/Libraries/LibWeb/Loader
Max Wipfli f808279769 LibWeb: Implement encoding sniffing algorithm
This patch implements the HTML specification's "encoding sniffing
algorithm", which is used when no encoding can be obtained from the
Content-Type header (either because it doesn't contain a charset=...)
value or the file has not been opened via HTTP (as with local files).

It also modifies the creator of the HTMLDocumentParser to use the new
HTMLDocumentParser::create_with_uncertain_encoding static method, which
runs the encoding sniffing algorithm before instantiating the parser.

This now allows us to load local HTML pages (or remote pages without a
charset specified in the 'Content-Type' header) with a non-UTF-8
encoding such as 'windows-1252'. This would previously crash the
browser. :^)
2021-05-18 21:02:07 +02:00
..
ContentFilter.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
ContentFilter.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
CSSLoader.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
CSSLoader.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
FrameLoader.cpp LibWeb: Implement encoding sniffing algorithm 2021-05-18 21:02:07 +02:00
FrameLoader.h LibWeb: Add a maximum redirects limit to FrameLoader 2021-05-11 21:41:48 +01:00
ImageLoader.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
ImageLoader.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
ImageResource.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
ImageResource.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
LoadRequest.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
LoadRequest.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Resource.cpp LibWeb: Change Resource's m_encoding to Optional<String> 2021-05-18 21:02:07 +02:00
Resource.h LibWeb: Change Resource's m_encoding to Optional<String> 2021-05-18 21:02:07 +02:00
ResourceLoader.cpp LibCore+Everywhere: Move OpenMode out of IODevice 2021-05-12 11:00:45 +01:00
ResourceLoader.h Services: Rename ProtocolServer to RequestServer 2021-04-25 19:04:34 +02:00