mirror of
https://github.com/servo/servo
synced 2026-05-09 16:42:16 +02:00
This change updates and implements the old `query_text_index` layout query to properly look for the glyph index of a point within a node's `Fragment`s. This should work properly with the shadow DOM of both `<input>` and `<textarea>` elements. In particular, multiple lines are supported. Caveats: - `<input>` and `<textarea>` that are transformed are currently not supported. This will happen in a followup. - For multi-line inputs, we should be finding the text offset of the nearest line that is within the block range of the click. This will happen in a followup. Testing: This change adds two Servo-specific WPT-style tests. These are Servo-specific because the behavior of clicking in text fields isn't fully specified. Fixes: #35432 Fixes: #10083 Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Josh Matthews <josh@joshmatthews.net> Co-authored-by: Oriol Brufau <obrufau@igalia.com>