Make WordPress Core

Opened 5 months ago

Closed 5 months ago

Last modified 5 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:


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.

5 months ago

  • 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:

#2 @dmsnell
5 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
Discussed in

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

#4 @dmsnell
5 months ago

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