Skip to content

Commit

Permalink
Only reference Gutenberg__6_5 classes
Browse files Browse the repository at this point in the history
  • Loading branch information
dmsnell committed Dec 20, 2023
1 parent be2ee39 commit dd19856
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public function has_element_in_scope( $tag_name ) {
* @return bool Whether given element is in scope.
*/
public function has_element_in_list_item_scope( $tag_name ) {
throw new WP_HTML_Unsupported_Exception( 'Cannot process elements depending on list item scope.' );
throw new Gutenberg_HTML_Unsupported_Exception_6_5( 'Cannot process elements depending on list item scope.' );

return false; // The linter requires this unreachable code until the function is implemented and can return.
}
Expand Down Expand Up @@ -207,7 +207,7 @@ public function has_element_in_button_scope( $tag_name ) {
* @return bool Whether given element is in scope.
*/
public function has_element_in_table_scope( $tag_name ) {
throw new WP_HTML_Unsupported_Exception( 'Cannot process elements depending on table scope.' );
throw new Gutenberg_HTML_Unsupported_Exception_6_5( 'Cannot process elements depending on table scope.' );

return false; // The linter requires this unreachable code until the function is implemented and can return.
}
Expand All @@ -225,7 +225,7 @@ public function has_element_in_table_scope( $tag_name ) {
* @return bool Whether given element is in scope.
*/
public function has_element_in_select_scope( $tag_name ) {
throw new WP_HTML_Unsupported_Exception( 'Cannot process elements depending on select scope.' );
throw new Gutenberg_HTML_Unsupported_Exception_6_5( 'Cannot process elements depending on select scope.' );

return false; // The linter requires this unreachable code until the function is implemented and can return.
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,19 +253,19 @@ public static function create_fragment( $html, $context = '<body>', $encoding =
$p->state->insertion_mode = Gutenberg_HTML_Processor_State_6_5::INSERTION_MODE_IN_BODY;

// @todo Create "fake" bookmarks for non-existent but implied nodes.
$p->bookmarks['root-node'] = new WP_HTML_Span( 0, 0 );
$p->bookmarks['context-node'] = new WP_HTML_Span( 0, 0 );
$p->bookmarks['root-node'] = new Gutenberg_HTML_Span_6_5( 0, 0 );
$p->bookmarks['context-node'] = new Gutenberg_HTML_Span_6_5( 0, 0 );

$p->state->stack_of_open_elements->push(
new WP_HTML_Token(
new Gutenberg_HTML_Token_6_5(
'root-node',
'HTML',
false
)
);

$p->state->stack_of_open_elements->push(
new WP_HTML_Token(
new Gutenberg_HTML_Token_6_5(
'context-node',
$p->state->context_node[0],
false
Expand Down Expand Up @@ -524,7 +524,7 @@ public function step( $node_to_process = self::PROCESS_NEXT_NODE ) {
return false;
}

$this->state->current_token = new WP_HTML_Token(
$this->state->current_token = new Gutenberg_HTML_Token_6_5(
$this->bookmark_tag(),
$this->get_tag(),
$this->is_tag_closer(),
Expand All @@ -538,9 +538,9 @@ public function step( $node_to_process = self::PROCESS_NEXT_NODE ) {

default:
$this->last_error = self::ERROR_UNSUPPORTED;
throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." );
throw new Gutenberg_HTML_Unsupported_Exception_6_5( "No support for parsing in the '{$this->state->insertion_mode}' state." );
}
} catch ( WP_HTML_Unsupported_Exception $e ) {
} catch ( Gutenberg_HTML_Unsupported_Exception_6_5 $e ) {
/*
* Exceptions are used in this class to escape deep call stacks that
* otherwise might involve messier calling and return conventions.
Expand Down Expand Up @@ -864,7 +864,7 @@ private function step_in_body() {

default:
$this->last_error = self::ERROR_UNSUPPORTED;
throw new WP_HTML_Unsupported_Exception( "Cannot process {$tag_name} element." );
throw new Gutenberg_HTML_Unsupported_Exception_6_5( "Cannot process {$tag_name} element." );
}
}

Expand Down Expand Up @@ -1205,7 +1205,7 @@ private function reconstruct_active_formatting_elements() {
}

$this->last_error = self::ERROR_UNSUPPORTED;
throw new WP_HTML_Unsupported_Exception( 'Cannot reconstruct active formatting elements when advancing and rewinding is required.' );
throw new Gutenberg_HTML_Unsupported_Exception_6_5( 'Cannot reconstruct active formatting elements when advancing and rewinding is required.' );
}

/**
Expand Down Expand Up @@ -1259,7 +1259,7 @@ private function run_adoption_agency_algorithm() {
// > If there is no such element, then return and instead act as described in the "any other end tag" entry above.
if ( null === $formatting_element ) {
$this->last_error = self::ERROR_UNSUPPORTED;
throw new WP_HTML_Unsupported_Exception( 'Cannot run adoption agency when "any other end tag" is required.' );
throw new Gutenberg_HTML_Unsupported_Exception_6_5( 'Cannot run adoption agency when "any other end tag" is required.' );
}

// > If formatting element is not in the stack of open elements, then this is a parse error; remove the element from the list, and return.
Expand Down Expand Up @@ -1312,11 +1312,11 @@ private function run_adoption_agency_algorithm() {
}

$this->last_error = self::ERROR_UNSUPPORTED;
throw new WP_HTML_Unsupported_Exception( 'Cannot extract common ancestor in adoption agency algorithm.' );
throw new Gutenberg_HTML_Unsupported_Exception_6_5( 'Cannot extract common ancestor in adoption agency algorithm.' );
}

$this->last_error = self::ERROR_UNSUPPORTED;
throw new WP_HTML_Unsupported_Exception( 'Cannot run adoption agency when looping required.' );
throw new Gutenberg_HTML_Unsupported_Exception_6_5( 'Cannot run adoption agency when looping required.' );
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,6 @@ class Gutenberg_HTML_Processor_State_6_5 {
*/
public function __construct() {
$this->stack_of_open_elements = new Gutenberg_HTML_Open_Elements_6_5();
$this->active_formatting_elements = new WP_HTML_Active_Formatting_Elements();
$this->active_formatting_elements = new Gutenberg_HTML_Active_Formatting_Elements_6_5();
}
}

0 comments on commit dd19856

Please sign in to comment.