Martin Robinson
2efa7d5d96
script: Add a Rope type and use it for TextInput ( #41650 )
...
`TextInput` internally stores a rope of text content, one segment for
each line. This change separates out the rope into a separate `Rope`
data structure that can be shared with other parts of Servo.
`TextInput` needs to move through text content in a variety of ways,
depending on the keys pressed when interacting with a text area. This
change provides a unified movement API in both `Rope` and in
`TextInput` ensuring that selection is handled consistently (apart from
a few minor quirks [^1]). This simplifies the code an improves
interactive behavior.
[^1]: One of these quirks is that the edit point will move to
directional end of the motion when collapsing a selection, but only when
moving by grapheme or word (and not by line). These quirks existed in an
undocumented way previously and they are preserved with code comments.
Testing: This is covered by existing unit tests (updated for the new
API) and
the WPT suite.
Signed-off-by: Martin Robinson <mrobinson@igalia.com >
2026-01-06 14:52:08 +00:00
..
2025-12-14 06:42:00 +00:00
2026-01-03 10:54:27 +00:00
2026-01-03 10:54:27 +00:00
2026-01-03 10:54:27 +00:00
2025-11-20 06:20:47 +00:00
2026-01-03 10:54:27 +00:00
2025-12-12 14:33:45 +00:00
2025-10-02 04:17:36 +00:00
2026-01-06 14:52:08 +00:00
2026-01-03 10:54:27 +00:00
2026-01-03 10:54:27 +00:00
2025-11-26 21:37:55 +00:00
2025-12-05 07:23:32 +00:00
2026-01-05 18:22:58 +00:00
2026-01-05 06:12:58 +00:00
2025-12-28 12:56:20 +00:00
2025-12-27 16:33:26 +00:00
2026-01-03 10:54:27 +00:00
2026-01-03 10:54:27 +00:00
2025-11-06 11:06:03 +00:00
2026-01-03 10:54:27 +00:00
2026-01-05 16:28:45 +00:00
2025-09-13 18:34:14 +00:00
2025-12-29 12:50:30 +00:00
2025-08-19 11:07:53 +00:00
2025-11-01 05:32:45 +00:00
2025-11-01 05:32:45 +00:00
2025-11-15 17:59:57 +00:00
2025-11-24 22:41:45 +00:00
2025-11-09 22:05:12 +00:00
2025-09-27 19:23:05 +00:00
2025-11-26 06:44:57 +00:00
2025-12-03 13:19:21 +00:00
2025-12-03 13:19:21 +00:00
2026-01-01 13:40:20 +00:00
2025-11-13 14:53:57 +00:00
2025-11-04 18:29:06 +00:00
2025-12-27 16:33:26 +00:00
2025-03-30 11:06:30 +00:00
2025-12-27 16:33:26 +00:00
2025-11-04 18:29:06 +00:00
2026-01-01 13:40:20 +00:00
2025-11-04 18:29:06 +00:00
2025-12-12 14:33:45 +00:00
2025-12-23 14:27:04 +00:00
2025-12-29 21:40:47 +00:00
2025-11-08 14:27:35 +00:00
2025-12-19 09:01:08 +00:00
2025-12-12 14:33:45 +00:00
2026-01-02 09:59:00 +00:00
2025-12-19 09:01:08 +00:00
2025-11-01 05:32:45 +00:00
2025-12-01 22:33:27 +00:00
2025-10-23 14:02:28 +00:00
2025-10-05 15:12:16 +00:00
2025-10-05 15:12:16 +00:00
2025-10-26 03:15:20 +00:00
2025-08-12 04:53:53 +00:00
2025-12-08 11:03:45 +00:00
2025-12-12 14:33:45 +00:00
2025-11-04 18:29:06 +00:00
2025-12-03 13:19:21 +00:00
2025-11-20 06:20:47 +00:00
2025-11-04 18:29:06 +00:00
2025-11-17 15:53:43 +00:00
2025-12-21 13:18:06 +00:00
2026-01-05 19:00:32 +00:00
2025-11-13 14:53:57 +00:00
2025-11-20 06:20:47 +00:00
2025-11-01 05:32:45 +00:00
2025-12-05 07:23:32 +00:00
2025-12-05 07:23:32 +00:00
2025-12-05 07:23:32 +00:00
2025-12-31 06:27:52 +00:00
2025-12-21 11:03:30 +00:00
2025-12-05 07:23:32 +00:00
2025-12-05 07:23:32 +00:00
2025-11-01 05:32:45 +00:00
2025-11-01 05:32:45 +00:00
2025-04-02 14:50:56 +00:00
2025-11-01 05:32:45 +00:00
2025-11-01 05:32:45 +00:00
2025-11-01 05:32:45 +00:00
2025-10-26 01:34:06 +00:00
2025-11-01 05:32:45 +00:00
2025-12-19 09:01:08 +00:00
2025-12-01 22:33:27 +00:00
2025-11-01 05:32:45 +00:00
2025-10-26 11:36:36 +00:00
2026-01-05 18:22:58 +00:00
2025-12-05 07:23:32 +00:00
2025-12-05 07:23:32 +00:00
2025-12-05 07:23:32 +00:00
2025-12-29 12:50:30 +00:00
2025-12-05 07:23:32 +00:00
2025-11-06 11:06:03 +00:00
2025-11-09 22:05:12 +00:00
2025-12-12 14:33:45 +00:00
2026-01-03 10:54:27 +00:00
2025-11-01 05:32:45 +00:00
2025-11-01 05:32:45 +00:00
2026-01-05 18:22:58 +00:00
2025-11-06 11:06:03 +00:00
2026-01-03 10:54:27 +00:00
2025-08-19 11:07:53 +00:00
2026-01-05 15:22:12 +00:00
2026-01-03 10:54:27 +00:00
2025-12-31 06:27:52 +00:00
2026-01-03 10:54:27 +00:00
2025-11-20 06:20:47 +00:00
2025-12-21 13:18:06 +00:00
2025-12-05 07:23:32 +00:00
2025-11-06 11:06:03 +00:00
2025-11-01 05:32:45 +00:00
2025-11-01 05:32:45 +00:00
2025-12-23 09:56:13 +00:00
2025-11-04 18:29:06 +00:00
2025-11-13 19:14:30 +00:00
2026-01-03 10:54:27 +00:00
2025-11-01 05:32:45 +00:00
2025-11-01 05:32:45 +00:00
2026-01-05 18:22:58 +00:00
2025-12-05 07:23:32 +00:00
2025-12-19 09:01:08 +00:00
2025-11-01 05:32:45 +00:00
2025-11-01 05:32:45 +00:00
2026-01-02 10:28:17 +00:00
2025-11-01 05:32:45 +00:00
2025-11-20 06:20:47 +00:00
2025-12-05 07:23:32 +00:00
2025-11-01 05:32:45 +00:00
2025-08-09 18:01:00 +00:00
2025-11-01 05:32:45 +00:00
2025-11-01 05:32:45 +00:00
2026-01-03 10:54:27 +00:00
2025-11-01 05:32:45 +00:00
2025-11-01 05:32:45 +00:00
2026-01-04 12:22:54 +00:00
2026-01-03 10:54:27 +00:00
2026-01-03 10:54:27 +00:00
2025-12-27 16:33:26 +00:00
2025-11-01 05:32:45 +00:00
2025-09-09 08:33:46 +00:00
2025-11-13 14:53:57 +00:00
2026-01-03 10:54:27 +00:00
2025-12-19 09:01:08 +00:00
2025-12-27 16:33:26 +00:00
2025-12-31 13:07:59 +00:00
2025-12-27 16:33:26 +00:00
2025-12-12 14:33:45 +00:00
2025-12-27 16:33:26 +00:00
2025-12-27 16:33:26 +00:00
2025-11-24 18:01:11 +00:00
2026-01-03 10:54:27 +00:00
2025-10-23 14:02:28 +00:00
2026-01-04 12:22:54 +00:00
2025-11-03 15:19:34 +00:00
2025-12-19 16:45:13 +00:00
2025-11-01 05:32:45 +00:00
2025-11-28 01:52:21 +00:00
2025-11-20 06:20:47 +00:00
2025-11-20 06:20:47 +00:00
2025-12-01 05:13:55 +00:00
2025-12-05 07:23:32 +00:00
2025-12-21 12:45:43 +00:00
2025-12-05 07:23:32 +00:00
2025-12-05 07:23:32 +00:00
2026-01-05 06:12:58 +00:00
2025-11-07 01:08:00 +00:00
2026-01-06 14:52:08 +00:00
2025-11-04 18:29:06 +00:00
2025-11-06 11:06:03 +00:00
2025-12-05 07:23:32 +00:00
2025-12-12 14:33:45 +00:00
2025-12-12 14:33:45 +00:00
2026-01-03 10:54:27 +00:00
2025-11-06 11:06:03 +00:00
2025-11-01 05:32:45 +00:00
2025-11-06 11:06:03 +00:00
2026-01-03 10:54:27 +00:00
2025-11-02 18:20:18 +00:00
2025-09-15 08:50:16 +00:00
2025-12-05 07:23:32 +00:00
2025-12-27 16:33:26 +00:00
2025-12-27 16:33:26 +00:00
2025-11-01 05:32:45 +00:00
2025-11-01 05:32:45 +00:00
2025-10-15 07:42:11 +00:00
2025-10-15 07:42:11 +00:00
2025-10-15 07:42:11 +00:00
2025-11-26 21:37:55 +00:00
2026-01-03 10:54:27 +00:00
2025-11-01 05:32:45 +00:00
2025-12-03 13:19:21 +00:00
2026-01-03 10:54:27 +00:00
2025-12-05 07:23:32 +00:00
2025-05-24 11:12:11 +00:00
2025-12-05 15:27:52 +00:00
2025-10-26 03:29:51 +00:00
2025-11-13 14:53:57 +00:00
2025-11-01 05:32:45 +00:00
2025-11-01 05:32:45 +00:00
2025-11-01 10:01:15 +00:00
2025-11-23 06:54:46 +00:00
2025-12-23 09:56:13 +00:00
2025-11-07 01:08:00 +00:00
2025-11-07 01:08:00 +00:00
2026-01-05 16:28:45 +00:00
2025-11-01 05:32:45 +00:00
2026-01-05 13:20:19 +00:00
2025-12-23 06:15:01 +00:00
2025-12-10 18:14:34 +00:00
2025-12-08 11:03:45 +00:00
2025-12-27 16:33:26 +00:00
2025-12-27 16:33:26 +00:00
2025-10-05 15:12:16 +00:00
2026-01-03 10:54:27 +00:00
2026-01-05 18:22:58 +00:00
2025-11-12 10:05:46 +00:00
2025-10-25 23:25:01 +00:00
2025-11-20 06:20:47 +00:00
2025-11-06 12:24:07 +00:00