HTML API: Fix case where updates are overlooked when seeking to earlier locations.#4345
Closed
dmsnell wants to merge 4 commits intoWordPress:trunkfrom
Closed
HTML API: Fix case where updates are overlooked when seeking to earlier locations.#4345dmsnell wants to merge 4 commits intoWordPress:trunkfrom
dmsnell wants to merge 4 commits intoWordPress:trunkfrom
Conversation
Member
Author
|
Merged in 55675 |
dmsnell
added a commit
to WordPress/gutenberg
that referenced
this pull request
Apr 24, 2023
- Support a few extra invalid comment syntaxes. WordPress/wordpress-develop#4256 - Invalidate bookmarks which have been eliminated by enqueued changes. WordPress/wordpress-develop#4116 - Expose whether the currently-matched tag has the self-closing flag. WordPress/wordpress-develop#4266 - Avoid double-writing an attribute value if given case-variations of the name. WordPress/wordpress-develop#4337 - Linting updates from WordPress/wordpress-develop#4360. - Avoid losing previous updates in certain cases when seeking earlier in a document. WordPress/wordpress-develop#4345
Contributor
|
Backported to the 6.2 branch in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Trac ticket #58160-trac
In certain cases when seeking to an earlier location in a document after changes have been enqueued, the tag processor will lose the earlier changes.
In this patch we're fixing the bug so that it properly retains the changes that were applied before the call to
seek().The problem was that when changes had already been applied and no more were enqueued, the tag processor was returning the updated HTML without updating its internal state to reflect that. This was probably an optimization for that case but I can't remember exactly why it doesn't update the internal pointers (@adamziel maybe you remember?). The fix is simple: mirror the second case and update the internal pointers.