Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML API: Fix unsupported insertion mode messages #7043

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions src/wp-includes/html-api/class-wp-html-processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,7 @@ public function get_current_depth(): int {
* @return bool Whether an element was found.
*/
private function step_initial(): bool {
$this->bail( "No support for parsing in the '{$this->state->insertion_mode}' state." );
$this->bail( 'No support for parsing in the ' . WP_HTML_Processor_State::INSERTION_MODE_INITIAL . ' state.' );
}

/**
Expand All @@ -1007,7 +1007,7 @@ private function step_initial(): bool {
* @return bool Whether an element was found.
*/
private function step_before_html(): bool {
$this->bail( "No support for parsing in the '{$this->state->insertion_mode}' state." );
$this->bail( 'No support for parsing in the ' . WP_HTML_Processor_State::INSERTION_MODE_BEFORE_HTML . ' state.' );
}

/**
Expand All @@ -1026,7 +1026,7 @@ private function step_before_html(): bool {
* @return bool Whether an element was found.
*/
private function step_before_head(): bool {
$this->bail( "No support for parsing in the '{$this->state->insertion_mode}' state." );
$this->bail( 'No support for parsing in the ' . WP_HTML_Processor_State::INSERTION_MODE_BEFORE_HEAD . ' state.' );
}

/**
Expand All @@ -1045,7 +1045,7 @@ private function step_before_head(): bool {
* @return bool Whether an element was found.
*/
private function step_in_head(): bool {
$this->bail( "No support for parsing in the '{$this->state->insertion_mode}' state." );
$this->bail( 'No support for parsing in the ' . WP_HTML_Processor_State::INSERTION_MODE_IN_HEAD . ' state.' );
}

/**
Expand All @@ -1064,7 +1064,7 @@ private function step_in_head(): bool {
* @return bool Whether an element was found.
*/
private function step_in_head_noscript(): bool {
$this->bail( "No support for parsing in the '{$this->state->insertion_mode}' state." );
$this->bail( 'No support for parsing in the ' . WP_HTML_Processor_State::INSERTION_MODE_IN_HEAD_NOSCRIPT . ' state.' );
}

/**
Expand All @@ -1083,7 +1083,7 @@ private function step_in_head_noscript(): bool {
* @return bool Whether an element was found.
*/
private function step_after_head(): bool {
$this->bail( "No support for parsing in the '{$this->state->insertion_mode}' state." );
$this->bail( 'No support for parsing in the ' . WP_HTML_Processor_State::INSERTION_MODE_AFTER_HEAD . ' state.' );
}

/**
Expand Down Expand Up @@ -2127,7 +2127,7 @@ private function step_in_body(): bool {
* @return bool Whether an element was found.
*/
private function step_in_table(): bool {
$this->bail( "No support for parsing in the '{$this->state->insertion_mode}' state." );
$this->bail( 'No support for parsing in the ' . WP_HTML_Processor_State::INSERTION_MODE_IN_TABLE . ' state.' );
}

/**
Expand All @@ -2146,7 +2146,7 @@ private function step_in_table(): bool {
* @return bool Whether an element was found.
*/
private function step_in_table_text(): bool {
$this->bail( "No support for parsing in the '{$this->state->insertion_mode}' state." );
$this->bail( 'No support for parsing in the ' . WP_HTML_Processor_State::INSERTION_MODE_IN_TABLE_TEXT . ' state.' );
}

/**
Expand All @@ -2165,7 +2165,7 @@ private function step_in_table_text(): bool {
* @return bool Whether an element was found.
*/
private function step_in_caption(): bool {
$this->bail( "No support for parsing in the '{$this->state->insertion_mode}' state." );
$this->bail( 'No support for parsing in the ' . WP_HTML_Processor_State::INSERTION_MODE_IN_CAPTION . ' state.' );
}

/**
Expand All @@ -2184,7 +2184,7 @@ private function step_in_caption(): bool {
* @return bool Whether an element was found.
*/
private function step_in_column_group(): bool {
$this->bail( "No support for parsing in the '{$this->state->insertion_mode}' state." );
$this->bail( 'No support for parsing in the ' . WP_HTML_Processor_State::INSERTION_MODE_IN_COLUMN_GROUP . ' state.' );
}

/**
Expand All @@ -2203,7 +2203,7 @@ private function step_in_column_group(): bool {
* @return bool Whether an element was found.
*/
private function step_in_table_body(): bool {
$this->bail( "No support for parsing in the '{$this->state->insertion_mode}' state." );
$this->bail( 'No support for parsing in the ' . WP_HTML_Processor_State::INSERTION_MODE_IN_TABLE_BODY . ' state.' );
}

/**
Expand All @@ -2222,7 +2222,7 @@ private function step_in_table_body(): bool {
* @return bool Whether an element was found.
*/
private function step_in_row(): bool {
$this->bail( "No support for parsing in the '{$this->state->insertion_mode}' state." );
$this->bail( 'No support for parsing in the ' . WP_HTML_Processor_State::INSERTION_MODE_IN_ROW . ' state.' );
}

/**
Expand All @@ -2241,7 +2241,7 @@ private function step_in_row(): bool {
* @return bool Whether an element was found.
*/
private function step_in_cell(): bool {
$this->bail( "No support for parsing in the '{$this->state->insertion_mode}' state." );
$this->bail( 'No support for parsing in the ' . WP_HTML_Processor_State::INSERTION_MODE_IN_CELL . ' state.' );
}

/**
Expand Down Expand Up @@ -2441,7 +2441,7 @@ private function step_in_select(): bool {
* @return bool Whether an element was found.
*/
private function step_in_select_in_table(): bool {
$this->bail( "No support for parsing in the '{$this->state->insertion_mode}' state." );
$this->bail( 'No support for parsing in the ' . WP_HTML_Processor_State::INSERTION_MODE_IN_SELECT_IN_TABLE . ' state.' );
}

/**
Expand All @@ -2460,7 +2460,7 @@ private function step_in_select_in_table(): bool {
* @return bool Whether an element was found.
*/
private function step_in_template(): bool {
$this->bail( "No support for parsing in the '{$this->state->insertion_mode}' state." );
$this->bail( 'No support for parsing in the ' . WP_HTML_Processor_State::INSERTION_MODE_IN_TEMPLATE . ' state.' );
}

/**
Expand All @@ -2479,7 +2479,7 @@ private function step_in_template(): bool {
* @return bool Whether an element was found.
*/
private function step_after_body(): bool {
$this->bail( "No support for parsing in the '{$this->state->insertion_mode}' state." );
$this->bail( 'No support for parsing in the ' . WP_HTML_Processor_State::INSERTION_MODE_AFTER_BODY . ' state.' );
}

/**
Expand All @@ -2498,7 +2498,7 @@ private function step_after_body(): bool {
* @return bool Whether an element was found.
*/
private function step_in_frameset(): bool {
$this->bail( "No support for parsing in the '{$this->state->insertion_mode}' state." );
$this->bail( 'No support for parsing in the ' . WP_HTML_Processor_State::INSERTION_MODE_IN_FRAMESET . ' state.' );
}

/**
Expand All @@ -2517,7 +2517,7 @@ private function step_in_frameset(): bool {
* @return bool Whether an element was found.
*/
private function step_after_frameset(): bool {
$this->bail( "No support for parsing in the '{$this->state->insertion_mode}' state." );
$this->bail( 'No support for parsing in the ' . WP_HTML_Processor_State::INSERTION_MODE_AFTER_FRAMESET . ' state.' );
}

/**
Expand All @@ -2536,7 +2536,7 @@ private function step_after_frameset(): bool {
* @return bool Whether an element was found.
*/
private function step_after_after_body(): bool {
$this->bail( "No support for parsing in the '{$this->state->insertion_mode}' state." );
$this->bail( 'No support for parsing in the ' . WP_HTML_Processor_State::INSERTION_MODE_AFTER_AFTER_BODY . ' state.' );
}

/**
Expand All @@ -2555,7 +2555,7 @@ private function step_after_after_body(): bool {
* @return bool Whether an element was found.
*/
private function step_after_after_frameset(): bool {
$this->bail( "No support for parsing in the '{$this->state->insertion_mode}' state." );
$this->bail( 'No support for parsing in the ' . WP_HTML_Processor_State::INSERTION_MODE_AFTER_AFTER_FRAMESET . ' state.' );
}

/**
Expand All @@ -2574,7 +2574,7 @@ private function step_after_after_frameset(): bool {
* @return bool Whether an element was found.
*/
private function step_in_foreign_content(): bool {
$this->bail( "No support for parsing in the '{$this->state->insertion_mode}' state." );
$this->bail( 'No support for parsing in the ' . WP_HTML_Processor_State::INSERTION_MODE_IN_FOREIGN_CONTENT . ' state.' );
}

/*
Expand Down
Loading