Page MenuHomePhabricator

Most images are not centered at mobile screen widths in Parsoid HTML
Open, MediumPublic

Assigned To
None
Authored By
Mholloway
Mar 23 2018, 8:11 PM
Referenced Files
F16005156: off-center.png
Mar 23 2018, 8:11 PM
F16005159: centered.png
Mar 23 2018, 8:11 PM
Tokens
"Like" token, awarded by Kozuch.

Description

When viewing Parsoid HTML at mobile device widths with Minerva styling, most images are not centered:

off-center.png (797×628 px, 269 KB)

The exception is certain images in mw-galleries, which do appear centered:

centered.png (797×628 px, 254 KB)

The expectation is that all images would be centered when viewed at mobile screen widths, as happens on the production mobile sites.

(Images from http://parsoid-minerva.wmflabs.org/en.wikipedia.org/v3/page/html/Hummingbird)

Related: T171727

Event Timeline

Mholloway renamed this task from Most images are not centered at sub-tablet widths in Parsoid HTML to Most images are not centered at mobile screen widths in Parsoid HTML.Mar 23 2018, 8:18 PM
Mholloway updated the task description. (Show Details)
Jdlrobson subscribed.

This doesn't really surprise me. We have made near zero effort to make Minerva styles work with Parsoid.

@Mholloway to help prioritise what is motivating you here to get this fixed?

As a side project to T188919 I've been trying to eliminate as much of the app-specific CSS odds and ends from the MobileApp extension as possible, by directing the apps toward upstream modules providing the needed styling, or simply discarding them if they're obsolete. One piece that remains is https://github.com/wikimedia/mediawiki-extensions-MobileApp/blob/master/styles/parsoid/figure.less, which is used by the Android app for centering images in Parsoid HTML that aren't centered and widened via the apps' image widening transform.

In most cases I was able to find upstream styles to replace the hacky MobileApp CSS, but this wasn't one of them.

I've been trying to match Parsoid styles with MediaWiki core styles - I think this is important to future proof against any changes to the parser. If you want to submit such patches to Minerva, go for it. I only get concerned when the styles are radically different...

We have figure styling for instance in MinervaNeue/resources/skins.minerva.content.styles/thumbnails.less

ovasileva triaged this task as Medium priority.Mar 29 2018, 3:05 PM

If this task is still relevant the URI in the description should be updated so we have a frame of reference.