Open Bug 1145249 Opened 9 years ago Updated 2 years ago

On javascript select, primary clipboard is not updated

Categories

(Core :: DOM: Events, defect, P5)

36 Branch
x86_64
Linux
defect

Tracking

()

People

(Reporter: Phyks, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0
Build ID: 20150305221847

Steps to reproduce:

This is a Linux-specific problem (as far as I know)

* Go to https://git.eleves.ens.fr/hackens/NichoirsEcocampus
* Click in the bar with the repo address (https://git.eleves.ens.fr/hackens/NichoirsEcocampus.git)


Actual results:

* Open a terminal and press Maj + Insert to insert the content of the primary clipboard. The previously hilighted text is not past.


Expected results:

* There is a Javascript click event which selects (call to Jquery select function) and let thinks this is copied to primary X clipboard (as it usually contains selection).
Reproduced with 2015-03-22-03-02-16-mozilla-central-firefox-39.0a1.en-US.linux-x86_64.

> * Open a terminal and press Maj + Insert to insert the content of the primary clipboard.

Note that this is a bad idea with untrusted sites (better use a text editor instead): http://thejh.net/misc/website-terminal-copy-paste
QA Whiteboard: [bugday-20150323]
Component: Untriaged → DOM: Events
Product: Firefox → Core
The steps don't work for me as described, I have to double click the repository URL to get it to load text into the system's clipboard. A single click is not sufficient in any browser (tested back to Firefox 4), I must use double-click to copy the text into my clipboard.

Firefox 4.0 works as described, the whole URL is copied. 
Firefox 14.0.1 and later just copy the word I double click on, not the entire URL. 

Unfortunately I will not be able to regress this further because Firefox 5 through 13 just crash on my system on startup.
Status: UNCONFIRMED → NEW
QA Whiteboard: [bugday-20150323] → [bugday-20150323][triaged]
Ever confirmed: true
Keywords: regression
Please check that you do not have any extra soft to do synchronization between the clipboards, if you cannot reproduce. 

This bug looks a lot like this one https://bugzilla.mozilla.org/show_bug.cgi?id=226853 which has been marked resolved.

Anthony Hughes: Even using double click, it does not copy the full address on my system (but it does copy part of the address).

Aleksej: Indeed, that was just the easier use case I could found.
(In reply to Lucas Verney [:Phyks] from comment #3)
> Please check that you do not have any extra soft to do synchronization
> between the clipboards, if you cannot reproduce. 

As far as I know I don't as this was tested on a brand new Fedora 21 installation. Literally brand new as I installed it fresh just to test this bug.

> 
> This bug looks a lot like this one
> https://bugzilla.mozilla.org/show_bug.cgi?id=226853 which has been marked
> resolved.

That was fixed *years* ago so it's entirely possible that we regressed this with another change. 

> Anthony Hughes: Even using double click, it does not copy the full address
> on my system (but it does copy part of the address).

Well then I don't know. Single click never seems to copy data to a clipboard for me, no matter what I test. I tried Chromium and it doesn't copy on single click with my system either.

> Aleksej: Indeed, that was just the easier use case I could found.

My recommendation to you would be to check if this is a regression on your system by using the mozregression tool. http://mozilla.github.io/mozregression/install.html
Concer(In reply to Anthony Hughes, QA Mentor (:ashughes) from comment #4)
> (In reply to Lucas Verney [:Phyks] from comment #3)
> > Please check that you do not have any extra soft to do synchronization
> > between the clipboards, if you cannot reproduce. 
> 
> As far as I know I don't as this was tested on a brand new Fedora 21
> installation. Literally brand new as I installed it fresh just to test this
> bug.

Yes, but if you are running a full desktop environment such as Gnome, it might setup clipboard synchronization as well.

> > This bug looks a lot like this one
> > https://bugzilla.mozilla.org/show_bug.cgi?id=226853 which has been marked
> > resolved.
> 
> That was fixed *years* ago so it's entirely possible that we regressed this
> with another change. 

The behaviour is similar, that is what I meant. The referenced bug is fixed and I cannot reproduce it in latest stable.


> > Anthony Hughes: Even using double click, it does not copy the full address
> > on my system (but it does copy part of the address).
> 
> Well then I don't know. Single click never seems to copy data to a clipboard
> for me, no matter what I test. I tried Chromium and it doesn't copy on
> single click with my system either.

If I select text in a webpage (hilighting text), it does get copied in the selection clipboard, as expected. 

Double clicking the address bar selects the URL and also copies it to the selection clipboard, as expected.

In the example page provided:
* Single clicking hilights the text, but does not copy it in selection clipboard, which is not an expected behaviour.
* Double clicking hilights the whole text, but only copy the word under the cursor (normally selected by double click) in the selection clipboard, which is not an expected behaviour either.
* Trip clicking do copy the full text in the selection clipboard, as expected.

> > Aleksej: Indeed, that was just the easier use case I could found.
> 
> My recommendation to you would be to check if this is a regression on your
> system by using the mozregression tool.
> http://mozilla.github.io/mozregression/install.html

I am not sure at all this is a regression as I just noticed it recently and never had such use case in the past (I had clipboard synchronization in the past).
Hm, there is a confusion here.

(In reply to Lucas Verney [:Phyks] from comment #0)
> * Open a terminal and press Maj + Insert to insert the content of the
> primary clipboard.

https://en.wikipedia.org/wiki/X_Window_selection#Clipboard

Selections:
* PRIMARY: copies when you select, pastes when you middle-click.
* CLIPBOARD: copies when you Ctrl+C or Ctrl+Ins, pastes when you Ctrl+V or Shift+Ins.

("Maj" means "Shift" in Spanish)
(In reply to Lucas Verney [:Phyks] from comment #5)
> > My recommendation to you would be to check if this is a regression on your
> > system by using the mozregression tool.
> > http://mozilla.github.io/mozregression/install.html
> 
> I am not sure at all this is a regression as I just noticed it recently and
> never had such use case in the past (I had clipboard synchronization in the
> past).

The only way you'll know for sure is to go back and test older versions of Firefox which is exactly what the mozregression tool is designed to do. Unfortunately since this is not reproducible to me, the responsibility lies with you. Otherwise this bug will go nowhere.
Aleksej: Indeed, "Maj" means "Shift" in French, I did not notice my mistake.

There is no confusion on my part though:
* PRIMARY and CLIPBOARD are as you defined them.
* On my system, I use Shift+Insert to paste the PRIMARY (and not CLIPBOARD), although that may not be the usual shortcut, I can confirm this.
I had a try at mozregression. Most of the available builds will simply not run on my system, so I cannot try them.

The oldest ones seem to not support the select event triggering via JavaScript (see jQuery this.select() method). So of course, it is working nice as I have to manually select the text with the cursor.

On the newest ones, this bug is present.

It seems that it is that the JavaScript select event triggering (see jQuery this.select() method) is not the same as cursor selection and hence does not copy text to the primary clipboard.
Keywords: regression
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.