W3cubDocs

/WordPress

WP_HTML_Processor::reconstruct_active_formatting_elements(): bool

Reconstructs the active formatting elements.

Description

This has the effect of reopening all the formatting elements that were opened in the current body, cell, or caption (whichever is youngest) that haven’t been explicitly closed.

See also

Return

bool Whether any formatting elements needed to be reconstructed.

Source

/*
 * > A start tag whose tag name is "frameset"
 *
 * This tag in the IN BODY insertion mode is a parse error.
 */
case '+FRAMESET':
	if (
		1 === $this->state->stack_of_open_elements->count() ||
		'BODY' !== ( $this->state->stack_of_open_elements->at( 2 )->node_name ?? null ) ||
		false === $this->state->frameset_ok
	) {
		// Ignore the token.
		return $this->step();
	}

	/*
	 * > Otherwise, run the following steps:
	 */
	$this->bail( 'Cannot process non-ignored FRAMESET tags.' );
	break;

/*
 * > An end tag whose tag name is "body"
 */
case '-BODY':
	if ( ! $this->state->stack_of_open_elements->has_element_in_scope( 'BODY' ) ) {
		// Parse error: ignore the token.
		return $this->step();
	}

	/*

Changelog

Version Description
6.4.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_html_processor/reconstruct_active_formatting_elements