Fix: Update Interactivity API Use of Private HTML API Classes to avoid Crash #56928
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.
Previously the HTML API was using a mixture of approaches in its helper classes for describing spans of text. One was (start, end) and the other was (start, length). In WordPress/wordpress-develop#5721 these were all normalized to (start, length) but the Interactivity API was not updated in concert with that change.
In this patch the
inner_html
methods are updated to use the appropriate formats.A following PR is necessary to update the compat layer so that crashes don't appear on sites running older versions of WordPress with this updated code.
cc: @luisherranz @ockham
What?
Why?
How?
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast