Skip to content

Commit 1b48ae6

Browse files
committed
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 #7194 Discussed in https://core.trac.wordpress.org/ticket/61549 Follow-up to [28656]. Props jonsurrell. See #61549. git-svn-id: https://develop.svn.wordpress.org/trunk@58898 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 064f75e commit 1b48ae6

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/wp-includes/html-api/class-wp-html-processor.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1501,7 +1501,7 @@ private function step_in_head(): bool {
15011501
$this->state->stack_of_open_elements->pop_until( 'TEMPLATE' );
15021502
$this->state->active_formatting_elements->clear_up_to_last_marker();
15031503
array_pop( $this->state->stack_of_template_insertion_modes );
1504-
$this->reset_insertion_mode();
1504+
$this->reset_insertion_mode_appropriately();
15051505
return true;
15061506
}
15071507

@@ -2955,7 +2955,7 @@ private function step_in_table(): bool {
29552955
}
29562956

29572957
$this->state->stack_of_open_elements->pop_until( 'TABLE' );
2958-
$this->reset_insertion_mode();
2958+
$this->reset_insertion_mode_appropriately();
29592959
return $this->step( self::REPROCESS_CURRENT_NODE );
29602960

29612961
/*
@@ -2968,7 +2968,7 @@ private function step_in_table(): bool {
29682968
}
29692969

29702970
$this->state->stack_of_open_elements->pop_until( 'TABLE' );
2971-
$this->reset_insertion_mode();
2971+
$this->reset_insertion_mode_appropriately();
29722972
return true;
29732973

29742974
/*
@@ -3729,7 +3729,7 @@ private function step_in_select(): bool {
37293729
return $this->step();
37303730
}
37313731
$this->state->stack_of_open_elements->pop_until( 'SELECT' );
3732-
$this->reset_insertion_mode();
3732+
$this->reset_insertion_mode_appropriately();
37333733
return true;
37343734

37353735
/*
@@ -3745,7 +3745,7 @@ private function step_in_select(): bool {
37453745
return $this->step();
37463746
}
37473747
$this->state->stack_of_open_elements->pop_until( 'SELECT' );
3748-
$this->reset_insertion_mode();
3748+
$this->reset_insertion_mode_appropriately();
37493749
return $this->step( self::REPROCESS_CURRENT_NODE );
37503750

37513751
/*
@@ -3800,7 +3800,7 @@ private function step_in_select_in_table(): bool {
38003800
case '+TH':
38013801
// @todo Indicate a parse error once it's possible.
38023802
$this->state->stack_of_open_elements->pop_until( 'SELECT' );
3803-
$this->reset_insertion_mode();
3803+
$this->reset_insertion_mode_appropriately();
38043804
return $this->step( self::REPROCESS_CURRENT_NODE );
38053805

38063806
/*
@@ -3819,7 +3819,7 @@ private function step_in_select_in_table(): bool {
38193819
return $this->step();
38203820
}
38213821
$this->state->stack_of_open_elements->pop_until( 'SELECT' );
3822-
$this->reset_insertion_mode();
3822+
$this->reset_insertion_mode_appropriately();
38233823
return $this->step( self::REPROCESS_CURRENT_NODE );
38243824
}
38253825

@@ -3954,7 +3954,7 @@ private function step_in_template(): bool {
39543954
$this->state->stack_of_open_elements->pop_until( 'TEMPLATE' );
39553955
$this->state->active_formatting_elements->clear_up_to_last_marker();
39563956
array_pop( $this->state->stack_of_template_insertion_modes );
3957-
$this->reset_insertion_mode();
3957+
$this->reset_insertion_mode_appropriately();
39583958
return $this->step( self::REPROCESS_CURRENT_NODE );
39593959
}
39603960

@@ -5100,7 +5100,7 @@ private function reconstruct_active_formatting_elements(): bool {
51005100
*
51015101
* @see https://html.spec.whatwg.org/multipage/parsing.html#reset-the-insertion-mode-appropriately
51025102
*/
5103-
public function reset_insertion_mode(): void {
5103+
private function reset_insertion_mode_appropriately(): void {
51045104
// Set the first node.
51055105
$first_node = null;
51065106
foreach ( $this->state->stack_of_open_elements->walk_down() as $first_node ) {

0 commit comments

Comments
 (0)