1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-10-18 02:32:25 +00:00
serenity/Userland/Libraries/LibWeb
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
..
Bindings LibWeb: Return null in Window.{top,parent} if browsing context is null 2021-05-31 14:22:38 +04:30
CodeGenerators LibWeb/WrapperGenerator: Replace a fprintf() with warnln() 2021-05-31 17:43:54 +01:00
Cookie Revert "Userland: static vs non-static constexpr variables" 2021-05-21 10:30:52 +01:00
CSS Everywhere: Replace ctype.h to avoid narrowing conversions 2021-06-03 13:31:46 +02:00
DOM Everywhere: Replace ctype.h to avoid narrowing conversions 2021-06-03 13:31:46 +02:00
DumpLayoutTree Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
HighResolutionTime Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
HTML Everywhere: Replace ctype.h to avoid narrowing conversions 2021-06-03 13:31:46 +02:00
Layout AK: Do not VERIFY on invalid code point bytes in UTF8View 2021-06-03 18:28:27 +04:30
Loader AK+LibWeb: Remove URL::to_string_encoded() 2021-06-01 12:23:16 +02:00
NavigationTiming Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Page AK: Do not VERIFY on invalid code point bytes in UTF8View 2021-06-03 18:28:27 +04:30
Painting LibWeb: Take border-radius into account when painting borders 2021-05-20 22:08:02 +02:00
Scripts Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
SVG Userland: Move non-standard math constants from math.h 2021-04-27 23:06:16 +02:00
Tests LibWeb: Implement test-web in terms of LibTest/JavaScriptTestRunner 2021-05-18 18:48:15 +01:00
UIEvents AK: Rename adopt() to adopt_ref() 2021-04-23 16:46:57 +02:00
WebAssembly LibWasm: Implement reference instructions (ref.{null,func,is_null}) 2021-06-02 16:09:16 +04:30
XHR AK+Userland: Remove nullability feature for the ByteBuffer type 2021-05-16 17:49:42 +02:00
CMakeLists.txt LibWeb: Rename "FrameHostElement" to "BrowsingContextContainer" 2021-05-31 16:25:13 +02:00
DOMTreeModel.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
DOMTreeModel.h AK: Rename adopt() to adopt_ref() 2021-04-23 16:46:57 +02:00
Dump.cpp LibWeb: Add :not pseudoclass to the CSS parser 2021-05-24 22:10:08 +01:00
Dump.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
FontCache.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
FontCache.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Forward.h LibWeb: Rename Web::Frame to Web::BrowsingContext 2021-05-30 12:39:53 +02:00
InProcessWebView.cpp LibWeb: Rename Web::Frame to Web::BrowsingContext 2021-05-30 12:39:53 +02:00
InProcessWebView.h LibWeb: Rename Web::Frame to Web::BrowsingContext 2021-05-30 12:39:53 +02:00
LayoutTreeModel.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
LayoutTreeModel.h AK: Rename adopt() to adopt_ref() 2021-04-23 16:46:57 +02:00
Namespace.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Namespace.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Origin.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
OutOfProcessWebView.cpp AK+LibWeb: Remove URL::to_string_encoded() 2021-06-01 12:23:16 +02:00
OutOfProcessWebView.h LibGUI: Rename ScrollableWidget => AbstractScrollableWidget 2021-05-03 21:03:13 +02:00
QualifiedName.h LibWeb: Use HTML-uppercased qualified name for the Element node name 2021-05-04 23:24:03 +01:00
StylePropertiesModel.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
StylePropertiesModel.h AK: Rename adopt() to adopt_ref() 2021-04-23 16:46:57 +02:00
TreeNode.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
URLEncoder.cpp LibWeb: Use correct percent encode set for form submissions 2021-06-01 23:26:03 +04:30
URLEncoder.h LibWeb: Use correct percent encode set for form submissions 2021-06-01 23:26:03 +04:30
WebContentClient.cpp LibIPC: Remove unnecessary IPC::ServerConnection::handshake() 2021-05-23 09:53:55 +02:00
WebContentClient.h LibIPC: Remove unnecessary IPC::ServerConnection::handshake() 2021-05-23 09:53:55 +02:00
WebViewHooks.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00