Skip to content
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

Interactivity API: use compat versions of HTML APIs #58846

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* @access private
*/
final class WP_Interactivity_API_Directives_Processor extends WP_HTML_Tag_Processor {
final class WP_Interactivity_API_Directives_Processor extends Gutenberg_HTML_Tag_Processor_6_5 {
/**
* List of tags whose closer tag is not visited by the WP_HTML_Tag_Processor.
*
Expand Down Expand Up @@ -78,7 +78,7 @@ public function set_content_between_balanced_tags( string $new_content ): bool {
}
list( $after_opener_tag, $before_closer_tag ) = $positions;

$this->lexical_updates[] = new WP_HTML_Text_Replacement(
$this->lexical_updates[] = new Gutenberg_HTML_Text_Replacement_6_5(
$after_opener_tag,
$before_closer_tag - $after_opener_tag,
esc_html( $new_content )
Expand Down Expand Up @@ -112,7 +112,7 @@ public function append_content_after_template_tag_closer( string $new_content ):
$this->release_bookmark( $bookmark );

// Appends the new content.
$this->lexical_updates[] = new WP_HTML_Text_Replacement( $after_closing_tag, 0, $new_content );
$this->lexical_updates[] = new Gutenberg_HTML_Text_Replacement_6_5( $after_closing_tag, 0, $new_content );

return true;
}
Expand Down Expand Up @@ -238,7 +238,7 @@ public function has_and_visits_its_closer_tag(): bool {
$tag_name = $this->get_tag();

return null !== $tag_name && (
! WP_HTML_Processor::is_void( $tag_name ) &&
! Gutenberg_HTML_Processor_6_5::is_void( $tag_name ) &&
! in_array( $tag_name, self::TAGS_THAT_DONT_VISIT_CLOSER_TAG, true )
);
}
Expand Down