WP_HTML_Processor::reconstruct_active_formatting_elements(): bool

In this article

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness. Use https://html.spec.whatwg.org/#reconstruct-the-active-formatting-elements instead.

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

VersionDescription
6.4.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.