webcompat / web-bugs

A place to report bugs on websites.
https://webcompat.com
Mozilla Public License 2.0
736 stars 63 forks source link

www.wikipedia.org – “Media Viewer” text is misaligned in "Preferances>Files" page #6248

Closed softvision-oana-arbuzov closed 5 years ago

softvision-oana-arbuzov commented 7 years ago

URL: https://en.m.wikivoyage.org/wiki/Special:Preferences/files Browser / Version: Firefox Mobile Nightly 55.0a1 (2017-04-26) Operating System: Android 6.0.1 Problem type: Something else - I'll add details below

Prerequisites:

  1. Disconnect from VPN, in order to create account.
  2. Account created and signed in.

Steps to Reproduce

  1. Navigate to: https://en.m.wikivoyage.org/wiki/Special:Preferences/files.
  2. Observe the display of “Enable Media Viewer” option.

Expected Behavior: “Enable” and “Media Viewer” texts are aligned.

Actual Behavior: “Media Viewer” text is misaligned.

Note:

  1. Reproducible also for French language. https://fr.m.wikivoyage.org/wiki/Spécial:Préférences/files
  2. Reproducible also on the Firefox 52.0 Release
  3. Not reproducible on Chrome (Mobile) 57.0.2987.132.
  4. Screenshot attached.

Watchers: @softvision-sergiulogigan @softvision-oana-arbuzov

sv; country: fr

Screenshot Description

From webcompat.com with ❤️

karlcow commented 7 years ago

The HTML

<div class="mw-ui-checkbox">
    <input name="wpmultimediaviewer-enable" value="1" checked="checked"
        id="mw-input-wpmultimediaviewer-enable" type="checkbox">&nbsp;
    <label for="mw-input-wpmultimediaviewer-enable">Activer <span class="plainlinks"><a class="external text" href="https://www.mediawiki.org/wiki/Special:MyLanguage/Extension:Media_Viewer/About">la visionneuse de médias</a></span></label>
</div>

and the associated CSS.

.client-js .mw-ui-checkbox:not(#noop) {
    position: relative;
    display: table;
}

.client-js .mw-ui-checkbox:not(#noop) input[type="checkbox"] + label {
    display: table-cell;
}

we can see all of that into

capture d ecran 2017-05-03 a 15 54 17

if we remove the

.client-js .mw-ui-checkbox:not(#noop) * {
    font: inherit;
    /* vertical-align: middle; */
}

it displays in the bottom of the cell but at least aligned.

capture d ecran 2017-05-03 a 16 03 54

Let's check how the boxes are organized on WebKit

capture d ecran 2017-05-03 a 16 02 36

karlcow commented 7 years ago

It's interesting because on Gecko vertical-align: for top, baseline and bottom. all align correctly the text, but when it's middle it's messy. display: inline-flex on the a seems the improve things, but still not perfect.

.client-js .mw-ui-checkbox:not(#noop) * {
    font: inherit;
    vertical-align: middle;
    display: inline-flex;
}

capture d ecran 2017-05-03 a 16 11 02

The best way is to replace everything which is table with a flex model.

@dbaron may know why there is a difference in between WebKit/Blink and Gecko.

softvision-oana-arbuzov commented 6 years ago

The issue is still reproducible.

Tested with: Browser / Version: Firefox Mobile Nightly 59.0a1 (2018-01-04) Operating System: Google Pixel (Android 8.1.0) - 1080 x 1920 pixels (~441 ppi pixel density), Samsung Galaxy S7 Edge (Android 7.0) - Resolution 1440 x 2560 pixels (~534 ppi pixel density)

karlcow commented 6 years ago

fixed by adding Roboto to the list of fonts.

body {
    font-family: 'Helvetica Neue','Helvetica','Nimbus Sans L','Arial','Liberation Sans', Roboto, sans-serif;
    line-height: 1.4;
    color: #222222;
}
karlcow commented 6 years ago

Close as duplicate of https://bugzilla.mozilla.org/show_bug.cgi?id=1392147

softvision-sergiulogigan commented 6 years ago

Issue is still reproducible. tested on Huawei P10, Android 7.0 and Nightly 62.

image

karlcow commented 6 years ago

So back to the initial suggestion. This is fixing it.

.client-js .mw-ui-checkbox:not(#noop) * {
    font: inherit;
    /* vertical-align: middle; */
}
karlcow commented 6 years ago

All mediawiki projects have the same issue btw.

https://en.m.wikipedia.org/wiki/Special:Preferences#mw-prefsection-rendering

This is set in https://github.com/wikimedia/mediawiki/blob/f2aa8e40f57f97358408b70a5428babd535d6271/resources/src/mediawiki.ui/components/checkbox.less#L46-L50

and probably @jdlrobson can help us fix it.

cipriansv commented 5 years ago

After retesting the issue I confirm that the issue has been fixed.

image

Tested with: Browser / Version: Firefox Nightly 68.0a1 (2019-06-24), Firefox Fenix (Preview) 1.0.1926 Operating System: Huawei P10 (Android 8.0) - 1080 x 1920 pixels (~432 ppi pixel density)