[wp-trac] [WordPress Trac] #60687: HTML API: Ensure that breadcrumbs are properly retained after seeking.

WordPress Trac noreply at wordpress.org
Tue Mar 5 05:32:35 UTC 2024


#60687: HTML API: Ensure that breadcrumbs are properly retained after seeking.
--------------------------------------+----------------------
 Reporter:  dmsnell                   |       Owner:  dmsnell
     Type:  defect (bug)              |      Status:  closed
 Priority:  normal                    |   Milestone:  6.5
Component:  HTML API                  |     Version:  trunk
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+----------------------
Changes (by dmsnell):

 * owner:  (none) => dmsnell
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"57768" 57768]:
 {{{
 #!CommitTicketReference repository="" revision="57768"
 HTML API: Ensure that breadcrumbs are properly retained after seeking.

 In some cases, it's possible to seek back into a location found inside
 an element which has been closed before the point in the document where
 the `seek()` was made. In these cases the breadcrumb stack is lost, and
 calling `get_breadcrumbs()` after the seek will return the wrong
 information.

 In this patch, the HTML Processor takes a conservative approach and
 moves to the front of the document, then reparses the document until
 it reaches the sought-after location. This ensures consistency on
 the stack of open elements and active formats, and preserves
 breadcrumbs.

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

 Props jonsurrell.
 Follow-up to [60687].
 See #58517.
 Fixes #60687.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60687#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list