3728: Copy/paste code diff doesn't work in Firefox 35

stuar******@gmai***** (Google Code) (Is this you? Claim this profile.)
chipx86
chipx86
Feb. 4, 2015
What version are you running?

2.0.12

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

Any code diff page.

What steps will reproduce the problem?
1. Highlight code in one panel, either by dragging over the text, or ctrl+drag selecting table cells.
2. Press Ctrl+C in browser or right-click and choose "Copy" from menu.
3. Press Ctrl+V in a text editor.

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

Expected output is all the highlighted text.

Actual output is the first line of the highlighted text, alone.

If selecting using ctrl+drag to select table cells, the output is two blank lines followed by the text of the first highlighted cell.

What operating system are you using? What browser?

Firefox 35.0, Ubuntu 14.04

Please provide any additional information below.

The issue does not occur in Chromium 39, which is the other browser I tested.

Just upgraded from 2.0.8 to 2.0.12 and disappointed that not only does issue 1094 appear to not work, it also breaks the workaround, which was to ctrl+drag select table cells.

The copy/paste issue could be solved by HTML layout alone if the diffs were structured as one table row per chunk, each column containing an embedded table with all the lines of the chunk, but I can understand if this would cause a lot of code rewriting and make it difficult to select ranges of code that cross chunk boundaries.
#1 stuar******@gmai***** (Google Code) (Is this you? Claim this profile.)
Firefox 35 thinks that a few lines of highlighted text are several independent selection ranges (see attachment), instead of the widely-expected 1.

e.g. from https://developer.mozilla.org/en-US/docs/Web/API/Selection "A selection object represents the ranges that the user has selected. Typically, it holds only one range"

Would it be possible in _copySelectionToClipboard to iterate from 0 to sel.rangeCount to build up 's', instead of using only sel.getRangeAt(0) ?
#2 citr*****@gmai***** (Google Code) (Is this you? Claim this profile.)
This issue is immensely frustrating - it would be great if this was fixed!
chipx86
#3 chipx86
Something changed in Firefox that completely broke copying of text in the diff viewer. It's being investigated.
  • +Confirmed
  • -Priority-Medium
    +Priority-High
    +Project-ReviewBoard
    +Component-DiffViewer
    +Milestone-Release2.0.x
chipx86
#4 chipx86
Fix up for review: https://reviews.reviewboard.org/r/6895/
  • -Confirmed
    +PendingReview
  • +chipx86
chipx86
#5 chipx86
Fixed on release-2.0.x. It'll be part of 2.0.13.
  • -PendingReview
    +Fixed