WP_HTML_Open_Elements::clear_to_table_row_context
Clear the stack back to a table row context.
When the steps above require the UA to clear the stack back to a table row context, it > means that the UA must, while the current node is not a tr, 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_row_context(): void;
Notes
- See: https://html.spec.whatwg.org/multipage/parsing.html#clear-the-stack-back-to-a-table-row-context
Changelog
| Since 6.7.0 | Introduced. |
WP_HTML_Open_Elements::clear_to_table_row_context() WP HTML Open Elements::clear to table row context code WP 6.9
public function clear_to_table_row_context(): void {
foreach ( $this->walk_up() as $item ) {
if (
'TR' === $item->node_name ||
'TEMPLATE' === $item->node_name ||
'HTML' === $item->node_name
) {
break;
}
$this->pop();
}
}