-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WP_HTML_Tag_Processor: Make
get_attribute
reflect attribute set via…
… `set_attribute`, even without updating (#46680) * WP_HTML_Tag_Processor: Ensure that reads after writes reflect most-updated values. (#46680) Currently there exists a data race in the tag processor when reading the attribute value for an attribute that has previously been updated. This is due to the fact that when reading attribute values we examine the input HTML document and overlook potential enqueued updates. If we call `get_updated_html()` before reading then those updates are all flushed out and our values will match what we expect, but if we skip this step then we read stale information read during the first parse of the updated tag. In this patch we're fixing that bug by inspecting the set of enqueued changes when reading attribute values. If an update is already enqueued for a given attribute then we read the value from that update instead of from the original HTML. This ensures that the value we report is always the most-recent or most-updated value. Co-Authored-By: Adam Zielinski <[email protected]> Co-Authored-By: Dennis Snell <[email protected]>
- Loading branch information
1 parent
ac4d1db
commit f272fa6
Showing
2 changed files
with
599 additions
and
32 deletions.
There are no files selected for viewing
This file contains 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
Oops, something went wrong.