Simon Wülker
6cc0bfd6fd
script: Convert less between string types in range-related methods of HTMLInputElement ( #39846 )
...
The current code has snippets like
`self.convert_string_to_number(&DOMString::from(attr.summarize().value))`
in various places.
The snippet wants to take the value of an attribute and parse it as a
number. In theory this is an easy problem, the attribute internally
stores a `AttrValue` (which can be treated as `str`) and the conversion
code wants a `str` - no conversions or copies necessary!
But the reality of what happens is less ideal:
`attr.summarize` allocates a `AttrInfo` containing owned copies of the
attributes namespace, name and value. The name and value are also
converted from the `AttrValue` to a `DOMString` and then back to a
`String` in the process. And then we take the value field from
`AttrInfo` and create a new DOMString from it, passing that to
`self.self.convert_string_to_number` - which ends up internally calling
`str()` on it.
All in all this is not a big issue, because this code doesn't run often.
But it's also not hard to fix, and we end up with cleaner code in the
process.
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de >
2025-10-14 08:24:30 +00:00
..
2025-10-05 15:12:16 +00:00
2025-10-12 03:12:15 +00:00
2025-10-09 18:18:03 +00:00
2025-10-13 12:11:03 +00:00
2025-09-06 19:48:38 +00:00
2025-10-05 15:12:16 +00:00
2025-10-02 04:17:36 +00:00
2025-10-14 08:24:30 +00:00
2025-10-09 18:18:03 +00:00
2025-10-13 11:25:58 +00:00
2025-10-09 18:18:03 +00:00
2025-10-09 18:18:03 +00:00
2025-10-09 18:18:03 +00:00
2025-10-09 18:18:03 +00:00
2025-10-05 15:12:16 +00:00
2025-10-13 21:11:45 +00:00
2025-09-13 18:34:14 +00:00
2025-10-02 07:51:19 +00:00
2025-08-19 11:07:53 +00:00
2025-08-31 01:00:09 +00:00
2025-03-12 00:02:12 +00:00
2025-10-14 08:24:30 +00:00
2025-03-12 00:02:12 +00:00
2025-10-09 18:18:03 +00:00
2025-09-27 19:23:05 +00:00
2025-03-25 19:24:47 +00:00
2025-01-10 08:19:19 +00:00
2025-10-09 18:18:03 +00:00
2025-03-03 11:26:53 +00:00
2025-10-05 15:12:16 +00:00
2025-03-30 11:06:30 +00:00
2025-10-09 18:18:03 +00:00
2025-03-12 00:02:12 +00:00
2025-01-10 08:19:19 +00:00
2025-09-25 12:27:42 +00:00
2025-09-27 01:48:24 +00:00
2025-10-05 15:12:16 +00:00
2025-03-03 11:26:53 +00:00
2025-10-09 11:11:17 +00:00
2025-08-14 17:58:50 +00:00
2025-10-12 16:10:34 +00:00
2025-08-28 17:49:33 +00:00
2025-07-09 19:07:29 +00:00
2025-10-09 18:18:03 +00:00
2025-10-05 15:12:16 +00:00
2025-10-05 15:12:16 +00:00
2025-08-20 12:31:49 +00:00
2025-10-05 15:12:16 +00:00
2025-10-05 15:12:16 +00:00
2025-10-09 18:18:03 +00:00
2025-10-05 15:12:16 +00:00
2025-10-05 15:12:16 +00:00
2025-10-05 15:12:16 +00:00
2025-10-05 15:12:16 +00:00
2025-10-05 15:12:16 +00:00
2025-08-20 12:31:49 +00:00
2025-10-09 18:18:03 +00:00
2025-10-09 18:18:03 +00:00
2025-10-09 18:18:03 +00:00
2025-10-09 18:18:03 +00:00
2025-03-03 11:26:53 +00:00
2025-10-05 15:12:16 +00:00
2025-10-09 18:18:03 +00:00
2025-03-31 17:15:48 +00:00
2025-10-09 18:18:03 +00:00
2025-10-09 18:18:03 +00:00
2025-10-05 15:12:16 +00:00
2025-10-05 15:12:16 +00:00
2025-08-09 18:01:00 +00:00
2025-08-12 04:53:53 +00:00
2025-10-09 18:18:03 +00:00
2025-10-05 15:12:16 +00:00
2025-10-05 15:12:16 +00:00
2025-03-03 11:26:53 +00:00
2025-09-28 08:00:20 +00:00
2025-10-14 07:56:33 +00:00
2025-10-11 10:27:23 +00:00
2025-10-14 00:00:12 +00:00
2025-09-10 13:34:54 +00:00
2025-10-05 15:12:16 +00:00
2025-04-08 02:33:21 +00:00
2025-10-09 18:18:03 +00:00
2025-10-06 17:23:03 +00:00
2025-09-09 08:33:46 +00:00
2025-09-27 19:23:05 +00:00
2025-10-06 17:23:03 +00:00
2025-09-09 08:33:46 +00:00
2025-09-09 08:33:46 +00:00
2025-09-09 08:33:46 +00:00
2025-09-09 08:33:46 +00:00
2025-04-02 14:50:56 +00:00
2025-09-09 08:33:46 +00:00
2025-06-20 03:16:46 +00:00
2025-08-31 01:00:09 +00:00
2025-10-09 18:18:03 +00:00
2025-10-05 15:12:16 +00:00
2025-10-09 18:18:03 +00:00
2025-09-25 12:16:50 +00:00
2025-03-31 17:15:48 +00:00
2025-10-11 10:27:23 +00:00
2025-10-09 18:18:03 +00:00
2025-10-09 18:18:03 +00:00
2025-09-27 19:23:05 +00:00
2025-03-19 18:03:09 +00:00
2025-10-02 07:51:19 +00:00
2025-10-09 18:18:03 +00:00
2025-08-19 11:07:53 +00:00
2025-09-27 19:23:05 +00:00
2025-03-03 11:26:53 +00:00
2025-03-31 17:15:48 +00:00
2025-10-05 15:12:16 +00:00
2025-10-05 15:12:16 +00:00
2025-10-09 18:18:03 +00:00
2025-04-02 14:50:56 +00:00
2025-10-10 11:34:42 +00:00
2025-09-03 19:24:48 +00:00
2025-03-12 00:02:12 +00:00
2025-08-19 11:07:53 +00:00
2025-09-22 13:59:36 +00:00
2025-09-28 08:00:20 +00:00
2025-09-28 08:00:20 +00:00
2025-09-28 08:00:20 +00:00
2025-09-11 12:48:18 +00:00
2025-08-21 22:54:19 +00:00
2025-09-28 08:00:20 +00:00
2025-09-28 08:00:20 +00:00
2025-09-28 08:00:20 +00:00
2025-09-28 08:00:20 +00:00
2025-09-28 08:00:20 +00:00
2025-06-20 07:42:36 +00:00
2025-08-07 18:49:38 +00:00
2025-10-09 18:18:03 +00:00
2025-03-18 11:09:44 +00:00
2025-10-09 18:18:03 +00:00
2025-10-06 17:23:03 +00:00
2025-10-09 18:03:47 +00:00
2025-03-03 11:26:53 +00:00
2025-03-30 11:06:30 +00:00
2025-03-03 11:26:53 +00:00
2025-08-19 11:07:53 +00:00
2025-10-09 18:18:03 +00:00
2025-03-03 11:26:53 +00:00
2025-09-21 18:57:10 +00:00
2025-03-12 00:02:12 +00:00
2025-10-05 15:12:16 +00:00
2025-09-27 01:48:24 +00:00
2025-03-03 11:26:53 +00:00
2025-03-03 11:26:53 +00:00
2025-03-19 18:03:09 +00:00
2025-09-09 08:33:46 +00:00
2025-01-10 08:19:19 +00:00
2025-03-03 11:26:53 +00:00
2025-10-08 17:56:05 +00:00
2025-10-09 18:18:03 +00:00
2025-10-09 18:18:03 +00:00
2025-03-03 11:26:53 +00:00
2025-09-25 12:16:50 +00:00
2025-03-03 11:26:53 +00:00
2025-10-09 18:18:03 +00:00
2025-04-01 22:59:50 +00:00
2025-10-09 18:18:03 +00:00
2025-10-05 15:12:16 +00:00
2025-08-31 01:00:09 +00:00
2025-10-05 15:12:16 +00:00
2025-03-12 00:02:12 +00:00
2025-03-03 11:26:53 +00:00
2025-10-05 15:12:16 +00:00
2025-10-09 18:18:03 +00:00
2025-03-03 11:26:53 +00:00
2025-03-03 11:26:53 +00:00
2025-02-20 16:17:45 +00:00
2025-10-09 18:18:03 +00:00
2025-03-03 11:26:53 +00:00
2025-02-20 16:17:45 +00:00
2025-08-18 12:09:09 +00:00
2025-09-08 09:21:42 +00:00
2025-03-16 13:46:14 +00:00
2025-08-09 18:01:00 +00:00
2025-01-10 08:19:19 +00:00
2025-03-03 11:26:53 +00:00
2025-08-04 16:27:00 +00:00
2025-03-12 00:02:12 +00:00
2025-01-10 08:19:19 +00:00
2025-10-03 04:14:31 +00:00
2025-04-13 01:41:39 +00:00
2025-10-05 15:12:16 +00:00
2025-03-03 11:26:53 +00:00
2025-03-12 00:02:12 +00:00
2025-09-09 08:33:46 +00:00
2025-08-31 01:00:09 +00:00
2025-10-12 03:12:15 +00:00
2025-08-31 01:00:09 +00:00
2025-08-19 11:07:53 +00:00
2025-10-05 15:12:16 +00:00
2025-10-05 15:12:16 +00:00
2025-03-16 13:46:14 +00:00
2025-08-20 08:43:58 +00:00
2025-10-05 15:12:16 +00:00
2025-05-08 08:45:57 +00:00
2025-10-09 18:18:03 +00:00
2025-10-09 18:18:03 +00:00
2025-10-09 18:18:03 +00:00
2025-10-05 15:12:16 +00:00
2025-03-19 18:03:09 +00:00
2025-03-03 11:26:53 +00:00
2025-09-27 01:52:01 +00:00
2025-08-29 12:44:21 +00:00
2025-09-26 22:12:37 +00:00
2025-05-08 10:46:31 +00:00
2025-09-27 19:23:05 +00:00
2025-08-30 16:51:58 +00:00
2025-09-24 08:04:56 +00:00
2025-08-19 11:07:53 +00:00
2025-09-29 17:13:34 +00:00
2025-03-12 00:02:12 +00:00
2025-10-09 18:18:03 +00:00
2025-07-23 08:16:01 +00:00
2025-08-20 12:31:49 +00:00
2025-07-23 08:16:01 +00:00
2025-08-31 01:00:09 +00:00
2025-10-13 06:36:39 +00:00
2025-08-22 14:05:32 +00:00
2025-03-12 00:02:12 +00:00
2025-10-09 18:03:47 +00:00
2025-10-09 18:03:47 +00:00
2025-10-09 18:18:03 +00:00
2025-09-27 19:23:05 +00:00
2025-10-09 18:18:03 +00:00
2025-07-29 04:18:15 +00:00
2025-10-09 18:18:03 +00:00
2025-03-03 11:26:53 +00:00
2025-08-15 07:57:00 +00:00
2025-09-25 12:16:50 +00:00
2025-02-20 16:17:45 +00:00
2025-03-03 11:26:53 +00:00
2025-04-02 14:50:56 +00:00
2025-03-03 11:26:53 +00:00
2025-03-03 11:26:53 +00:00
2025-09-15 08:50:16 +00:00
2025-03-03 11:26:53 +00:00
2025-08-24 05:15:44 +00:00
2025-10-05 15:12:16 +00:00
2025-10-05 15:12:16 +00:00
2025-03-12 00:02:12 +00:00
2025-09-27 19:23:05 +00:00
2025-10-09 18:18:03 +00:00
2025-10-09 18:18:03 +00:00
2025-10-09 18:18:03 +00:00
2025-10-05 15:12:16 +00:00
2025-10-09 18:18:03 +00:00
2025-03-12 00:02:12 +00:00
2025-08-19 11:07:53 +00:00
2025-10-09 18:18:03 +00:00
2025-01-10 08:19:19 +00:00
2025-05-24 11:12:11 +00:00
2025-03-03 11:26:53 +00:00
2025-08-31 01:00:09 +00:00
2025-09-17 02:23:14 +00:00
2025-08-31 01:00:09 +00:00
2025-01-10 08:19:19 +00:00
2025-03-03 11:26:53 +00:00
2025-08-31 01:00:09 +00:00
2025-08-31 01:00:09 +00:00
2025-02-20 16:17:45 +00:00
2025-04-02 14:50:56 +00:00
2025-04-02 14:50:56 +00:00
2025-10-09 18:18:03 +00:00
2025-08-04 16:27:00 +00:00
2025-10-10 11:34:42 +00:00
2025-10-09 18:18:03 +00:00
2025-10-12 12:13:19 +00:00
2025-09-28 08:00:20 +00:00
2025-10-05 15:12:16 +00:00
2025-10-05 15:12:16 +00:00
2025-10-05 15:12:16 +00:00
2025-10-06 17:23:03 +00:00
2025-10-09 18:18:03 +00:00
2025-01-10 08:19:19 +00:00
2025-02-20 16:17:45 +00:00
2025-03-03 11:26:53 +00:00
2025-10-11 08:28:01 +00:00
2025-10-13 13:20:55 +00:00
2025-09-30 19:55:10 +00:00