Page MenuHomePhabricator

Syntax highlighting disables middle button copy/paste in Firefox
Open, Needs TriagePublic


When syntax highlighting is enabled as a beta feature AND enabled in the edit window, it is not possible to use the middle button to paste into the editing form in the original source editor in Firefox.

  • Action: Select text from anywhere on screen, position the mouse pointer anywhere in the editing form where text can be added, press the middle mouse button
  • expected result: text selected is pasted at the mouse pointer location
  • actual result: nothing happens

Anything selected in the editing window is not added to this copy/paste buffer so the previous contents are pasted into other applications.

  • Action: Select any text in the editing form. Move the mouse pointer to anywhere text can be added (editing form, edit summary box, word processing document, etc.) and press the middle button.
  • Expected result: The selected text is pasted
  • Actual result in the editing form: Nothing happens
  • Actual result elsewhere: Previously selected text is pasted (i.e. as if you'd never selected anything in the editing area)

Parts of the page outside the editing form, e.g. the page title and copyright warning message can be selected and pasted into other applications as expected.
Pasting into the edit summary box works as expected (as long as text was selected elsewhere than the editing area)
Ctrl+C / Ctrl+V copy paste always works as expected.
If syntax highlighting is turned off using the menu bar icon then everything works as expected. It breaks again when turned back on. This therefore serves as a useful workaround.

Reproducibility: Always using Firefox 56.0, never using Chromium 64.0.3282.167, never using Konqueror 4.14.16 all running on Xubuntu Linux 16.04 LTS. I don't have any other browser/OS combinations available to test.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 1 2018, 11:45 AM
TheDJ added a subscriber: TheDJ.

Was tagged with the wrong project.

Restricted Application added a project: Community-Tech. · View Herald TranscriptAug 10 2018, 11:30 PM
Niharika added a subscriber: Niharika.

I think this is is related to all of the other Firefox problems (T177509) which are caused by not using contentEditable dialog. And that in turn is blocked on contentEditable breaking access keys (T95104#3644021).
We should weigh the benefits of having working access keys versus having spellchecking and other features at some point.

I can confirm a different behavior with CodeMirror and without CodeMirror on WikiText editor 2010 on Linux.

  • Without CodeMirror: Selecting a text with the mouse automatically copies the text to the clipboard. A middle-click pastes the content of the clipboard at the position.
  • With CodeMirror: Selecting a text with the mouse does not copy the text to clipboard. A middle-click still pastes the content of the clipboard at the position. But it is a old content.

Automatic copy to clipboard on select and past on middle click is a specific feature of Linux, so this is not present on other environments.

This problem is not related to T177509 and happens without activated spellcheck and with activated spellcheck by rECMIc4257d8e6a83.

Tested with Firefox 65 on Ubuntu 16.04.

Is this a duplicate of T174635?