From 5cd8048fc245da2615b5420bbe863572c30f2f16 Mon Sep 17 00:00:00 2001 From: dmsnell Date: Wed, 14 Aug 2024 21:19:16 +0000 Subject: [PATCH] HTML API: Make "reset insertion mode appropriately" algorithm private. The algorithm is described and referred to in the specification as "reset the insertion mode appropriately." This patch renames it to more accurately reflect the specification, and it turns the public method private. As an internal algorithm from the HTML specification it should not be open to extension. Developed in https://github.com/wordpress/wordpress-develop/pull/7194 Discussed in https://core.trac.wordpress.org/ticket/61549 Follow-up to [28656]. Props jonsurrell. See #61549. Built from https://develop.svn.wordpress.org/trunk@58898 git-svn-id: http://core.svn.wordpress.org/trunk@58294 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../html-api/class-wp-html-processor.php | 18 +++++++++--------- wp-includes/version.php | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/wp-includes/html-api/class-wp-html-processor.php b/wp-includes/html-api/class-wp-html-processor.php index 6f5da5477f..9f3249db74 100644 --- a/wp-includes/html-api/class-wp-html-processor.php +++ b/wp-includes/html-api/class-wp-html-processor.php @@ -1501,7 +1501,7 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor { $this->state->stack_of_open_elements->pop_until( 'TEMPLATE' ); $this->state->active_formatting_elements->clear_up_to_last_marker(); array_pop( $this->state->stack_of_template_insertion_modes ); - $this->reset_insertion_mode(); + $this->reset_insertion_mode_appropriately(); return true; } @@ -2955,7 +2955,7 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor { } $this->state->stack_of_open_elements->pop_until( 'TABLE' ); - $this->reset_insertion_mode(); + $this->reset_insertion_mode_appropriately(); return $this->step( self::REPROCESS_CURRENT_NODE ); /* @@ -2968,7 +2968,7 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor { } $this->state->stack_of_open_elements->pop_until( 'TABLE' ); - $this->reset_insertion_mode(); + $this->reset_insertion_mode_appropriately(); return true; /* @@ -3729,7 +3729,7 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor { return $this->step(); } $this->state->stack_of_open_elements->pop_until( 'SELECT' ); - $this->reset_insertion_mode(); + $this->reset_insertion_mode_appropriately(); return true; /* @@ -3745,7 +3745,7 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor { return $this->step(); } $this->state->stack_of_open_elements->pop_until( 'SELECT' ); - $this->reset_insertion_mode(); + $this->reset_insertion_mode_appropriately(); return $this->step( self::REPROCESS_CURRENT_NODE ); /* @@ -3800,7 +3800,7 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor { case '+TH': // @todo Indicate a parse error once it's possible. $this->state->stack_of_open_elements->pop_until( 'SELECT' ); - $this->reset_insertion_mode(); + $this->reset_insertion_mode_appropriately(); return $this->step( self::REPROCESS_CURRENT_NODE ); /* @@ -3819,7 +3819,7 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor { return $this->step(); } $this->state->stack_of_open_elements->pop_until( 'SELECT' ); - $this->reset_insertion_mode(); + $this->reset_insertion_mode_appropriately(); return $this->step( self::REPROCESS_CURRENT_NODE ); } @@ -3954,7 +3954,7 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor { $this->state->stack_of_open_elements->pop_until( 'TEMPLATE' ); $this->state->active_formatting_elements->clear_up_to_last_marker(); array_pop( $this->state->stack_of_template_insertion_modes ); - $this->reset_insertion_mode(); + $this->reset_insertion_mode_appropriately(); return $this->step( self::REPROCESS_CURRENT_NODE ); } @@ -5100,7 +5100,7 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor { * * @see https://html.spec.whatwg.org/multipage/parsing.html#reset-the-insertion-mode-appropriately */ - public function reset_insertion_mode(): void { + private function reset_insertion_mode_appropriately(): void { // Set the first node. $first_node = null; foreach ( $this->state->stack_of_open_elements->walk_down() as $first_node ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index dbf405e476..3fe596217c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.7-alpha-58897'; +$wp_version = '6.7-alpha-58898'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.