Page MenuHomePhabricator

MediaWiki gallery Slideshow should not repaint/reflow
Open, Needs TriagePublic

Description

Galleries in slideshow mode reposition themselves when JS loads. This impacts all skins (shown in gif Minerva, but also impacts Vector).

ezgif-1-5f5ffe3921a4.gif (600×355 px, 155 KB)

Replication steps

Create a page with the following wikitext:

<gallery mode=slideshow heights=150px style="text-align:left">
File:Detroit Publishing Co. - A Yeoman of the Guard (N.B. actually a Yeoman Warder), full restoration.jpg|A Yeoman Warder, from a Victorian-era [[photochrom]]
File:Official_program_-_Woman_suffrage_procession_March_3,_1913_-_crop.jpg|The Official program of the 1913 Woman Suffrage Procession held in Washington, D.C.
File:Joseph Ferdinand Keppler - The Pirate Publisher - Puck Magazine - Restoration by Adam Cuerden.jpg|"The Pirate Publisher", a satire of copyright infringement from the magazine ''[[Puck (magazine)|Puck]]''.
</gallery>

Expected behaviour

For users with JS, gallery should reserve the space it needs and not resize/rearrange itself when the code has loaded. It may possibly preload the icons, but definitely should reserve the space needed for that part of the interface.

With JS disabled, it should behave per normal - client-js and client-nojs classes will be needed here.

This blocks enabling slideshow on mobile (see parent task).

Details

Event Timeline

Jdlrobson renamed this task from Slideshow should not repaint/reflow to MediaWiki gallery Slideshow should not repaint/reflow.Dec 14 2022, 8:48 PM

Change 868175 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/core@master] Galleries on mobile

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

The above patch mostly takes care of it for modern browsers e.g. it's good enough. I think the code would need a much larger refactor if we wanted to remove the repaint entirely.

Change 868175 merged by jenkins-bot:

[mediawiki/core@master] Galleries on mobile

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

Jdlrobson claimed this task.

The improvement can be seen here:
https://en.wikipedia.beta.wmflabs.org/wiki/A_gallery_page#Foo

There is still an unresolved issue where the small image expands that we should fix which I've captured in T326270

matmarex subscribed.

Proposed revert in https://gerrit.wikimedia.org/r/c/mediawiki/core/+/881005, because the changes caused T326990, and unlike other issues it's not feasible to fix quickly.

Change 881025 had a related patch set uploaded (by Jdlrobson; author: Bartosz Dziewoński):

[mediawiki/core@master] [wip] Gallery: Improve gallery for mobile (take 2)

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

Change 881025 abandoned by Jdlrobson:

[mediawiki/core@master] Gallery: Rewrite

Reason:

Not working on this currently as have too much on my plate :-( cc @thedj who also said he was interested in rewriting this.

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