Make WordPress Core

Opened 7 weeks ago

Last modified 4 weeks ago

#62597 new defect (bug)

WordPress 6.7 sizes="auto" is messing featured image on chrome mobile.

Reported by: maciejmackowiak's profile maciejmackowiak Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.7
Component: Post Thumbnails Keywords: has-patch has-testing-info has-screenshots
Focuses: ui, css, administration Cc:

Description

WordPress 6.7 added sizes=”auto” for some images.
In wp-admin on chrome when we have the classic editor plugin active the featured image is "squashed".
This seems to be the issues with css rule height: auto for #postimagediv .inside img which cannot be simply overriden, it needs to be deleted to fix the issue.

The easiest way to reproduce is to set featured image to any square image.

https://i.postimg.cc/4457NnhX/obraz.png
https://i.postimg.cc/TPgh8P6M/obraz.png

Change History (9)

#1 @sainathpoojary
7 weeks ago

Reproduction Report

Description

This report validates whether the issue can be reproduced.

Environment

  • WordPress: 6.7.1
  • PHP: 8.1.29
  • Server: nginx/1.16.0
  • Database: mysqli (Server: 8.0.16 / Client: mysqlnd 8.1.29)
  • Browser: Chrome 131.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty-Five 1.0
  • MU Plugins: None activated
  • Plugins:
    • Classic Editor 1.6.6
    • Test Reports 1.2.0

Actual Results

  1. ✅ Error condition occurs.

Supplemental Artifacts

https://utfs.io/f/PL8E4NiPUWyOosOW6eVgRVfkrM3cxj5whHLEvyNZCb2PpWuo

This ticket was mentioned in PR #7910 on WordPress/wordpress-develop by @sainathpoojary.


7 weeks ago
#2

  • Keywords has-patch added

Remove height: auto from #postimagediv .inside img to prevent distortion of featured images in the Classic Editor.

Trac ticket: #62597

#3 @abcd95
7 weeks ago

  • Keywords has-testing-info has-screenshots added

Test Report

Description

This report validates that the indicated patch works as expected.

Environment

  • WordPress: 6.7.1
  • PHP: 8.1.29
  • Server: nginx/1.16.0
  • Database: mysqli (Server: 8.0.16 / Client: mysqlnd 8.1.29)
  • Browser: Chrome 131.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty-Five 1.0
  • Plugins:
    • Classic Editor 1.6.6

Actual Results

✅ Issue resolved with patch.

Supplemental Artifacts

Screenshot - https://postimg.cc/62kDGbkG

#4 @sukhendu2002
7 weeks ago

Test Report

Description

This report validates whether the indicated patch works as expected.

Patch tested: https://github.com/WordPress/wordpress-develop/pull/7910

Environment

  • WordPress: 6.8-alpha-59274-src
  • PHP: 8.2.26
  • Server: nginx/1.27.3
  • Database: mysqli (Server: 8.0.40 / Client: mysqlnd 8.2.26)
  • Browser: Chrome 131.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty-Five 1.0
  • MU Plugins: None activated
  • Plugins:
    • Classic Editor 1.6.6
    • Test Reports 1.2.0

Actual Results

  1. ✅ Issue resolved with patch.

Supplemental Artifacts

Before

https://utfs.io/f/TTyF6MLuAyHDeFFbRaerQjuAYVHZvEhTSDrJIM8mRCfKXya7

After

https://utfs.io/f/TTyF6MLuAyHDfX4HnIyUy7JRH3j6GQamK94Eq8WIpX2sYnuC

#5 @archon810
7 weeks ago

Great! Can we hope for inclusion in WordPress 6.7.2?

#6 @mukesh27
7 weeks ago

Hi there, Thanks for ticket.

Instead of removing the CSS we should add CSS that we added in frontend in [59415]

img:is([sizes="auto" i], [sizes^="auto," i]) {
    contain-intrinsic-size: 3000px 1500px;
}

#7 @sainathpoojary
7 weeks ago

hey @mukesh27,

I attempted to implement the provided CSS solution:

img:is([sizes="auto" i], [sizes^="auto," i]) {
    contain-intrinsic-size: 3000px 1500px;
}

However, this resulted in behavior that seems different from what we had in WordPress v6.6.1. Here’s the comparison:

https://utfs.io/f/PL8E4NiPUWyODJv0JdAHytsWpNIfogBi6bRx3aQ5ZFMdLhY1

But after adding the suggested CSS, this is the current result:

https://utfs.io/f/PL8E4NiPUWyOqSCREtFX9AiSFV8fHmyxUp5oh3rcqWCNB1LI

This issue appears to be linked to the fact that we previously set height: auto, which allowed the image to take its contain-intrinsic-size (1500px), as shown in the preview below:

https://utfs.io/f/PL8E4NiPUWyOWfLNaNf7vRTdgHAZJIiLnBPhzUw3Yx4NMe0m

Also, I noticed some inconsistencies between Firefox and Chrome after following thecontain-intrinsic-size approach:

https://utfs.io/f/PL8E4NiPUWyOW22SLy7vRTdgHAZJIiLnBPhzUw3Yx4NMe0mq

Although removing height:auto was working as intended because it was taking the actual height of the image

https://utfs.io/f/PL8E4NiPUWyOyP17zPurklRUAJtWNBdDhG4x38K5vZL2FHcf

While the removal of height: auto behavior seems to work as expected, I’m curious about your thoughts on this. Could there be another approach to fix the issue while maintaining consistency across browsers? Any advice would be appreciated!

#8 @archon810
4 weeks ago

Can the dev team please prioritize the fix for the next hotfix release? The icons have been looking broken for weeks.

This ticket was mentioned in Slack in #core-media by archon810. View the logs.


4 weeks ago

Note: See TracTickets for help on using tickets.