<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[58679] trunk/src/wp-includes/html-api: HTML API: Stub out remaining insertion modes in the HTML Processor.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/58679">58679</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/58679","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>dmsnell</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2024-07-05 16:37:41 +0000 (Fri, 05 Jul 2024)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>HTML API: Stub out remaining insertion modes in the HTML Processor.

As part of work to add more spec support to the HTML API, this patch adds
stubs for all of the remaining parser insertion modes in the HTML Processor.
These modes are not all supported yet, but they will be necessary to continue
adding support for other tags and markup.

Developed in https://github.com/WordPress/wordpress-develop/pull/6973
Discussed in https://core.trac.wordpress.org/ticket/61576

Props dmsnell, jonsurrell.
See <a href="https://core.trac.wordpress.org/ticket/61576">#61576</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludeshtmlapiclasswphtmlprocessorstatephp">trunk/src/wp-includes/html-api/class-wp-html-processor-state.php</a></li>
<li><a href="#trunksrcwpincludeshtmlapiclasswphtmlprocessorphp">trunk/src/wp-includes/html-api/class-wp-html-processor.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludeshtmlapiclasswphtmlprocessorstatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/html-api/class-wp-html-processor-state.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/html-api/class-wp-html-processor-state.php  2024-07-05 10:10:50 UTC (rev 58678)
+++ trunk/src/wp-includes/html-api/class-wp-html-processor-state.php    2024-07-05 16:37:41 UTC (rev 58679)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,42 +48,78 @@
</span><span class="cx" style="display: block; padding: 0 10px">        const INSERTION_MODE_INITIAL = 'insertion-mode-initial';
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * In body insertion mode for full HTML parser.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * Before HTML insertion mode for full HTML parser.
</ins><span class="cx" style="display: block; padding: 0 10px">          *
</span><span class="cx" style="display: block; padding: 0 10px">         * @since 6.4.0
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * @see https://html.spec.whatwg.org/#parsing-main-inbody
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * @see https://html.spec.whatwg.org/#the-before-html-insertion-mode
</ins><span class="cx" style="display: block; padding: 0 10px">          * @see WP_HTML_Processor_State::$insertion_mode
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @var string
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        const INSERTION_MODE_IN_BODY = 'insertion-mode-in-body';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ const INSERTION_MODE_BEFORE_HTML = 'insertion-mode-before-html';
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * In select insertion mode for full HTML parser.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * Before head insertion mode for full HTML parser.
</ins><span class="cx" style="display: block; padding: 0 10px">          *
</span><span class="cx" style="display: block; padding: 0 10px">         * @since 6.7.0
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * @see https://html.spec.whatwg.org/#parsing-main-inselect
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * @see https://html.spec.whatwg.org/#parsing-main-beforehead
</ins><span class="cx" style="display: block; padding: 0 10px">          * @see WP_HTML_Processor_State::$insertion_mode
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @var string
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        const INSERTION_MODE_IN_SELECT = 'insertion-mode-in-select';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ const INSERTION_MODE_BEFORE_HEAD = 'insertion-mode-before-head';
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * In select in table insertion mode for full HTML parser.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * In head insertion mode for full HTML parser.
</ins><span class="cx" style="display: block; padding: 0 10px">          *
</span><span class="cx" style="display: block; padding: 0 10px">         * @since 6.7.0
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * @see https://html.spec.whatwg.org/#parsing-main-inselectintable
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * @see https://html.spec.whatwg.org/#parsing-main-inhead
</ins><span class="cx" style="display: block; padding: 0 10px">          * @see WP_HTML_Processor_State::$insertion_mode
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @var string
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        const INSERTION_MODE_IN_SELECT_IN_TABLE = 'insertion-mode-in-select-in-table';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ const INSERTION_MODE_IN_HEAD = 'insertion-mode-in-head';
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         * In head noscript insertion mode for full HTML parser.
+        *
+        * @since 6.7.0
+        *
+        * @see https://html.spec.whatwg.org/#parsing-main-inheadnoscript
+        * @see WP_HTML_Processor_State::$insertion_mode
+        *
+        * @var string
+        */
+       const INSERTION_MODE_IN_HEAD_NOSCRIPT = 'insertion-mode-in-head-noscript';
+
+       /**
+        * After head insertion mode for full HTML parser.
+        *
+        * @since 6.7.0
+        *
+        * @see https://html.spec.whatwg.org/#parsing-main-afterhead
+        * @see WP_HTML_Processor_State::$insertion_mode
+        *
+        * @var string
+        */
+       const INSERTION_MODE_AFTER_HEAD = 'insertion-mode-after-head';
+
+       /**
+        * In body insertion mode for full HTML parser.
+        *
+        * @since 6.4.0
+        *
+        * @see https://html.spec.whatwg.org/#parsing-main-inbody
+        * @see WP_HTML_Processor_State::$insertion_mode
+        *
+        * @var string
+        */
+       const INSERTION_MODE_IN_BODY = 'insertion-mode-in-body';
+
+       /**
</ins><span class="cx" style="display: block; padding: 0 10px">          * In table insertion mode for full HTML parser.
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @since 6.7.0
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -96,6 +132,18 @@
</span><span class="cx" style="display: block; padding: 0 10px">        const INSERTION_MODE_IN_TABLE = 'insertion-mode-in-table';
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         * In table text insertion mode for full HTML parser.
+        *
+        * @since 6.7.0
+        *
+        * @see https://html.spec.whatwg.org/#parsing-main-intabletext
+        * @see WP_HTML_Processor_State::$insertion_mode
+        *
+        * @var string
+        */
+       const INSERTION_MODE_IN_TABLE_TEXT = 'insertion-mode-in-table-text';
+
+       /**
</ins><span class="cx" style="display: block; padding: 0 10px">          * In caption insertion mode for full HTML parser.
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @since 6.7.0
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -108,6 +156,18 @@
</span><span class="cx" style="display: block; padding: 0 10px">        const INSERTION_MODE_IN_CAPTION = 'insertion-mode-in-caption';
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         * In column group insertion mode for full HTML parser.
+        *
+        * @since 6.7.0
+        *
+        * @see https://html.spec.whatwg.org/#parsing-main-incolumngroup
+        * @see WP_HTML_Processor_State::$insertion_mode
+        *
+        * @var string
+        */
+       const INSERTION_MODE_IN_COLUMN_GROUP = 'insertion-mode-in-column-group';
+
+       /**
</ins><span class="cx" style="display: block; padding: 0 10px">          * In table body insertion mode for full HTML parser.
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @since 6.7.0
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -144,18 +204,54 @@
</span><span class="cx" style="display: block; padding: 0 10px">        const INSERTION_MODE_IN_CELL = 'insertion-mode-in-cell';
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * In column group insertion mode for full HTML parser.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * In select insertion mode for full HTML parser.
</ins><span class="cx" style="display: block; padding: 0 10px">          *
</span><span class="cx" style="display: block; padding: 0 10px">         * @since 6.7.0
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * @see https://html.spec.whatwg.org/#parsing-main-incolumngroup
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * @see https://html.spec.whatwg.org/#parsing-main-inselect
</ins><span class="cx" style="display: block; padding: 0 10px">          * @see WP_HTML_Processor_State::$insertion_mode
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @var string
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        const INSERTION_MODE_IN_COLUMN_GROUP = 'insertion-mode-in-column-group';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ const INSERTION_MODE_IN_SELECT = 'insertion-mode-in-select';
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         * In select in table insertion mode for full HTML parser.
+        *
+        * @since 6.7.0
+        *
+        * @see https://html.spec.whatwg.org/#parsing-main-inselectintable
+        * @see WP_HTML_Processor_State::$insertion_mode
+        *
+        * @var string
+        */
+       const INSERTION_MODE_IN_SELECT_IN_TABLE = 'insertion-mode-in-select-in-table';
+
+       /**
+        * In template insertion mode for full HTML parser.
+        *
+        * @since 6.7.0
+        *
+        * @see https://html.spec.whatwg.org/#parsing-main-intemplate
+        * @see WP_HTML_Processor_State::$insertion_mode
+        *
+        * @var string
+        */
+       const INSERTION_MODE_IN_TEMPLATE = 'insertion-mode-in-template';
+
+       /**
+        * After body insertion mode for full HTML parser.
+        *
+        * @since 6.7.0
+        *
+        * @see https://html.spec.whatwg.org/#parsing-main-afterbody
+        * @see WP_HTML_Processor_State::$insertion_mode
+        *
+        * @var string
+        */
+       const INSERTION_MODE_AFTER_BODY = 'insertion-mode-after-body';
+
+       /**
</ins><span class="cx" style="display: block; padding: 0 10px">          * In frameset insertion mode for full HTML parser.
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @since 6.7.0
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -168,52 +264,52 @@
</span><span class="cx" style="display: block; padding: 0 10px">        const INSERTION_MODE_IN_FRAMESET = 'insertion-mode-in-frameset';
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * In head insertion mode for full HTML parser.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * After frameset insertion mode for full HTML parser.
</ins><span class="cx" style="display: block; padding: 0 10px">          *
</span><span class="cx" style="display: block; padding: 0 10px">         * @since 6.7.0
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * @see https://html.spec.whatwg.org/#parsing-main-inhead
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * @see https://html.spec.whatwg.org/#parsing-main-afterframeset
</ins><span class="cx" style="display: block; padding: 0 10px">          * @see WP_HTML_Processor_State::$insertion_mode
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @var string
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        const INSERTION_MODE_IN_HEAD = 'insertion-mode-in-head';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ const INSERTION_MODE_AFTER_FRAMESET = 'insertion-mode-after-frameset';
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * Before head insertion mode for full HTML parser.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * After after body insertion mode for full HTML parser.
</ins><span class="cx" style="display: block; padding: 0 10px">          *
</span><span class="cx" style="display: block; padding: 0 10px">         * @since 6.7.0
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * @see https://html.spec.whatwg.org/#parsing-main-beforehead
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * @see https://html.spec.whatwg.org/#the-after-after-body-insertion-mode
</ins><span class="cx" style="display: block; padding: 0 10px">          * @see WP_HTML_Processor_State::$insertion_mode
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @var string
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        const INSERTION_MODE_BEFORE_HEAD = 'insertion-mode-before-head';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ const INSERTION_MODE_AFTER_AFTER_BODY = 'insertion-mode-after-after-body';
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * After head insertion mode for full HTML parser.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * After after frameset insertion mode for full HTML parser.
</ins><span class="cx" style="display: block; padding: 0 10px">          *
</span><span class="cx" style="display: block; padding: 0 10px">         * @since 6.7.0
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * @see https://html.spec.whatwg.org/#parsing-main-afterhead
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * @see https://html.spec.whatwg.org/#the-after-after-frameset-insertion-mode
</ins><span class="cx" style="display: block; padding: 0 10px">          * @see WP_HTML_Processor_State::$insertion_mode
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @var string
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        const INSERTION_MODE_AFTER_HEAD = 'insertion-mode-after-head';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ const INSERTION_MODE_AFTER_AFTER_FRAMESET = 'insertion-mode-after-after-frameset';
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * In template insertion mode for full HTML parser.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * In foreign content insertion mode for full HTML parser.
</ins><span class="cx" style="display: block; padding: 0 10px">          *
</span><span class="cx" style="display: block; padding: 0 10px">         * @since 6.7.0
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * @see https://html.spec.whatwg.org/#parsing-main-intemplate
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * @see https://html.spec.whatwg.org/#parsing-main-inforeign
</ins><span class="cx" style="display: block; padding: 0 10px">          * @see WP_HTML_Processor_State::$insertion_mode
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @var string
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        const INSERTION_MODE_IN_TEMPLATE = 'insertion-mode-in-template';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ const INSERTION_MODE_IN_FOREIGN_CONTENT = 'insertion-mode-in-foreign-content';
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><span class="cx" style="display: block; padding: 0 10px">         * The stack of template insertion modes.
</span></span></pre></div>
<a id="trunksrcwpincludeshtmlapiclasswphtmlprocessorphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/html-api/class-wp-html-processor.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/html-api/class-wp-html-processor.php        2024-07-05 10:10:50 UTC (rev 58678)
+++ trunk/src/wp-includes/html-api/class-wp-html-processor.php  2024-07-05 16:37:41 UTC (rev 58679)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -754,18 +754,79 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                try {
</span><span class="cx" style="display: block; padding: 0 10px">                        switch ( $this->state->insertion_mode ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                case WP_HTML_Processor_State::INSERTION_MODE_IN_BODY:
-                                       return $this->step_in_body();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         case WP_HTML_Processor_State::INSERTION_MODE_INITIAL:
+                                       return $this->step_initial();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                case WP_HTML_Processor_State::INSERTION_MODE_BEFORE_HTML:
+                                       return $this->step_before_html();
+
+                               case WP_HTML_Processor_State::INSERTION_MODE_BEFORE_HEAD:
+                                       return $this->step_before_head();
+
</ins><span class="cx" style="display: block; padding: 0 10px">                                 case WP_HTML_Processor_State::INSERTION_MODE_IN_HEAD:
</span><span class="cx" style="display: block; padding: 0 10px">                                        return $this->step_in_head();
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                case WP_HTML_Processor_State::INSERTION_MODE_IN_HEAD_NOSCRIPT:
+                                       return $this->step_in_head_noscript();
+
+                               case WP_HTML_Processor_State::INSERTION_MODE_AFTER_HEAD:
+                                       return $this->step_after_head();
+
+                               case WP_HTML_Processor_State::INSERTION_MODE_IN_BODY:
+                                       return $this->step_in_body();
+
+                               case WP_HTML_Processor_State::INSERTION_MODE_IN_TABLE:
+                                       return $this->step_in_table();
+
+                               case WP_HTML_Processor_State::INSERTION_MODE_IN_TABLE_TEXT:
+                                       return $this->step_in_table_text();
+
+                               case WP_HTML_Processor_State::INSERTION_MODE_IN_CAPTION:
+                                       return $this->step_in_caption();
+
+                               case WP_HTML_Processor_State::INSERTION_MODE_IN_COLUMN_GROUP:
+                                       return $this->step_in_column_group();
+
+                               case WP_HTML_Processor_State::INSERTION_MODE_IN_TABLE_BODY:
+                                       return $this->step_in_table_body();
+
+                               case WP_HTML_Processor_State::INSERTION_MODE_IN_ROW:
+                                       return $this->step_in_row();
+
+                               case WP_HTML_Processor_State::INSERTION_MODE_IN_CELL:
+                                       return $this->step_in_cell();
+
</ins><span class="cx" style="display: block; padding: 0 10px">                                 case WP_HTML_Processor_State::INSERTION_MODE_IN_SELECT:
</span><span class="cx" style="display: block; padding: 0 10px">                                        return $this->step_in_select();
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                case WP_HTML_Processor_State::INSERTION_MODE_IN_SELECT_IN_TABLE:
+                                       return $this->step_in_select_in_table();
+
+                               case WP_HTML_Processor_State::INSERTION_MODE_IN_TEMPLATE:
+                                       return $this->step_in_template();
+
+                               case WP_HTML_Processor_State::INSERTION_MODE_AFTER_BODY:
+                                       return $this->step_after_body();
+
+                               case WP_HTML_Processor_State::INSERTION_MODE_IN_FRAMESET:
+                                       return $this->step_in_frameset();
+
+                               case WP_HTML_Processor_State::INSERTION_MODE_AFTER_FRAMESET:
+                                       return $this->step_after_frameset();
+
+                               case WP_HTML_Processor_State::INSERTION_MODE_AFTER_AFTER_BODY:
+                                       return $this->step_after_after_body();
+
+                               case WP_HTML_Processor_State::INSERTION_MODE_AFTER_AFTER_FRAMESET:
+                                       return $this->step_after_after_frameset();
+
+                               case WP_HTML_Processor_State::INSERTION_MODE_IN_FOREIGN_CONTENT:
+                                       return $this->step_in_foreign_content();
+
+                               // This should be unreachable but PHP doesn't have total type checking on switch.
</ins><span class="cx" style="display: block; padding: 0 10px">                                 default:
</span><span class="cx" style="display: block; padding: 0 10px">                                        $this->last_error = self::ERROR_UNSUPPORTED;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 throw new WP_HTML_Unsupported_Exception( "Found unrecognized insertion mode '{$this->state->insertion_mode}'." );
</ins><span class="cx" style="display: block; padding: 0 10px">                         }
</span><span class="cx" style="display: block; padding: 0 10px">                } catch ( WP_HTML_Unsupported_Exception $e ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        /*
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -871,6 +932,126 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         * Parses next element in the 'initial' insertion mode.
+        *
+        * This internal function performs the 'initial' insertion mode
+        * logic for the generalized WP_HTML_Processor::step() function.
+        *
+        * @since 6.7.0
+        *
+        * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input.
+        *
+        * @see https://html.spec.whatwg.org/#the-initial-insertion-mode
+        * @see WP_HTML_Processor::step
+        *
+        * @return bool Whether an element was found.
+        */
+       private function step_initial() {
+               $this->last_error = self::ERROR_UNSUPPORTED;
+               throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." );
+       }
+
+       /**
+        * Parses next element in the 'before html' insertion mode.
+        *
+        * This internal function performs the 'before html' insertion mode
+        * logic for the generalized WP_HTML_Processor::step() function.
+        *
+        * @since 6.7.0 Stub implementation.
+        *
+        * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input.
+        *
+        * @see https://html.spec.whatwg.org/#the-before-html-insertion-mode
+        * @see WP_HTML_Processor::step
+        *
+        * @return bool Whether an element was found.
+        */
+       private function step_before_html() {
+               $this->last_error = self::ERROR_UNSUPPORTED;
+               throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." );
+       }
+
+       /**
+        * Parses next element in the 'before head' insertion mode.
+        *
+        * This internal function performs the 'before head' insertion mode
+        * logic for the generalized WP_HTML_Processor::step() function.
+        *
+        * @since 6.7.0 Stub implementation.
+        *
+        * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input.
+        *
+        * @see https://html.spec.whatwg.org/#the-before-head-insertion-mode
+        * @see WP_HTML_Processor::step
+        *
+        * @return bool Whether an element was found.
+        */
+       private function step_before_head() {
+               $this->last_error = self::ERROR_UNSUPPORTED;
+               throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." );
+       }
+
+       /**
+        * Parses next element in the 'in head' insertion mode.
+        *
+        * This internal function performs the 'in head' insertion mode
+        * logic for the generalized WP_HTML_Processor::step() function.
+        *
+        * @since 6.7.0 Stub implementation.
+        *
+        * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input.
+        *
+        * @see https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inhead
+        * @see WP_HTML_Processor::step
+        *
+        * @return bool Whether an element was found.
+        */
+       private function step_in_head() {
+               $this->last_error = self::ERROR_UNSUPPORTED;
+               throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." );
+       }
+
+       /**
+        * Parses next element in the 'in head noscript' insertion mode.
+        *
+        * This internal function performs the 'in head noscript' insertion mode
+        * logic for the generalized WP_HTML_Processor::step() function.
+        *
+        * @since 6.7.0 Stub implementation.
+        *
+        * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input.
+        *
+        * @see https://html.spec.whatwg.org/#parsing-main-inheadnoscript
+        * @see WP_HTML_Processor::step
+        *
+        * @return bool Whether an element was found.
+        */
+       private function step_in_head_noscript() {
+               $this->last_error = self::ERROR_UNSUPPORTED;
+               throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." );
+       }
+
+       /**
+        * Parses next element in the 'after head' insertion mode.
+        *
+        * This internal function performs the 'after head' insertion mode
+        * logic for the generalized WP_HTML_Processor::step() function.
+        *
+        * @since 6.7.0 Stub implementation.
+        *
+        * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input.
+        *
+        * @see https://html.spec.whatwg.org/#the-after-head-insertion-mode
+        * @see WP_HTML_Processor::step
+        *
+        * @return bool Whether an element was found.
+        */
+       private function step_after_head() {
+               $this->last_error = self::ERROR_UNSUPPORTED;
+               throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." );
+       }
+
+       /**
</ins><span class="cx" style="display: block; padding: 0 10px">          * Parses next element in the 'in body' insertion mode.
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * This internal function performs the 'in body' insertion mode
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1494,9 +1675,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * Parses next element in the 'in head' insertion mode.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * Parses next element in the 'in table' insertion mode.
</ins><span class="cx" style="display: block; padding: 0 10px">          *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * This internal function performs the 'in head' insertion mode
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * This internal function performs the 'in table' insertion mode
</ins><span class="cx" style="display: block; padding: 0 10px">          * logic for the generalized WP_HTML_Processor::step() function.
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @since 6.7.0 Stub implementation.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1503,17 +1684,137 @@
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input.
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * @see https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inhead
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * @see https://html.spec.whatwg.org/#parsing-main-intable
</ins><span class="cx" style="display: block; padding: 0 10px">          * @see WP_HTML_Processor::step
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @return bool Whether an element was found.
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        private function step_in_head() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ private function step_in_table() {
</ins><span class="cx" style="display: block; padding: 0 10px">                 $this->last_error = self::ERROR_UNSUPPORTED;
</span><span class="cx" style="display: block; padding: 0 10px">                throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." );
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         * Parses next element in the 'in table text' insertion mode.
+        *
+        * This internal function performs the 'in table text' insertion mode
+        * logic for the generalized WP_HTML_Processor::step() function.
+        *
+        * @since 6.7.0 Stub implementation.
+        *
+        * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input.
+        *
+        * @see https://html.spec.whatwg.org/#parsing-main-intabletext
+        * @see WP_HTML_Processor::step
+        *
+        * @return bool Whether an element was found.
+        */
+       private function step_in_table_text() {
+               $this->last_error = self::ERROR_UNSUPPORTED;
+               throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." );
+       }
+
+       /**
+        * Parses next element in the 'in caption' insertion mode.
+        *
+        * This internal function performs the 'in caption' insertion mode
+        * logic for the generalized WP_HTML_Processor::step() function.
+        *
+        * @since 6.7.0 Stub implementation.
+        *
+        * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input.
+        *
+        * @see https://html.spec.whatwg.org/#parsing-main-incaption
+        * @see WP_HTML_Processor::step
+        *
+        * @return bool Whether an element was found.
+        */
+       private function step_in_caption() {
+               $this->last_error = self::ERROR_UNSUPPORTED;
+               throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." );
+       }
+
+       /**
+        * Parses next element in the 'in column group' insertion mode.
+        *
+        * This internal function performs the 'in column group' insertion mode
+        * logic for the generalized WP_HTML_Processor::step() function.
+        *
+        * @since 6.7.0 Stub implementation.
+        *
+        * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input.
+        *
+        * @see https://html.spec.whatwg.org/#parsing-main-incolgroup
+        * @see WP_HTML_Processor::step
+        *
+        * @return bool Whether an element was found.
+        */
+       private function step_in_column_group() {
+               $this->last_error = self::ERROR_UNSUPPORTED;
+               throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." );
+       }
+
+       /**
+        * Parses next element in the 'in table body' insertion mode.
+        *
+        * This internal function performs the 'in table body' insertion mode
+        * logic for the generalized WP_HTML_Processor::step() function.
+        *
+        * @since 6.7.0 Stub implementation.
+        *
+        * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input.
+        *
+        * @see https://html.spec.whatwg.org/#parsing-main-intbody
+        * @see WP_HTML_Processor::step
+        *
+        * @return bool Whether an element was found.
+        */
+       private function step_in_table_body() {
+               $this->last_error = self::ERROR_UNSUPPORTED;
+               throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." );
+       }
+
+       /**
+        * Parses next element in the 'in row' insertion mode.
+        *
+        * This internal function performs the 'in row' insertion mode
+        * logic for the generalized WP_HTML_Processor::step() function.
+        *
+        * @since 6.7.0 Stub implementation.
+        *
+        * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input.
+        *
+        * @see https://html.spec.whatwg.org/#parsing-main-intr
+        * @see WP_HTML_Processor::step
+        *
+        * @return bool Whether an element was found.
+        */
+       private function step_in_row() {
+               $this->last_error = self::ERROR_UNSUPPORTED;
+               throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." );
+       }
+
+       /**
+        * Parses next element in the 'in cell' insertion mode.
+        *
+        * This internal function performs the 'in cell' insertion mode
+        * logic for the generalized WP_HTML_Processor::step() function.
+        *
+        * @since 6.7.0 Stub implementation.
+        *
+        * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input.
+        *
+        * @see https://html.spec.whatwg.org/#parsing-main-intd
+        * @see WP_HTML_Processor::step
+        *
+        * @return bool Whether an element was found.
+        */
+       private function step_in_cell() {
+               $this->last_error = self::ERROR_UNSUPPORTED;
+               throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." );
+       }
+
+       /**
</ins><span class="cx" style="display: block; padding: 0 10px">          * Parses next element in the 'in select' insertion mode.
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * This internal function performs the 'in select' insertion mode
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1694,6 +1995,166 @@
</span><span class="cx" style="display: block; padding: 0 10px">                return $this->step();
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        /**
+        * Parses next element in the 'in select in table' insertion mode.
+        *
+        * This internal function performs the 'in select in table' insertion mode
+        * logic for the generalized WP_HTML_Processor::step() function.
+        *
+        * @since 6.7.0 Stub implementation.
+        *
+        * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input.
+        *
+        * @see https://html.spec.whatwg.org/#parsing-main-inselectintable
+        * @see WP_HTML_Processor::step
+        *
+        * @return bool Whether an element was found.
+        */
+       private function step_in_select_in_table() {
+               $this->last_error = self::ERROR_UNSUPPORTED;
+               throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." );
+       }
+
+       /**
+        * Parses next element in the 'in template' insertion mode.
+        *
+        * This internal function performs the 'in template' insertion mode
+        * logic for the generalized WP_HTML_Processor::step() function.
+        *
+        * @since 6.7.0 Stub implementation.
+        *
+        * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input.
+        *
+        * @see https://html.spec.whatwg.org/#parsing-main-intemplate
+        * @see WP_HTML_Processor::step
+        *
+        * @return bool Whether an element was found.
+        */
+       private function step_in_template() {
+               $this->last_error = self::ERROR_UNSUPPORTED;
+               throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." );
+       }
+
+       /**
+        * Parses next element in the 'after body' insertion mode.
+        *
+        * This internal function performs the 'after body' insertion mode
+        * logic for the generalized WP_HTML_Processor::step() function.
+        *
+        * @since 6.7.0 Stub implementation.
+        *
+        * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input.
+        *
+        * @see https://html.spec.whatwg.org/#parsing-main-afterbody
+        * @see WP_HTML_Processor::step
+        *
+        * @return bool Whether an element was found.
+        */
+       private function step_after_body() {
+               $this->last_error = self::ERROR_UNSUPPORTED;
+               throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." );
+       }
+
+       /**
+        * Parses next element in the 'in frameset' insertion mode.
+        *
+        * This internal function performs the 'in frameset' insertion mode
+        * logic for the generalized WP_HTML_Processor::step() function.
+        *
+        * @since 6.7.0 Stub implementation.
+        *
+        * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input.
+        *
+        * @see https://html.spec.whatwg.org/#parsing-main-inframeset
+        * @see WP_HTML_Processor::step
+        *
+        * @return bool Whether an element was found.
+        */
+       private function step_in_frameset() {
+               $this->last_error = self::ERROR_UNSUPPORTED;
+               throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." );
+       }
+
+       /**
+        * Parses next element in the 'after frameset' insertion mode.
+        *
+        * This internal function performs the 'after frameset' insertion mode
+        * logic for the generalized WP_HTML_Processor::step() function.
+        *
+        * @since 6.7.0 Stub implementation.
+        *
+        * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input.
+        *
+        * @see https://html.spec.whatwg.org/#parsing-main-afterframeset
+        * @see WP_HTML_Processor::step
+        *
+        * @return bool Whether an element was found.
+        */
+       private function step_after_frameset() {
+               $this->last_error = self::ERROR_UNSUPPORTED;
+               throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." );
+       }
+
+       /**
+        * Parses next element in the 'after after body' insertion mode.
+        *
+        * This internal function performs the 'after after body' insertion mode
+        * logic for the generalized WP_HTML_Processor::step() function.
+        *
+        * @since 6.7.0 Stub implementation.
+        *
+        * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input.
+        *
+        * @see https://html.spec.whatwg.org/#the-after-after-body-insertion-mode
+        * @see WP_HTML_Processor::step
+        *
+        * @return bool Whether an element was found.
+        */
+       private function step_after_after_body() {
+               $this->last_error = self::ERROR_UNSUPPORTED;
+               throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." );
+       }
+
+       /**
+        * Parses next element in the 'after after frameset' insertion mode.
+        *
+        * This internal function performs the 'after after frameset' insertion mode
+        * logic for the generalized WP_HTML_Processor::step() function.
+        *
+        * @since 6.7.0 Stub implementation.
+        *
+        * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input.
+        *
+        * @see https://html.spec.whatwg.org/#the-after-after-frameset-insertion-mode
+        * @see WP_HTML_Processor::step
+        *
+        * @return bool Whether an element was found.
+        */
+       private function step_after_after_frameset() {
+               $this->last_error = self::ERROR_UNSUPPORTED;
+               throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." );
+       }
+
+       /**
+        * Parses next element in the 'in foreign content' insertion mode.
+        *
+        * This internal function performs the 'in foreign content' insertion mode
+        * logic for the generalized WP_HTML_Processor::step() function.
+        *
+        * @since 6.7.0 Stub implementation.
+        *
+        * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input.
+        *
+        * @see https://html.spec.whatwg.org/#parsing-main-inforeign
+        * @see WP_HTML_Processor::step
+        *
+        * @return bool Whether an element was found.
+        */
+       private function step_in_foreign_content() {
+               $this->last_error = self::ERROR_UNSUPPORTED;
+               throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." );
+       }
+
</ins><span class="cx" style="display: block; padding: 0 10px">         /*
</span><span class="cx" style="display: block; padding: 0 10px">         * Internal helpers
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span></span></pre>
</div>
</div>

</body>
</html>