Martin Robinson
e4822c9c5d
script: More thoroughly convert between UTF-16 and UTF-8 offsets in text inputs ( #41588 )
...
DOM APIs for interacting with selection and text in text inputs
`<input type=text>` and `<textarea>` all accept offsets and lengths in
UTF-16 code units. Servo was not converting all of these offsets into
UTF-8 code units. This change makes it so that this conversion is done
more thoroughly and makes it clear when the code is dealing with UTF-8
offsets and UTF-16 offsets.
Helper functions are added for doing this conversion in both directions
as it is necessary. In addition, a `char` iterator is added for
`TextInput` as it is useful for doing this conversion. It will be used
more completely in the future when a `Rope` data structure is extracted
from `TextInput`.
Finally, specification text is added to all of the DOM implementation
touched here.
Testing: This change includes a new WPT crash test as well as a series
of unit
tests to verify conversion between UTF-8 and UTF-16 offsets.
Fixes #36719 .
Fixes #20028 .
Fixes #39184 .
Signed-off-by: Martin Robinson <mrobinson@igalia.com >
2025-12-31 09:29:25 +00:00
..
2025-12-14 06:42:00 +00:00
2025-12-12 14:33:45 +00:00
2025-12-05 07:23:32 +00:00
2025-12-31 06:27:52 +00:00
2025-11-20 06:20:47 +00:00
2025-12-31 06:27:52 +00:00
2025-12-12 14:33:45 +00:00
2025-10-02 04:17:36 +00:00
2025-12-31 09:29:25 +00:00
2025-12-23 14:09:48 +00:00
2025-12-31 06:27:52 +00:00
2025-11-26 21:37:55 +00:00
2025-12-05 07:23:32 +00:00
2025-12-30 13:10:29 +00:00
2025-12-30 11:46:10 +00:00
2025-12-28 12:56:20 +00:00
2025-12-27 16:33:26 +00:00
2025-12-07 22:18:46 +00:00
2025-12-12 14:33:45 +00:00
2025-11-06 11:06:03 +00:00
2025-12-12 14:33:45 +00:00
2025-12-29 21:40:47 +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
2025-12-03 13:19:21 +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-12-27 16:33:26 +00:00
2025-11-04 18:29:06 +00:00
2025-11-24 13:49:51 +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
2025-12-30 11:46:10 +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
2025-12-29 12:50:30 +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-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
2025-12-30 13:10:29 +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
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-12-30 18:19:41 +00:00
2025-11-06 11:06:03 +00:00
2025-11-01 05:32:45 +00:00
2025-08-19 11:07:53 +00:00
2025-11-20 06:20:47 +00:00
2025-12-10 15:09:49 +00:00
2025-12-31 06:27:52 +00:00
2025-11-01 05:32:45 +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
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-12-21 13:18:06 +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
2025-12-30 13:10:29 +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
2025-08-04 16:27:00 +00:00
2025-11-01 05:32:45 +00:00
2025-11-01 05:32:45 +00:00
2025-12-30 13:10:29 +00:00
2025-11-01 05:32:45 +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-09-09 08:33:46 +00:00
2025-11-13 14:53:57 +00:00
2025-11-20 19:34:02 +00:00
2025-12-19 09:01:08 +00:00
2025-12-27 16:33:26 +00:00
2025-12-27 16:33:26 +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
2025-12-30 13:10:29 +00:00
2025-10-23 14:02:28 +00:00
2025-12-19 16:45:13 +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
2025-12-30 12:36:43 +00:00
2025-11-07 01:08:00 +00:00
2025-12-31 09:29:25 +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
2025-11-01 05:32:45 +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
2025-11-07 01:08:00 +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
2025-11-06 11:06:03 +00:00
2025-11-01 05:32:45 +00:00
2025-12-03 13:19:21 +00:00
2025-10-09 18:18:03 +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
2025-11-20 06:20:47 +00:00
2025-11-01 05:32:45 +00:00
2025-12-27 13:11:37 +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
2025-11-01 05:32:45 +00:00
2025-12-30 18:19:41 +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