-
Notifications
You must be signed in to change notification settings - Fork 3.2k
HTML API: Remove unused processor state context_node property #7861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -298,7 +298,6 @@ public static function create_fragment( $html, $context = '<body>', $encoding = | |||||||||
| } | ||||||||||
|
|
||||||||||
| $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->encoding = $encoding; | ||||||||||
| $processor->state->encoding_confidence = 'certain'; | ||||||||||
|
|
@@ -317,7 +316,7 @@ public static function create_fragment( $html, $context = '<body>', $encoding = | |||||||||
|
|
||||||||||
| $context_node = new WP_HTML_Token( | ||||||||||
| 'context-node', | ||||||||||
| $processor->state->context_node[0], | ||||||||||
| 'BODY', | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. something seems off here: why are we hard-coding
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This landed before the additional context support and I believe all these lines are now stale. In this change, the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The relevant lines are now around here:
wordpress-develop/src/wp-includes/html-api/class-wp-html-processor.php Lines 538 to 540 in 4b34369
|
||||||||||
| false | ||||||||||
| ); | ||||||||||
|
|
||||||||||
|
|
@@ -492,15 +491,6 @@ public function create_fragment_at_current_node( string $html ) { | |||||||||
| $fragment_processor->context_node->bookmark_name = 'context-node'; | ||||||||||
| $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 ); | ||||||||||
|
|
||||||||||
| if ( 'TEMPLATE' === $fragment_processor->context_node->node_name ) { | ||||||||||
|
|
||||||||||
Uh oh!
There was an error while loading. Please reload this page.