4518: Copying from diff viewer in Firefox omits last line

gmyers
chipx86
chipx86

What version are you running?

Have observed with 3.0a0, 2.5.7, and 2.5.2.

What's the URL of the page containing the problem?

Any diff viewer page.

What steps will reproduce the problem?

First, let me say I'm having a bit of a hard time believing that this is a bug, especially because I've never encountered it before despite years of daily RB use with Firefox. But I have now reproduced the issue on multiple machines with multiple versions of Firefox. Maybe a Windows Firefox user could be so kind as attempt to reproduce it and report back?

The issue is when using Firefox in Windows and attempting to copy code from the diff viewer. Doesn't seem to matter if the copy is from the left or right side, or if the selected line(s) have modifications or not. If a single line is copied then it can be pasted successfully into any other application, such as a notepad tool. However, if N lines are selected and copied (when N>1), then only N-1 lines paste successfully and the final line is always omitted. Does not matter if the copy is performed via Ctrl-C or the right-click context menu.

I have verified this on several machines with Firefox versions including 48.?, 50.0.2, 50.1.0, 51.0.1, and against the range of RB versions listed above. I've tried running Firefox in safe mode with plugins disabled, but it makes no difference. I've also tested with Chrome and IE on these machines and here all lines do in fact copy/paste as expected. Finally I've tested with several Firefox versions under CentOS and can not reproduce the issue there.

Going even further, I've observed no problem with copy/paste from the Description or Testing Done fields of the review request. When considering all of these observations, perhaps it points to a Firefox and not an RB bug, but either way it seems very specific an localized.

What is the expected output? What do you see instead?

All selected lines are copied and can be succesfully pasted.

What operating system are you using? What browser?

Windows 7 and 10. Firefox 48.?, 50.0.2, 50.1.0, 51.0.1

glepretre
#1 glepretre

I confirm this issue using Firefox 51 on Linux Debian 8 Jessie

chipx86
#2 chipx86

Because of how selection works in tables (browsers will select across rows and include whitespace from in-between the various tags), we have to intercept the selection and copy/paste and do some work on our end. It's sounding like Firefox may have broken something in the eventing/APIs we're using for this... Investigating.

  • +Release-2.5.x
  • +Browser
    +Component:DiffViewer
  • +chipx86
chipx86
#3 chipx86

Fix pending review: https://reviews.reviewboard.org/r/8752/

  • -New
    +PendingReview
chipx86
#4 chipx86

Pushed to release-2.0.x (cd9c4a6fa5bd192a576dbb7fa1e12860b43f5ef8) and merged into release-2.5.x, etc. Aiming to get this out tomorrow in 2.0.x/2.5.x releases.

  • -PendingReview
    +Fixed