mirror of
https://github.com/servo/servo
synced 2026-05-05 06:32:13 +02:00
There was a bug where characters were not properly counted when segmeting IFC text. Immediately incrementing the `current_character_index` meant that the count was always one character off. This character count is mainly used for drawing selections and really matters when multiple text segments are in a single IFC. This change fixes that by counting characters in the same way we were counting byte indices for the text. Testing: This change adds a Servo-specific WPT-style test. As it is quite difficult to reproduce the correct display in a different way, a mismatch test is used. Since this is mainly about appearance and is very specific to our implementation the test is Servo-specific. Fixes: #42354. Signed-off-by: Martin Robinson <mrobinson@igalia.com>