mirrored from git://develop.git.wordpress.org/
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTML API: Preserve internal cursor across updates. #4371
Closed
Closed
Commits on Apr 23, 2023
-
HTML API: Accumulate shift for internal parsing pointer.
While working on WordPress/block-interactivity-experiments#141 @ockham discovered that the Tag Processor was making a small mistake. After making some updates the parser wasn't returning to the start of the affected tag. A test case was created in WordPress#4355. In few words, the Tag Processor has not been treating its own internal pointer `bytes_already_parsed` the same way it treats its bookmarks. That is, when updates are applied to the input document and then `get_updated_html()` is called, the internal pointer transfers to the newly-updated content as if no updates had been applied since the previous call to `get_updated_html()`. In this patch we're creating a new "shift accumulator" to account for all of the updates that accrue before calling `get_updated_html()`. This accumulated shift will be applied when swapping the input document with the output buffer, which should result in the pointer pointing to the same logical spot in the document it did before the udpate. In effect this patch adds a single workaround for treating the internal pointer like a bookmark, plus a temporary pointer which points to the beginning of the current tag when calling `get_updated_html()`. This will preserve the assumption that updating a document doesn't move that pointer, or shift which tag is currently matched.
Configuration menu - View commit details
-
Copy full SHA for 7085970 - Browse repository at this point
Copy the full SHA 7085970View commit details -
Configuration menu - View commit details
-
Copy full SHA for 61346f5 - Browse repository at this point
Copy the full SHA 61346f5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 55ead4f - Browse repository at this point
Copy the full SHA 55ead4fView commit details
Commits on Apr 24, 2023
-
Configuration menu - View commit details
-
Copy full SHA for fb99257 - Browse repository at this point
Copy the full SHA fb99257View commit details -
Configuration menu - View commit details
-
Copy full SHA for d0f8d50 - Browse repository at this point
Copy the full SHA d0f8d50View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3c731b5 - Browse repository at this point
Copy the full SHA 3c731b5View commit details -
Configuration menu - View commit details
-
Copy full SHA for fb4e512 - Browse repository at this point
Copy the full SHA fb4e512View commit details -
Configuration menu - View commit details
-
Copy full SHA for a31fc01 - Browse repository at this point
Copy the full SHA a31fc01View commit details -
Configuration menu - View commit details
-
Copy full SHA for 367dc00 - Browse repository at this point
Copy the full SHA 367dc00View commit details
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.