@@ -164,15 +164,6 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor {
164164 */
165165 private $ bookmark_counter = 0 ;
166166
167- /**
168- * Refers to the currently-matched tag, if any.
169- *
170- * @since 6.4.0
171- *
172- * @var WP_HTML_Token|null
173- */
174- private $ current_token = null ;
175-
176167 /**
177168 * Stores an explanation for why something failed, if it did.
178169 *
@@ -451,7 +442,7 @@ public function step( $node_to_process = self::PROCESS_NEXT_NODE ) {
451442 return false ;
452443 }
453444
454- $ this ->current_token = new WP_HTML_Token (
445+ $ this ->state -> current_token = new WP_HTML_Token (
455446 $ this ->bookmark_tag (),
456447 $ this ->get_tag (),
457448 $ this ->is_tag_closer (),
@@ -538,7 +529,7 @@ private function step_in_body() {
538529 }
539530
540531 $ this ->reconstruct_active_formatting_elements ();
541- $ this ->insert_html_element ( $ this ->current_token );
532+ $ this ->insert_html_element ( $ this ->state -> current_token );
542533 $ this ->state ->frameset_ok = false ;
543534
544535 return true ;
@@ -558,7 +549,7 @@ private function step_in_body() {
558549 $ this ->close_a_p_element ();
559550 }
560551
561- $ this ->insert_html_element ( $ this ->current_token );
552+ $ this ->insert_html_element ( $ this ->state -> current_token );
562553 return true ;
563554
564555 /*
@@ -590,7 +581,7 @@ private function step_in_body() {
590581 */
591582 case '-P ' :
592583 if ( ! $ this ->state ->stack_of_open_elements ->has_p_in_button_scope () ) {
593- $ this ->insert_html_element ( $ this ->current_token );
584+ $ this ->insert_html_element ( $ this ->state -> current_token );
594585 }
595586
596587 $ this ->close_a_p_element ();
@@ -612,8 +603,8 @@ private function step_in_body() {
612603 }
613604
614605 $ this ->reconstruct_active_formatting_elements ();
615- $ this ->insert_html_element ( $ this ->current_token );
616- $ this ->state ->active_formatting_elements ->push ( $ this ->current_token );
606+ $ this ->insert_html_element ( $ this ->state -> current_token );
607+ $ this ->state ->active_formatting_elements ->push ( $ this ->state -> current_token );
617608 return true ;
618609
619610 /*
@@ -633,8 +624,8 @@ private function step_in_body() {
633624 case '+TT ' :
634625 case '+U ' :
635626 $ this ->reconstruct_active_formatting_elements ();
636- $ this ->insert_html_element ( $ this ->current_token );
637- $ this ->state ->active_formatting_elements ->push ( $ this ->current_token );
627+ $ this ->insert_html_element ( $ this ->state -> current_token );
628+ $ this ->state ->active_formatting_elements ->push ( $ this ->state -> current_token );
638629 return true ;
639630
640631 /*
@@ -662,15 +653,15 @@ private function step_in_body() {
662653 */
663654 case '+IMG ' :
664655 $ this ->reconstruct_active_formatting_elements ();
665- $ this ->insert_html_element ( $ this ->current_token );
656+ $ this ->insert_html_element ( $ this ->state -> current_token );
666657 return true ;
667658
668659 /*
669660 * > Any other start tag
670661 */
671662 case '+SPAN ' :
672663 $ this ->reconstruct_active_formatting_elements ();
673- $ this ->insert_html_element ( $ this ->current_token );
664+ $ this ->insert_html_element ( $ this ->state -> current_token );
674665 return true ;
675666
676667 /*
@@ -796,15 +787,17 @@ public function release_bookmark( $bookmark_name ) {
796787 */
797788 public function seek ( $ bookmark_name ) {
798789 $ actual_bookmark_name = "_ {$ bookmark_name }" ;
799- $ processor_started_at = $ this ->current_token ? $ this ->bookmarks [ $ this ->current_token ->bookmark_name ]->start : 0 ;
790+ $ processor_started_at = $ this ->state ->current_token
791+ ? $ this ->bookmarks [ $ this ->state ->current_token ->bookmark_name ]->start
792+ : 0 ;
800793 $ bookmark_starts_at = $ this ->bookmarks [ $ actual_bookmark_name ]->start ;
801794 $ direction = $ bookmark_starts_at > $ processor_started_at ? 'forward ' : 'backward ' ;
802795
803796 switch ( $ direction ) {
804797 case 'forward ' :
805798 // When moving forwards, re-parse the document until reaching the same location as the original bookmark.
806799 while ( $ this ->step () ) {
807- if ( $ bookmark_starts_at === $ this ->bookmarks [ $ this ->current_token ->bookmark_name ]->start ) {
800+ if ( $ bookmark_starts_at === $ this ->bookmarks [ $ this ->state -> current_token ->bookmark_name ]->start ) {
808801 return true ;
809802 }
810803 }
0 commit comments