Firefox renders its own text selection background on top of CodeMirror's
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue:

  • Start editing a page with Firefox
  • Turn "Syntax" on
  • Select some or all of the source

What happens?:
The selected text has the browser's native blue background on top of CodeMirror's purple background.

1.png (597×177 px, 7 KB)

What should have happened instead?:
It only has the purple background.

Other information:
Reproducible with Firefox 153 but not with Chromium 150.

Event Timeline

MusikAnimal moved this task from Backlog to Bugs on the MediaWiki-extensions-CodeMirror board.
MusikAnimal changed the task status from Open to In Progress.Mon, Jul 27, 5:19 PM
MusikAnimal claimed this task.

I've filed a CodeMirror issue at https://discuss.codemirror.net/t/firefox-153-ignores-transparent-selection-styling/9838 but I do think this is likely a browser bug.

We can implement @Nardog's suggestion on Discord in the meantime: background-color: #ffffff01 !important;

Change #1318210 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/extensions/CodeMirror@master] codemirror.less: workaround for transparent selection style in FF

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

Change #1318210 merged by jenkins-bot:

[mediawiki/extensions/CodeMirror@master] codemirror.less: workaround for transparent selection style in FF

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