WP_HTML_Processor::step_in_select_in_table(): 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 by core. It is listed here for completeness.

Parses next element in the ‘in select in table’ insertion mode.

Description

This internal function performs the ‘in select in table’ insertion mode logic for the generalized WP_HTML_Processor::step() function.

See also

Return

bool Whether an element was found.

Source

		case '+TFOOT':
		case '+TH':
		case '+THEAD':
		case '+TR':
			/*
			 * > Assert: The stack of open elements has a td or th element in table scope.
			 *
			 * Nothing to do here, except to verify in tests that this never appears.
			 */

			$this->close_cell();
			return $this->step( self::REPROCESS_CURRENT_NODE );

		/*
		 * > An end tag whose tag name is one of: "body", "caption", "col", "colgroup", "html"
		 */
		case '-BODY':
		case '-CAPTION':
		case '-COL':
		case '-COLGROUP':
		case '-HTML':
			// Parse error: ignore the token.
			return $this->step();

		/*
		 * > An end tag whose tag name is one of: "table", "tbody", "tfoot", "thead", "tr"
		 */
		case '-TABLE':
		case '-TBODY':
		case '-TFOOT':
		case '-THEAD':
		case '-TR':
			if ( ! $this->state->stack_of_open_elements->has_element_in_table_scope( $tag_name ) ) {
				// Parse error: ignore the token.
				return $this->step();
			}
			$this->close_cell();
			return $this->step( self::REPROCESS_CURRENT_NODE );
	}

	/*
	 * > Anything else
	 * >   Process the token using the rules for the "in body" insertion mode.
	 */
	return $this->step_in_body();
}

/**

Changelog

VersionDescription
6.7.0Introduced.

User Contributed Notes

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