mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-03 09:48:47 +00:00
LibWeb: Restore the previous tokenizer iterator after inserting input
Otherwise, m_prev_utf8_iterator still points at the old source.
This commit is contained in:
parent
fcf83a8ed0
commit
64dcd3f1f4
Notes:
sideshowbarker
2024-07-17 07:08:37 +09:00
Author: https://github.com/trflynn89
Commit: 64dcd3f1f4
Pull-request: https://github.com/SerenityOS/serenity/pull/23251
Issue: https://github.com/SerenityOS/serenity/issues/23241
1 changed files with 2 additions and 0 deletions
|
@ -2802,6 +2802,7 @@ HTMLTokenizer::HTMLTokenizer(StringView input, ByteString const& encoding)
|
|||
void HTMLTokenizer::insert_input_at_insertion_point(StringView input)
|
||||
{
|
||||
auto utf8_iterator_byte_offset = m_utf8_view.byte_offset_of(m_utf8_iterator);
|
||||
auto prev_utf8_iterator_byte_offset = m_utf8_view.byte_offset_of(m_prev_utf8_iterator);
|
||||
|
||||
// FIXME: Implement a InputStream to handle insertion_point and iterators.
|
||||
StringBuilder builder {};
|
||||
|
@ -2812,6 +2813,7 @@ void HTMLTokenizer::insert_input_at_insertion_point(StringView input)
|
|||
|
||||
m_utf8_view = Utf8View(m_decoded_input);
|
||||
m_utf8_iterator = m_utf8_view.iterator_at_byte_offset(utf8_iterator_byte_offset);
|
||||
m_prev_utf8_iterator = m_utf8_view.iterator_at_byte_offset(prev_utf8_iterator_byte_offset);
|
||||
|
||||
m_insertion_point.position += input.length();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue