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.



Built from https://develop.svn.wordpress.org/trunk@59463


git-svn-id: http://core.svn.wordpress.org/trunk@58849 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
gziolo 2024-11-27 09:54:17 +00:00
parent 869f9b1df5
commit c9d9ddb4d8
3 changed files with 4 additions and 15 deletions

View File

@ -360,10 +360,9 @@ class WP_HTML_Processor_State {
* Context node initializing fragment parser, if created as a fragment parser. * Context node initializing fragment parser, if created as a fragment parser.
* *
* @since 6.4.0 * @since 6.4.0
* @deprecated 6.8.0 WP_HTML_Processor tracks the context_node internally.
* *
* @see https://html.spec.whatwg.org/#concept-frag-parse-context * @var null
*
* @var [string, array]|null
*/ */
public $context_node = null; public $context_node = null;

View File

@ -298,7 +298,6 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor {
} }
$processor = new static( $html, self::CONSTRUCTOR_UNLOCK_CODE ); $processor = new static( $html, self::CONSTRUCTOR_UNLOCK_CODE );
$processor->state->context_node = array( 'BODY', array() );
$processor->state->insertion_mode = WP_HTML_Processor_State::INSERTION_MODE_IN_BODY; $processor->state->insertion_mode = WP_HTML_Processor_State::INSERTION_MODE_IN_BODY;
$processor->state->encoding = $encoding; $processor->state->encoding = $encoding;
$processor->state->encoding_confidence = 'certain'; $processor->state->encoding_confidence = 'certain';
@ -317,7 +316,7 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor {
$context_node = new WP_HTML_Token( $context_node = new WP_HTML_Token(
'context-node', 'context-node',
$processor->state->context_node[0], 'BODY',
false false
); );
@ -492,15 +491,6 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor {
$fragment_processor->context_node->bookmark_name = 'context-node'; $fragment_processor->context_node->bookmark_name = 'context-node';
$fragment_processor->context_node->on_destroy = null; $fragment_processor->context_node->on_destroy = null;
$fragment_processor->state->context_node = array( $fragment_processor->context_node->node_name, array() );
$attribute_names = $this->get_attribute_names_with_prefix( '' );
if ( null !== $attribute_names ) {
foreach ( $attribute_names as $name ) {
$fragment_processor->state->context_node[1][ $name ] = $this->get_attribute( $name );
}
}
$fragment_processor->breadcrumbs = array( 'HTML', $fragment_processor->context_node->node_name ); $fragment_processor->breadcrumbs = array( 'HTML', $fragment_processor->context_node->node_name );
if ( 'TEMPLATE' === $fragment_processor->context_node->node_name ) { if ( 'TEMPLATE' === $fragment_processor->context_node->node_name ) {

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.8-alpha-59462'; $wp_version = '6.8-alpha-59463';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.