Page MenuHomePhabricator

Coordinates placement is inconsistent between browsers on some projects when using Vector 2022 (when using absolute positioning, not indicators)
Closed, ResolvedPublic3 Estimated Story Points

Assigned To
Authored By
matmarex
Dec 16 2022, 7:57 PM
Referenced Files
F36891666: image.png
Sat, Mar 4, 1:21 PM
F36891664: image.png
Sat, Mar 4, 1:21 PM
F36867450: Screenshot 2023-02-23 at 7.49.21 PM.png
Fri, Feb 24, 3:50 AM
F36867449: Screenshot 2023-02-23 at 7.48.37 PM.png
Fri, Feb 24, 3:50 AM
F36865876: Screenshot 2023-02-22 at 5.57.03 PM.png
Feb 23 2023, 2:00 AM
F35870437: image.png
Dec 16 2022, 7:57 PM
F35870435: image.png
Dec 16 2022, 7:57 PM
F35870429: image.png
Dec 16 2022, 7:57 PM

Description

Coordinates placement is inconsistent between browsers when using Vector 2022 on projects that display the coordinates using absolute positioning rather than an indicator.

I originally ran into this when tweaking the styles for coordinates at German Wikipedia: https://de.wikipedia.org/wiki/Wikipedia:Technik/Skin/MediaWiki/Änderungen#c-Hgzh-20221215160900-Matma_Rex-20221215110100 where I had applied a CSS workaround to avoid it: https://de.wikipedia.org/w/index.php?title=MediaWiki%3AVector.css&diff=228912775&oldid=228879247.

The problem happens because Vector 2022 styles for the page subtitle etc. trigger a confusing edge case with margin/float/clear, which has a different rendering between browsers. At first I filed this as a Chrome bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1401690 but I'm not sure any more if it's really a bug.

Since many projects are affected, maybe we should change out CSS to avoid this.

Examples:

At https://lt.wikipedia.org/wiki/Krokuva, the coordinates overlap the edit tabs on Chrome, but not Firefox:

ChromeFirefox
image.png (2×3 px, 1 MB)
image.png (2×3 px, 1 MB)

At https://als.wikipedia.org/wiki/Krakau, the coordinates overlap the infobox on Firefox, but not Chrome:

ChromeFirefox
image.png (2×3 px, 850 KB)
image.png (2×3 px, 791 KB)

More examples of the problem on Chrome (not an exhaustive list, I only reviewed ~100 wikis):

More examples of the problem on Firefox (not an exhaustive list, I only reviewed ~100 wikis):

Event Timeline

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

[mediawiki/skins/Vector@master] Work around browser inconsistencies with 'clear' + 'margin-top'

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

Test wiki created on Patch demo by BWang (WMF) using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/b512ddb345/w

Change 870899 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Work around browser inconsistencies with 'clear' + 'margin-top'

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

Test Result - Beta

Status: ✅ PASS
Environment: beta
OS: macOS Ventura
Browser: Chrome
Device: MBP
Emulated Device:NA

Test Artifact(s):

QA Steps

✅ AC1: Coordinates should not overlap other elements on the page.
This passes, but I'm not sure Beta is a good test environment for it given the category Coordinates is not on Wikidata in beta. The sites mentioned above will be tested on the prod wikis. I have confirmed they are currently not displaying correctly in prod.

Screenshot 2023-02-22 at 5.57.03 PM.png (819×1 px, 415 KB)

Edtadros added a subscriber: Edtadros.

Test Result - Prod

Status:
Environment: enwiki
OS: macOS Ventura
Browser: Chrome
Device: MBP
Emulated Device:NA

Test Artifact(s):

QA Steps

❌ AC1: Coordinates should not overlap other elements on the page.

Screenshot 2023-02-23 at 7.48.37 PM.png (536×1 px, 309 KB)

Screenshot 2023-02-23 at 7.49.21 PM.png (664×1 px, 392 KB)

@matmarex could you please advise? I'm not actually seeing any difference before or after this change, and the overlapping is definitely still a problem, but perhaps that was not the goal here (the goal instead being "consistency")? It also looks like the Chromium bug has been closed as WONTFIX.

Indeed the goal was only consistency between Chrome and Firefox, and not yet fixing the overlapping. Previously, when overlapping only occurred on one of these two browsers, it was impossible to fix the appearance in one without breaking the other. Now that overlapping occurs (or doesn't occur) in the same way in both of these two browsers, it can be resolved with on-wiki CSS fixes. I'll try to make those fixes for them at some point.

I think this is the set of pages to review and potentially fix. It may not be a complete list, but it's as complete as it's practical to make it, and it includes all of the affected wikis I found manually when filing this bug. These are the site styles applying to Vector 2022 that style #coordinates with a negative top value:

https://global-search.toolforge.org/?q=%5C%23coordinates%5B%5E%5C%7D%5D*%5B%5E%5C-%5Dtop%5C%3A+%3F%5C-&regex=1&namespaces=8&title=Vector%5C.css%7CVector-2022%5C.css%7CCommon%5C.css

WikiPage title
ar.wikipediaميدياويكي:Common.css
ar.wikipediaميدياويكي:Vector-2022.css
ast.wikipediaMediaWiki:Vector.css
bar.wikipediaMediaWiki:Vector.css
be.wikipediaMediaWiki:Vector.css
bg.wikipediaМедияУики:Vector.css
ceb.wikipediaMediaWiki:Vector.css
da.wikipediaMediaWiki:Vector.css
de.wikipediaMediaWiki:Vector.css
diq.wikipediaMediaWiki:Vector.css
dsb.wikipediaMediaWiki:Vector.css
el.wikipediaMediaWiki:Vector.css
eo.wikipediaMediaWiki:Vector.css
fi.wikipediaJärjestelmäviesti:Vector.css
frr.wikipediaMediaWiki:Vector.css
gan.wikipediaMediaWiki:Vector.css
hsb.wikipediaMediaWiki:Vector.css
id.wikipediaMediaWiki:Vector-2022.css
ko.wikinews미디어위키:Vector.css
krc.wikipediaMediaWiki:Common.css
lo.wikipediaມີເດຍວິກິ:Vector.css
lt.wikipediaMediaWiki:Vector-2022.css
lt.wikipediaMediaWiki:Vector.css
mhr.wikipediaMediaWiki:Vector.css
ml.wikipediaമീഡിയവിക്കി:Vector.css
mn.wikipediaМедиаВики:Vector.css
mwl.wikipediaBiqui:Vector.css
nds-nl.wikipediaMediaWiki:Vector.css
nds.wikipediaMediaWiki:Common.css
nn.wikipediaMediaWiki:Vector.css
pfl.wikipediaMediaWiki:Vector.css
ps.wikipediaميډياويکي:Common.css
pt.wikipediaMediaWiki:Vector.css
rm.wikipediaMediaWiki:Vector.css
ro.wikipediaMediaWiki:Common.css
scn.wikipediaMediaWiki:Common.css
sk.wikipediaMediaWiki:Vector.css
sr.wikipediaМедијавики:Vector.css
th.wikipediaมีเดียวิกิ:Vector.css
udm.wikipediaMediaWiki:Vector.css
vi.wikiquoteMediaWiki:Vector.css
yi.wikipediaמעדיעװיקי:Vector.css
zh.wikipediaMediaWiki:Vector.css
zh.wikisourceMediaWiki:Vector.css

So this hasn't improved anything visually right now but presumably will help with us fixing T281974.

I reviewed the pages and edited some of them.

In most cases it looked like the coordinates were meant to be placed below the page tabs, so I used top: 0 (although this conflicts with the location of indicators, but I'll leave that to be resolved in T281974).

For code in MediaWiki:Common.css and MediaWiki:Vector.css, I added .skin-vector-2022 instead of creating MediaWiki:Vector-2022.css, to make the change easier to review for the maintainers on each wiki, and to make it easier to delete later if those wikis are migrated to use page indicators in the course of T281974.

WikiPage titleNotes
ar.wikipediaميدياويكي:Common.css(see below)
ar.wikipediaميدياويكي:Vector-2022.csshttps://ar.wikipedia.org/w/index.php?title=ميدياويكي:Vector-2022.css&diff=prev&oldid=61352510
ast.wikipediaMediaWiki:Vector.cssNo changes needed (no overlap, above title)
bar.wikipediaMediaWiki:Vector.csshttps://bar.wikipedia.org/w/index.php?title=MediaWiki:Vector.css&diff=prev&oldid=836202
be.wikipediaMediaWiki:Vector.cssNo changes needed (code may be unused, the site uses indicators)
bg.wikipediaМедияУики:Vector.csshttps://bg.wikipedia.org/w/index.php?title=МедияУики:Vector.css&diff=prev&oldid=11702372
ceb.wikipediaMediaWiki:Vector.cssNo changes needed (no overlap, below tabs)
da.wikipediaMediaWiki:Vector.cssNo changes needed (no overlap, below tabs)
de.wikipediaMediaWiki:Vector.cssNo changes needed (no overlap, above title)
diq.wikipediaMediaWiki:Vector.cssNo changes needed (code may be unused, the site uses indicators)
dsb.wikipediaMediaWiki:Vector.csshttps://dsb.wikipedia.org/w/index.php?title=MediaWiki:Vector.css&diff=prev&oldid=144062
el.wikipediaMediaWiki:Vector.cssNo changes needed (no overlap, below tabs)
eo.wikipediaMediaWiki:Vector.cssThis has worse problems than just the coordinates…
fi.wikipediaJärjestelmäviesti:Vector.cssNo changes needed (code may be unused, the site uses indicators)
frr.wikipediaMediaWiki:Vector.csshttps://frr.wikipedia.org/w/index.php?title=MediaWiki:Vector-2022.css&diff=prev&oldid=244947
gan.wikipediaMediaWiki:Vector.csshttps://gan.wikipedia.org/w/index.php?title=MediaWiki:Vector.css&diff=prev&oldid=397245
hsb.wikipediaMediaWiki:Vector.csshttps://hsb.wikipedia.org/w/index.php?title=MediaWiki:Vector.css&diff=prev&oldid=381710
id.wikipediaMediaWiki:Vector-2022.csshttps://id.wikipedia.org/w/index.php?title=MediaWiki:Vector-2022.css&diff=prev&oldid=23050842
ko.wikinews미디어위키:Vector.cssNo changes needed (code may be unused, I couldn't find any pages with coordinates)
krc.wikipediaMediaWiki:Common.cssThis has some JS code moving the coordinates…
lo.wikipediaມີເດຍວິກິ:Vector.cssNo changes needed (no overlap, below tabs)
lt.wikipediaMediaWiki:Vector-2022.csshttps://lt.wikipedia.org/w/index.php?title=MediaWiki:Vector-2022.css&diff=prev&oldid=6900474
lt.wikipediaMediaWiki:Vector.css(see above)
mhr.wikipediaMediaWiki:Vector.csshttps://mhr.wikipedia.org/w/index.php?title=MediaWiki:Vector.css&diff=prev&oldid=189521
ml.wikipediaമീഡിയവിക്കി:Vector.cssNo changes needed (no overlap, below tabs)
mn.wikipediaМедиаВики:Vector.csshttps://mn.wikipedia.org/w/index.php?title=МедиаВики:Vector.css&diff=prev&oldid=724928
mwl.wikipediaBiqui:Vector.cssNo changes needed (code may be unused, I couldn't find any pages with coordinates)
nds-nl.wikipediaMediaWiki:Vector.cssNo changes needed (no overlap, below tabs)
nds.wikipediaMediaWiki:Common.cssThis has some other CSS interfering with the positioning
nn.wikipediaMediaWiki:Vector.csshttps://nn.wikipedia.org/w/index.php?title=MediaWiki:Vector.css&diff=prev&oldid=3464350
pfl.wikipediaMediaWiki:Vector.csshttps://pfl.wikipedia.org/w/index.php?title=MediaWiki:Vector.css&diff=prev&oldid=90548
ps.wikipediaميډياويکي:Common.cssNo changes needed (code may be unused, I couldn't find any pages with coordinates)
pt.wikipediaMediaWiki:Vector.cssNo changes needed (no overlap, below tabs)
rm.wikipediaMediaWiki:Vector.csshttps://rm.wikipedia.org/w/index.php?title=MediaWiki:Vector.css&diff=prev&oldid=164140
ro.wikipediaMediaWiki:Common.cssNo changes needed (code may be unused, the site uses indicators)
scn.wikipediaMediaWiki:Common.csshttps://scn.wikipedia.org/w/index.php?title=MediaWiki:Common.css&diff=prev&oldid=737271
sk.wikipediaMediaWiki:Vector.csshttps://sk.wikipedia.org/w/index.php?title=MediaWiki:Vector.css&diff=prev&oldid=7543261
sr.wikipediaМедијавики:Vector.cssNo changes needed (no overlap, below tabs)
th.wikipediaมีเดียวิกิ:Vector.cssNo changes needed (no overlap, below tabs)
udm.wikipediaMediaWiki:Vector.cssThis has worse problems than just the coordinates…
vi.wikiquoteMediaWiki:Vector.cssNo changes needed (code may be unused, I couldn't find any pages with coordinates)
yi.wikipediaמעדיעװיקי:Vector.cssNo changes needed (no overlap, below tabs)
zh.wikipediaMediaWiki:Vector.csshttps://zh.wikipedia.org/w/index.php?title=MediaWiki:Vector.css&diff=prev&oldid=76177055
zh.wikisourceMediaWiki:Vector.cssNo changes needed (code may be unused, I couldn't find any pages with coordinates)

The FlaggedRevs rating box is broken on huwiki (https://hu.wikipedia.org/w/index.php?title=4_Vesta&useskin=vector-2022&uselang=en, try to hover over [review pending changes] in the indicator area – the bottom 90% of the dropdown is cut off, only a tiny bit of the border is visible), and I think it’s broken by this (I don’t use new Vector, so I discovered this accidentally, but from what I see in the CSS rules, this task seems to be the culprit). What should I do? Huwiki heavily customized the rating box in Vector.css and Vector.js to achieve something like T197912, so I’m not surprised it’s broken, but overriding even more things probably just breaks something else. The best solution would be if someone volunteered resolving T197912 and I could remove the local customization, but it doesn’t sound like a probable scenario given the number of people who actively work on FlaggedRevs…

For reference:

CurrentExpected
image.png (2×3 px, 809 KB)
image.png (2×3 px, 817 KB)

Yes, that is related to the use of .vector-body-before-content { overflow: hidden; } in my patch.

You could override it on-wiki with .vector-body-before-content { overflow: visible; display: flow-root; }. It will have the exact same effect on the flow of elements and positioning, but without cutting off elements. I didn't use it in my patch to make it easier to understand and maintain, since it's a relatively unknown CSS property, and because it's not supported in IE 11.

You already have a similar workaround for the original Vector skin: https://hu.wikipedia.org/wiki/MediaWiki:Vector.css#L-8


edit: I added the workaround: https://hu.wikipedia.org/w/index.php?title=MediaWiki:Vector.css&diff=prev&oldid=25914421

matmarex closed this task as Resolved.EditedMon, Mar 13, 3:07 PM

@ovasileva I assume this means the Readers team isn't planning further work on this. I consider the problem resolved, so I think we can close the task.