Closed
Conversation
|
Size Change: +119 B (0%) Total Size: 1.42 MB
ℹ️ View Unchanged
|
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.
WORK IN PROGRESS
Includes changes from #52135 because if the
savefunction needs to be updated here, theeditfunction has to be updated anyway—may as well just combine them into one PR.What?
This is attempting to do actually a few things for the image block with a single block deprecation.
Why?
Fixes a few issues with the addition of
aspect-ratioto the image block.It seemed better to think the whole thing out thoroughly
How?
widthandheightattributes to strings. (It does not actually enable the other units)widthandheightHTML attributes are saved in favor of CSSwidthandheight.Testing Instructions
Screenshots use https://github.com/WordPress/wordpress-develop/blob/62b286f9b2ebc7bb609827a09fcf5136cac5fa01/tests/phpunit/data/images/a2-small.jpg for testing.
This is content for every possible combination of width/height/scale/aspect-ratio for the image block. Be sure to use an image that is smaller than the width of the page and one that doesn't have a 3:4 portrait aspect ratio (as that's the ratio set in the example).
Make sure that there are no layout shifts as images load (can be tested easily with the network throttling option in your browser dev tools).
The sizing for images should look like the "After" screenshot below for both the editor and the frontend.
Screenshots or screencast
Post Editor
Frontend