Make WordPress Core

Changeset 59463


Ignore:
Timestamp:
11/27/2024 09:52:21 AM (23 months ago)
Author:
gziolo
Message:

HTML API: Remove unused processor state context_node property

The HTML Processor State context_node is redundant and can be deprecated. The property has been superseded by WP_HTML_Processor->context_node since [58304].

Props jonsurrell, gziolo.
Fixes #62518.

Location:
trunk/src/wp-includes/html-api
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/html-api/class-wp-html-processor-state.php

    r58985 r59463  
    361361         *
    362362         * @since 6.4.0
    363          *
    364          * @see https://html.spec.whatwg.org/#concept-frag-parse-context
    365          *
    366          * @var [string, array]|null
     363         * @deprecated 6.8.0 WP_HTML_Processor tracks the context_node internally.
     364         *
     365         * @var null
    367366         */
    368367        public $context_node = null;
  • trunk/src/wp-includes/html-api/class-wp-html-processor.php

    r59450 r59463  
    299299
    300300                $processor                             = new static( $html, self::CONSTRUCTOR_UNLOCK_CODE );
    301                 $processor->state->context_node        = array( 'BODY', array() );
    302301                $processor->state->insertion_mode      = WP_HTML_Processor_State::INSERTION_MODE_IN_BODY;
    303302                $processor->state->encoding            = $encoding;
    … …  
    318317                $context_node = new WP_HTML_Token(
    319318                        'context-node',
    320                         $processor->state->context_node[0],
     319                        'BODY',
    321320                        false
    322321                );
    … …  
    492491                $fragment_processor->context_node->bookmark_name = 'context-node';
    493492                $fragment_processor->context_node->on_destroy    = null;
    494 
    495                 $fragment_processor->state->context_node = array( $fragment_processor->context_node->node_name, array() );
    496 
    497                 $attribute_names = $this->get_attribute_names_with_prefix( '' );
    498                 if ( null !== $attribute_names ) {
    499                         foreach ( $attribute_names as $name ) {
    500                                 $fragment_processor->state->context_node[1][ $name ] = $this->get_attribute( $name );
    501                         }
    502                 }
    503493
    504494                $fragment_processor->breadcrumbs = array( 'HTML', $fragment_processor->context_node->node_name );
Note: See TracChangeset for help on using the changeset viewer.