From 1d45bdd956a53f4ef261e11da407a965c76b1fc1 Mon Sep 17 00:00:00 2001 From: Dennis Snell Date: Wed, 11 Oct 2023 17:46:07 -0700 Subject: [PATCH] Add test codifying set_attribute bug modifying breadcrumbs. --- .../html-api/wpHtmlProcessorBreadcrumbs.php | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/tests/phpunit/tests/html-api/wpHtmlProcessorBreadcrumbs.php b/tests/phpunit/tests/html-api/wpHtmlProcessorBreadcrumbs.php index 932b3ca8f2a88..997177dcc4471 100644 --- a/tests/phpunit/tests/html-api/wpHtmlProcessorBreadcrumbs.php +++ b/tests/phpunit/tests/html-api/wpHtmlProcessorBreadcrumbs.php @@ -290,6 +290,49 @@ public function test_finds_correct_tag_given_breadcrumbs( $html, $breadcrumbs, $ $this->assertTrue( $p->get_attribute( 'target' ), "Found {$p->get_tag()} element didn't contain the necessary 'target' attribute." ); } + /** + * Ensures that updates to a tag's attributes doesn't shift + * the current position into the input HTML document. + * + * @ticket 59607 + */ + public function test_remains_stable_when_editing_attributes() { + $p = WP_HTML_Processor::create_fragment( '