dmsnell
0dc136bcb9
HTML API: Fix void tag nesting with next_token
...
When `next_token()` was introduced, it introduced a regression in the HTML
Processor whereby void tags remain on the stack of open elements when they
shouldn't. This led to invalid values returned from `get_breadcrumbs()`.
The reason was that calling `next_token()` works through a different code path
than the HTML Processor runs everything else. To solve this, its sub-classed
`next_token()` called `step( self::REPROCESS_CURRENT_TOKEN )` so that the proper
HTML accounting takes place.
Unfortunately that same reprocessing code path skipped the step whereby void
and self-closing elements are popped from the stack of open elements.
In this patch, that step is run with a third mode for `step()`, which is the
new `self::PROCESS_CURRENT_TOKEN`. This mode acts as if `self::PROCESS_NEXT_NODE`
were called, except it doesn't advance the parser.
Developed in https://github.com/WordPress/wordpress-develop/pull/5975
Discussed in https://core.trac.wordpress.org/ticket/60382
Follow-up to [57348]
Props dmsnell, jonsurrell
Fixes #60382
Built from https://develop.svn.wordpress.org/trunk@57507
git-svn-id: http://core.svn.wordpress.org/trunk@57008 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-01 00:43:15 +00:00
..
2024-01-31 12:59:56 +00:00
2024-01-31 02:54:17 +00:00
2024-01-31 12:59:56 +00:00
2024-01-31 12:59:56 +00:00
2024-01-28 07:50:18 +00:00
2023-09-25 21:29:17 +00:00
2024-02-01 00:43:15 +00:00
2023-10-20 13:29:27 +00:00
2024-01-22 11:43:18 +00:00
2024-01-31 12:59:56 +00:00
2024-01-31 21:51:14 +00:00
2023-10-26 20:33:22 +00:00
2023-11-26 19:27:25 +00:00
2024-01-25 17:08:17 +00:00
2023-11-08 19:47:26 +00:00
2024-01-31 10:41:14 +00:00
2023-11-02 00:04:24 +00:00
2023-04-30 14:08:23 +00:00
2024-01-31 02:54:17 +00:00
2024-01-18 22:13:16 +00:00
2023-11-26 16:43:30 +00:00
2023-09-29 19:47:21 +00:00
2023-12-13 21:18:19 +00:00
2023-05-14 17:58:24 +00:00
2024-01-31 13:01:58 +00:00
2023-09-27 17:40:20 +00:00
2024-01-25 12:48:16 +00:00
2024-01-24 23:41:06 +00:00
2023-10-27 18:18:22 +00:00
2024-01-31 09:11:17 +00:00
2023-06-22 14:57:24 +00:00
2023-12-15 14:33:25 +00:00
2024-01-25 17:36:15 +00:00
2023-07-09 20:17:29 +00:00
2023-09-26 00:27:12 +00:00
2023-08-24 09:01:16 +00:00
2023-04-05 13:12:26 +00:00
2023-05-12 21:35:21 +00:00
2023-09-14 12:46:20 +00:00
2023-09-08 09:32:23 +00:00
2023-09-09 09:28:26 +00:00
2023-06-27 15:26:27 +00:00
2023-09-14 12:46:20 +00:00
2023-09-14 12:46:20 +00:00
2023-07-09 20:17:29 +00:00
2023-05-08 22:37:24 +00:00
2024-01-31 13:01:58 +00:00
2023-11-02 00:04:24 +00:00
2023-06-27 00:45:38 +00:00
2023-06-27 00:45:38 +00:00
2023-10-16 19:17:19 +00:00
2023-10-17 15:48:23 +00:00
2023-09-29 10:20:30 +00:00
2023-06-23 06:29:23 +00:00
2023-10-12 12:34:33 +00:00
2024-01-31 09:11:17 +00:00
2024-01-31 09:11:17 +00:00
2023-08-21 17:51:19 +00:00
2024-01-23 22:28:15 +00:00
2023-08-24 08:44:24 +00:00
2024-01-28 07:50:18 +00:00
2024-01-03 16:22:20 +00:00
2023-09-25 21:05:21 +00:00
2023-09-10 09:04:18 +00:00
2023-09-10 09:04:18 +00:00
2023-09-10 09:04:18 +00:00
2024-01-18 22:13:16 +00:00
2023-12-14 10:23:27 +00:00
2023-09-08 09:32:23 +00:00
2023-11-25 21:19:30 +00:00
2023-12-16 09:31:29 +00:00
2023-07-09 20:17:29 +00:00
2023-12-16 09:38:25 +00:00
2023-08-10 01:06:21 +00:00
2023-09-18 12:41:18 +00:00
2023-06-24 17:17:23 +00:00
2023-09-21 18:29:12 +00:00
2023-06-22 14:57:24 +00:00
2023-06-22 14:36:26 +00:00
2023-10-11 07:05:25 +00:00
2023-09-21 18:29:12 +00:00
2024-01-31 13:03:57 +00:00
2023-08-19 00:10:23 +00:00
2023-09-08 09:32:23 +00:00
2023-09-07 14:59:21 +00:00
2023-09-09 09:28:26 +00:00
2024-01-25 07:53:17 +00:00
2023-07-09 21:25:23 +00:00
2023-09-09 09:28:26 +00:00
2023-05-11 11:15:24 +00:00
2023-10-06 14:06:22 +00:00
2023-03-10 16:30:03 +00:00
2023-07-12 09:46:25 +00:00
2023-03-14 16:55:19 +00:00
2023-07-09 21:25:23 +00:00
2023-10-10 14:05:21 +00:00
2024-01-19 17:40:09 +00:00
2023-05-02 15:45:22 +00:00
2023-12-24 13:05:21 +00:00
2023-05-02 15:45:22 +00:00
2023-09-09 09:28:26 +00:00
2023-09-08 09:32:23 +00:00
2023-07-28 11:37:25 +00:00
2024-01-31 08:31:29 +00:00
2023-10-13 18:46:21 +00:00
2023-08-10 01:06:21 +00:00
2023-08-10 01:06:21 +00:00
2023-06-22 14:36:26 +00:00
2023-05-02 15:45:22 +00:00
2024-01-03 21:59:19 +00:00
2023-04-27 23:15:17 +00:00
2023-11-01 15:10:20 +00:00
2023-09-08 09:32:23 +00:00
2023-10-15 14:55:23 +00:00
2024-01-24 07:57:14 +00:00
2023-09-08 09:32:23 +00:00
2024-01-10 00:27:15 +00:00
2023-10-02 11:27:24 +00:00
2024-01-31 10:55:10 +00:00
2023-10-20 19:08:21 +00:00
2023-09-07 20:45:16 +00:00
2023-12-15 12:37:29 +00:00
2023-09-09 09:28:26 +00:00
2023-08-25 01:28:16 +00:00
2023-09-20 19:31:20 +00:00
2023-08-13 10:31:23 +00:00
2024-01-03 21:59:19 +00:00
2023-09-25 21:05:21 +00:00
2023-09-29 17:13:24 +00:00
2024-01-23 13:34:11 +00:00
2024-01-03 21:59:19 +00:00
2023-09-26 17:33:20 +00:00
2024-01-17 21:36:16 +00:00
2024-01-19 17:40:09 +00:00
2023-09-25 17:06:34 +00:00
2023-05-02 15:45:22 +00:00
2023-07-29 00:31:35 +00:00
2023-07-09 21:48:22 +00:00
2024-01-03 22:13:18 +00:00
2024-01-17 09:09:15 +00:00
2024-01-23 13:34:11 +00:00
2023-11-01 15:10:20 +00:00
2023-12-07 22:57:28 +00:00
2024-01-18 22:13:16 +00:00
2023-08-03 12:10:28 +00:00
2023-09-22 19:08:19 +00:00
2023-07-10 22:38:25 +00:00
2024-01-31 12:59:56 +00:00
2023-12-26 14:24:21 +00:00
2024-01-25 07:53:17 +00:00
2024-01-28 16:40:17 +00:00
2024-01-31 21:28:15 +00:00
2023-09-26 14:45:23 +00:00
2024-01-16 17:03:13 +00:00
2023-09-26 15:32:19 +00:00
2023-11-20 22:29:24 +00:00
2023-07-10 22:48:22 +00:00
2023-06-22 14:57:24 +00:00
2023-08-23 15:53:24 +00:00
2023-11-13 11:13:27 +00:00
2023-07-10 22:48:22 +00:00
2023-05-02 11:26:24 +00:00
2023-06-22 14:57:24 +00:00
2023-09-09 09:28:26 +00:00
2024-01-01 14:17:16 +00:00
2023-07-10 22:48:22 +00:00
2023-11-14 12:44:27 +00:00
2023-12-24 13:05:21 +00:00
2023-06-08 07:54:22 +00:00
2023-08-22 12:30:29 +00:00
2023-05-17 18:31:24 +00:00
2024-01-12 16:49:16 +00:00
2023-08-24 09:01:16 +00:00
2024-01-19 17:40:09 +00:00
2023-10-23 13:17:22 +00:00
2023-07-11 11:15:27 +00:00
2024-01-28 08:19:17 +00:00
2024-01-31 08:31:29 +00:00
2024-01-31 18:16:14 +00:00
2024-01-03 21:59:19 +00:00
2023-09-14 04:56:21 +00:00
2024-01-23 10:10:18 +00:00
2023-10-01 00:22:27 +00:00
2023-12-22 14:52:21 +00:00
2023-12-08 06:32:24 +00:00
2023-10-13 17:21:22 +00:00
2024-01-23 13:07:16 +00:00
2024-01-09 11:41:18 +00:00
2023-09-12 15:23:18 +00:00
2024-01-19 17:40:09 +00:00
2023-09-20 20:51:19 +00:00
2024-02-01 00:43:15 +00:00
2024-01-28 08:19:17 +00:00