mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-25 19:56:30 +00:00
LibWeb: Use code unit offsets in Document::find_matching_text()
We were passing in byte offsets instead of UTF-16 code unit offsets, which could lead to crashes if the offsets found exceeded the number of code units in text fragments on the page. Fixes #4908. Co-authored-by: Tim Ledbetter <tim.ledbetter@ladybird.org>
This commit is contained in:
parent
cc0a28ee7d
commit
b42c2c5e8f
Notes:
github-actions[bot]
2025-06-13 13:10:45 +00:00
Author: https://github.com/gmta
Commit: b42c2c5e8f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5067
Reviewed-by: https://github.com/tcl3
Reviewed-by: https://github.com/trflynn89
5 changed files with 24 additions and 15 deletions
|
@ -24,7 +24,7 @@ public:
|
|||
size_t start_offset { 0 };
|
||||
};
|
||||
struct TextBlock {
|
||||
String text;
|
||||
AK::Utf16ConversionResult text;
|
||||
Vector<TextPosition> positions;
|
||||
};
|
||||
Vector<TextBlock> const& text_blocks();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue