Page MenuHomePhabricator

Elements with position fixed, sticky, etc. break with DarkMode in Firefox
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Enable DarkMode extension
  • Try to assign any element a fixed position

What happens?:

Elements function as they should until the dark theme is activated, then all positions stop working. This happens when using all skins and happens to all types of elements.

What should have happened instead?:

The elements should stay in their fixed position

Software version (skip for WMF-hosted wikis like Wikipedia):

MediaWiki1.38.1 (2a9470c)
PHP 7.4.28 (fpm-fcgi)
MariaDB 10.5.16-MariaDB

Other information (browser name/version, screenshots, etc.):

Test page to see the error: https://www.obeymewiki.com/wiki/Fixed_Position_Test

This is the same reported issue as this one: https://phabricator.wikimedia.org/T311899

There is also another similar bug report here: https://phabricator.wikimedia.org/T305149

Event Timeline

MusikAnimal changed the task status from Open to Stalled.Aug 1 2022, 12:33 AM
MusikAnimal subscribed.

This has now been fixed with https://gerrit.wikimedia.org/r/c/mediawiki/extensions/DarkMode/+/734390 but the issue persists for Firefox due to an upstream bug. I'm going re-purpose this task to serve as tracking that.

The fix for Chromium is now in master and I will get it cherry-picked to REL1_38 when I can test it later. For the record, this issue was known and fixed in DarkMode's initial release, but someone broke it. To be fair, I didn't do my part of leaving comments in the code explaining the implementation, but there are comments now (and I'm actually watching the repository now!) so hopefully this won't get broken again.

MusikAnimal renamed this task from Elements with position fixed, sticky, etc. break with DarkMode in all skins to Elements with position fixed, sticky, etc. break with DarkMode in Firefox.Aug 1 2022, 12:34 AM

I'm not exactly an expert in how extensions work, but if there's been a fixed added, does that mean the extension needs re-installing or something else be done for that update to take effect? I ask because it seems like nothing has changed, and the issue still happens on my wiki with all skins and all "fixed" elements, not just when I use Firefox but also in Google Chrome.

I'm not exactly an expert in how extensions work, but if there's been a fixed added, does that mean the extension needs re-installing or something else be done for that update to take effect? I ask because it seems like nothing has changed, and the issue still happens on my wiki with all skins and all "fixed" elements, not just when I use Firefox but also in Google Chrome.

It looks like your wiki is on Miraheze, so you can't simply pull in the latest changes, rather a sysadmin will have to do it for you. I need to first test this on MediaWiki 1.38 though, but once that's done I will be contacting Miraheze staff to update DarkMode. So hang tight :) Just to be clear this fix won't help in Firefox (yet), and only Mozilla can change that, hence the Upstream tag.

Okay I see, thank you for the explanation and for working on fixing things!

So I guess someone from Mirahzeze updated the extension, and the fixed position in dark mode now works even when using Firefox, which is great...except this change seems to have caused an even worse problem.

All of the custom CSS I created for my wiki's dark theme is being treated as if it doesn't exist. The "client-dark-mode" class is still there on the CSS page, but only the default invert filter is being used on all wiki pages. It took me numerous hours to write up, test, and perfect all of that code, and without it, the dark theme on my wiki looks awful.

Edit: I've figured out the problem. It looks like the code was changed so that it reads:

<html class="client-js client-darkmode ve-not-available" dir="ltr" lang="en">

The now missing hyphen means the "client-dark-mode" class isn't recognized anymore. I'm assuming that isn't something Miraheze staff did, but a change in the extension code itself? I've changed all of my CSS code so that the hyphen is removed to match this change, but for all of the other wikis that I assume also use custom CSS with their dark themes, it might be easier for them if the class was changed back to "client-dark-mode"

The upstream Firefox bug appears to have been fixed. Is this still an issue?

MusikAnimal claimed this task.

Indeed, it looks like this can be resolved now.