1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 04:08:11 +00:00
serenity/Userland/Libraries/LibWeb/Page
DexesTTP e01f1c949f AK: Do not VERIFY on invalid code point bytes in UTF8View
The previous behavior was to always VERIFY that the UTF-8 bytes were
valid when iterating over the code points of an UTF8View. This change
makes it so we instead output the 0xFFFD 'REPLACEMENT CHARACTER'
code point when encountering invalid bytes, and keep iterating the
view after skipping one byte.

Leaving the decision to the consumer would break symmetry with the
UTF32View API, which would in turn require heavy refactoring and/or
code duplication in generic code such as the one found in
Gfx::Painter and the Shell.

To make it easier for the consumers to detect the original bytes, we
provide a new method on the iterator that returns a Span over the
data that has been decoded. This method is immediately used in the
TextNode::compute_text_for_rendering method, which previously did
this in a ad-hoc waay.

This also add tests for the new behavior in TestUtf8.cpp, as well
as reinforcements to the existing tests to check if the underlying
bytes match up with their expected values.
2021-06-03 18:28:27 +04:30
..
BrowsingContext.cpp LibWeb: Rename Web::Frame to Web::BrowsingContext 2021-05-30 12:39:53 +02:00
BrowsingContext.h LibWeb: Rename Web::Frame to Web::BrowsingContext 2021-05-30 12:39:53 +02:00
EditEventHandler.cpp AK: Do not VERIFY on invalid code point bytes in UTF8View 2021-06-03 18:28:27 +04:30
EditEventHandler.h LibWeb: Rename Web::Frame to Web::BrowsingContext 2021-05-30 12:39:53 +02:00
EventHandler.cpp Everywhere: codepoint => code point 2021-06-01 10:01:11 +02:00
EventHandler.h LibWeb: Rename Web::Frame to Web::BrowsingContext 2021-05-30 12:39:53 +02:00
Page.cpp LibWeb: Rename Web::Frame to Web::BrowsingContext 2021-05-30 12:39:53 +02:00
Page.h LibWeb: Rename Web::Frame to Web::BrowsingContext 2021-05-30 12:39:53 +02:00