1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 02:27:35 +00:00
serenity/Userland/Libraries/LibWeb/Layout
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
..
BlockBox.cpp LibGfx: Unify Rect, Point, and Size 2021-05-02 22:48:06 +02:00
BlockBox.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
BlockFormattingContext.cpp LibWeb: Rename Web::Frame to Web::BrowsingContext 2021-05-30 12:39:53 +02:00
BlockFormattingContext.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Box.cpp LibWeb: Rename Web::Frame to Web::BrowsingContext 2021-05-30 12:39:53 +02:00
Box.h LibWeb: Introduce struct to hold border radii and normalize once 2021-05-20 22:08:02 +02:00
BoxModelMetrics.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
BoxModelMetrics.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
BreakNode.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
BreakNode.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
ButtonBox.cpp LibWeb: Rename Web::Frame to Web::BrowsingContext 2021-05-30 12:39:53 +02:00
ButtonBox.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
CanvasBox.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
CanvasBox.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
CheckBox.cpp LibWeb: Rename Web::Frame to Web::BrowsingContext 2021-05-30 12:39:53 +02:00
CheckBox.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
FlexFormattingContext.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
FlexFormattingContext.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
FormattingContext.cpp LibWeb: Compute intrinsic height of absolute replaced elements 2021-05-04 15:36:07 +01:00
FormattingContext.h LibWeb: Fix height computation (again) :^) 2021-04-22 19:17:10 +02:00
FrameBox.cpp LibWeb: Rename Web::Frame to Web::BrowsingContext 2021-05-30 12:39:53 +02:00
FrameBox.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
ImageBox.cpp LibWeb: Rename Web::Frame to Web::BrowsingContext 2021-05-30 12:39:53 +02:00
ImageBox.h LibWeb: Rename Web::Frame to Web::BrowsingContext 2021-05-30 12:39:53 +02:00
InitialContainingBlockBox.cpp LibWeb: Rename Web::Frame to Web::BrowsingContext 2021-05-30 12:39:53 +02:00
InitialContainingBlockBox.h LibWeb: Propagate body background properties to root HTML element 2021-05-13 16:16:25 +02:00
InlineFormattingContext.cpp LibGfx: Unify Rect, Point, and Size 2021-05-02 22:48:06 +02:00
InlineFormattingContext.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
InlineNode.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
InlineNode.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Label.cpp LibWeb: Rename Web::Frame to Web::BrowsingContext 2021-05-30 12:39:53 +02:00
Label.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
LabelableNode.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
LayoutPosition.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
LayoutPosition.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
LineBox.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
LineBox.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
LineBoxFragment.cpp LibGfx: Unify Rect, Point, and Size 2021-05-02 22:48:06 +02:00
LineBoxFragment.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
ListItemBox.cpp LibWeb: Position the ListItemMarkers according to their width 2021-05-12 08:53:18 +01:00
ListItemBox.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
ListItemMarkerBox.cpp LibWeb: Fix off-by-one for alphabetical markers in <ol>s 2021-05-13 15:43:51 +02:00
ListItemMarkerBox.h LibWeb: Position the ListItemMarkers according to their width 2021-05-12 08:53:18 +01:00
Node.cpp LibWeb: Rename Web::Frame to Web::BrowsingContext 2021-05-30 12:39:53 +02:00
Node.h LibWeb: Rename Web::Frame to Web::BrowsingContext 2021-05-30 12:39:53 +02:00
RadioButton.cpp LibWeb: Rename Web::Frame to Web::BrowsingContext 2021-05-30 12:39:53 +02:00
RadioButton.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
ReplacedBox.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
ReplacedBox.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
SVGBox.cpp Userland: Use mattco@serenityos.org for my copyright headers 2021-04-23 08:24:53 +02:00
SVGBox.h Userland: Use mattco@serenityos.org for my copyright headers 2021-04-23 08:24:53 +02:00
SVGGraphicsBox.cpp Userland: Use mattco@serenityos.org for my copyright headers 2021-04-23 08:24:53 +02:00
SVGGraphicsBox.h Userland: Use mattco@serenityos.org for my copyright headers 2021-04-23 08:24:53 +02:00
SVGPathBox.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
SVGPathBox.h Userland: Use mattco@serenityos.org for my copyright headers 2021-04-23 08:24:53 +02:00
SVGSVGBox.cpp Userland: Use mattco@serenityos.org for my copyright headers 2021-04-23 08:24:53 +02:00
SVGSVGBox.h Userland: Use mattco@serenityos.org for my copyright headers 2021-04-23 08:24:53 +02:00
TableBox.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
TableBox.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
TableCellBox.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
TableCellBox.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
TableFormattingContext.cpp LibWeb: Rename Web::Frame to Web::BrowsingContext 2021-05-30 12:39:53 +02:00
TableFormattingContext.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
TableRowBox.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
TableRowBox.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
TableRowGroupBox.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
TableRowGroupBox.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
TextNode.cpp AK: Do not VERIFY on invalid code point bytes in UTF8View 2021-06-03 18:28:27 +04:30
TextNode.h LibWeb: Move Layout::TextNode whitespace collapse to separate function 2021-04-29 10:34:02 +02:00
TreeBuilder.cpp AK: Rename adopt() to adopt_ref() 2021-04-23 16:46:57 +02:00
TreeBuilder.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00