Page MenuHomePhabricator

class=noresize is invalid for video file
Open, LowPublic

Description

One solution to T367463 is: add the noresize class to the image element. But this is invalid for video file.

See:

This problem can only be fixed by the solution given in T367463#9890708:

body.skin--responsive .mw-parser-output table video {
  max-width: none !important;
}

Details

Event Timeline

@Shizhao: Thanks for reporting this. Please use the bug report form (linked from the top of the task creation page) to create a bug report, and fill in all the sections in the template. Thanks.

Noresize is a bit of a workaround, but there theoretically can be lots of elements inside a thumbnail. Adding every element possible seems like it might not scale, but i think adding it for video might be warranted.

However, the best approach for a page like the one linked, is to redesign it with flex or grid css to make sure that it is actually responsive to different widths, instead of slapping a class on it that says “do not be responsive”.
With or without norisze, the current page is completely unusable on mobile
https://commons.m.wikimedia.org/wiki/Template:Potd/2024-07

If it worked properly in mobile, you wont need the noresize class for this situation either
The template in question seems to be: https://commons.wikimedia.org/w/index.php?title=Template:Potd_and_Motd/Day

Looking at this specific example, it looks like its mainly an issue due to the fact that the other table column has a "width: 100". That said, I agree with @TheDJ, it doesnt hurts to include video along with img

Web team reviewed this today in quarterly grooming and this task is still valid and should be retained in backlog.

Change #1299323 had a related patch set uploaded (by Shadabgdg; author: Shadabgdg):

[mediawiki/core@master] Allow noresize to disable max-width for videos

https://gerrit.wikimedia.org/r/1299323

Shadabgdg subscribed.

I've uploaded a proposed fix for review https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1299323

I chose to extend the existing noresize handling to video.mw-file-element rather than introducing a separate table video rule. Since images already opt out of the responsive max-width behavior through the noresize mechanism, applying the same behavior to videos seemed like a consistent approach that keeps the logic in one place and avoids adding a special case for tables.

That said, I'm happy to update the implementation if a different approach is preferred.

Just to reiterate, that the table design of https://commons.wikimedia.org/wiki/Template:Potd/2024-07, especially with the usage of width=100% on one column, while there is clearly less than 100% space available is the problem that should be fixed.

Even with noresize supporting video, using no resize to fix https://commons.wikimedia.org/wiki/Template:Potd/2024-07 is the wrong fix for the problem that particular page has. Its just stacking more hacks upon hacks.