In the new MW version, 1.46.0-wmf.16, rolled out to group 1 about 1h ago, some images became extremely big. The most prominent example is on the itwiki main page: https://it.wikipedia.org/wiki/Pagina_principale (the wp25 image). There seem to be multiple templates affected, for example https://it.wikipedia.org/wiki/Anatidae (via https://it.wikipedia.org/wiki/Template:Tassobox).
Description
Details
Related Objects
Event Timeline
Probably related to https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1227492; removing the data-mw-parsoid-version attribute from .mw-parser-output or removing the new CSS that was added in that patch fixes the image size
Change #1240383 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):
[mediawiki/core@master] Revert "Support CSS/JS thumbnail sizing in Parsoid"
It took me a trillion ages to verify this locally, between figuring out how to enable parsoid read views, importing some styles, working around a random deadlock, and finally needing a hard-refresh having forgotten that I had re-enabled caches, but eventually I was able to confirm -- reverting r1227492 fixes the issue.
I really need to step away from the screen for a bit now, but my impression is that this warrants a deployment of the revert, unless someone tells me there's a local workaround and that this won't impact other wikis.
I expect the CSS on line 36 of https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1227492/19/resources/src/mediawiki.skinning/accessibility.less is to blame. It unconditionally sets width to 250px for all mw-default-size class images, and that class is set more widely in Linker.php.
I don't understand the patch fully to suggest a fix (maybe it should have been 'auto'), but for now, we should revert the patch.
Change #1240384 had a related patch set uploaded (by SomeRandomDeveloper; author: Daimona Eaytoy):
[mediawiki/core@wmf/1.46.0-wmf.16] Revert "Support CSS/JS thumbnail sizing in Parsoid"
Correction: Linker.php is for the legacy parser, but Parsoid also sets the mw-default-size class.
Change #1240384 merged by jenkins-bot:
[mediawiki/core@wmf/1.46.0-wmf.16] Revert "Support CSS/JS thumbnail sizing in Parsoid"
Mentioned in SAL (#wikimedia-operations) [2026-02-18T21:49:17Z] <ladsgroup@deploy2002> Started scap sync-world: Backport for [[gerrit:1240384|Revert "Support CSS/JS thumbnail sizing in Parsoid" (T417828)]]
Mentioned in SAL (#wikimedia-operations) [2026-02-18T21:51:22Z] <ladsgroup@deploy2002> ladsgroup, somerandomdeveloper: Backport for [[gerrit:1240384|Revert "Support CSS/JS thumbnail sizing in Parsoid" (T417828)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.
Mentioned in SAL (#wikimedia-operations) [2026-02-18T21:56:30Z] <ladsgroup@deploy2002> Finished scap sync-world: Backport for [[gerrit:1240384|Revert "Support CSS/JS thumbnail sizing in Parsoid" (T417828)]] (duration: 07m 14s)
This was part of an experiment to support user-customizable thumbnail sizes in Parsoid output (T375981: Preferences settings for small image size are not being respected for Parsoid Read Views). Parsoid sets mw-default-size to indicate images which don't have a width or height set in the wikitext, which are generally then used at the wiki's default thumbnail size. The thing we missed in review was that this applies *only if the image is natively larger than the default thumbnail size*; we never upscale an image to meet the default thumbnail size.
This is probably a deficiency in Parsoid's Mediawiki DOM Spec output: although we have the information about the native image size available (in the data-file-width and data-file-height attributes), I don't believe CSS can natively do a "less than" query on these attribute values, so there's no way to write the "correct" CSS here. I think Parsoid is going to have to either:
- Only emit the mw-default-size class for images that are greater than/equal the thumbnail size, or
- Add a separate class for "not upscaled" images, so that the CSS can know to leave them alone.
There's an added wrinkle here, in that the "thumbnail size" is user-customizable. So if the user thumbnail size preferences are 180, 250, and 400 (say), images which are 200px wide will be scaled down for the "small" thumbnail size preference but not scaled up for the "standard" and "large" preferences. Similarly, and image which is natively 300px will be scaled down for small and standard thumbnail size preferences but not for the 'large' one. These breakpoints are going to have to be hardcoded in Parsoid as well if it is to emit classes to distinguish these cases. Hmm.
We'll continue this discussion in T375981: Preferences settings for small image size are not being respected for Parsoid Read Views.
Change #1240756 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):
[mediawiki/core@master] Fix CSS/JS thumbnail sizing in Parsoid: don't upscale small images
Change #1240383 abandoned by C. Scott Ananian:
[mediawiki/core@master] Revert "Support CSS/JS thumbnail sizing in Parsoid"
Reason:
Abandoned in favor of Ibc00445d4a49c2a6477528b512f89a4577f42b0d
Change #1240756 merged by jenkins-bot:
[mediawiki/core@master] Fix CSS/JS thumbnail sizing in Parsoid: don't upscale small images