Make WordPress Core

Opened 3 months ago

Closed 2 months ago

Last modified 2 months ago

#60474 closed defect (bug) (fixed)

HTML API: HTML Processor bookmarks seek, has_bookmark bugs

Reported by: jonsurrell's profile jonsurrell Owned by: jonsurrell's profile jonsurrell
Milestone: 6.5 Priority: normal
Severity: normal Version:
Component: HTML API Keywords: has-patch has-unit-tests
Focuses: Cc:

Description

WP_HTML_Processor::has_bookmark does not correctly report bookmarks that have been set.

WP_HTML_Processor::seek does not seek to correct location if HTML has been updated.

Change History (4)

This ticket was mentioned in PR #6039 on WordPress/wordpress-develop by @jonsurrell.


3 months ago
#1

  • Keywords has-patch has-unit-tests added
  • Add test suite for WP_HTML_Processor bookmark functions.
  • Fix issue with ::seek when HTML has been modified.
  • Fix issue with ::has_bookmark not reporting correctly for set bookmarks.

Trac ticket: https://core.trac.wordpress.org/ticket/60474

#2 @dmsnell
2 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 57582:

HTML API: Add subclassed has_bookmark() and fix seek()

The WP_HTML_Processor::has_bookmark() method has not correctly reported bookmarks
which have been set, because it wraps the given bookmark names when setting them.
Additionally, WP_HTML_Processor::seek() does not seek to correct location if HTML
has been updated because it wasn't flushing enqueued updates to the document.

In this patch both problems are resolved and added tests guard these behaviors
against future regressions.

Developed in https://github.com/WordPress/wordpress-develop/pull/6039
Discussed in https://core.trac.wordpress.org/ticket/60474

Follow-up to [56274].
Props dmsnell, jonsurrell.
Fixes #60474.

#4 @dmsnell
2 months ago

  • Milestone changed from Awaiting Review to 6.5
Note: See TracTickets for help on using tickets.