[wp-trac] [WordPress Trac] #60687: HTML API: Ensure that breadcrumbs are properly retained after seeking.
WordPress Trac
noreply at wordpress.org
Tue Mar 5 00:54:24 UTC 2024
#60687: HTML API: Ensure that breadcrumbs are properly retained after seeking.
--------------------------+--------------------------------------
Reporter: dmsnell | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 6.5
Component: HTML API | Version: trunk
Severity: normal | Keywords: has-patch has-unit-tests
Focuses: |
--------------------------+--------------------------------------
In some cases, it's possible to seek back into a location found inside an
element which has been completely closed before the seek. In these cases
the breadcrumb stack is lost, and calling get_breadcrumbs() after the seek
will return the wrong information.
This patch changes the seek() behavior to rewind to the start of the
document and re-parse everything up until the sought-after bookmark
location. This is a drastic choice but maintains the accuracy of the
breadcrumbs. While slow, this can be later optimized in a way that
preserves the parser state.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/60687>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list