WP_HTML_Open_Elements::clear_to_table_body_context
Clear the stack back to a table body context.
When the steps above require the UA to clear the stack back to a table body context, it > means that the UA must, while the current node is not a tbody, tfoot, thead, template, or > html element, pop elements from the stack of open elements.
Method of the class: WP_HTML_Open_Elements{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WP_HTML_Open_Elements = new WP_HTML_Open_Elements(); $WP_HTML_Open_Elements->clear_to_table_body_context(): void;
Notes
- See: https://html.spec.whatwg.org/multipage/parsing.html#clear-the-stack-back-to-a-table-body-context
Changelog
| Since 6.7.0 | Introduced. |
WP_HTML_Open_Elements::clear_to_table_body_context() WP HTML Open Elements::clear to table body context code WP 6.9.1
public function clear_to_table_body_context(): void {
foreach ( $this->walk_up() as $item ) {
if (
'TBODY' === $item->node_name ||
'TFOOT' === $item->node_name ||
'THEAD' === $item->node_name ||
'TEMPLATE' === $item->node_name ||
'HTML' === $item->node_name
) {
break;
}
$this->pop();
}
}