Closed Bug 1327880 Opened 8 years ago Closed 7 years ago

Preview of 2nd selection range appears in wrong place when I drag-n-drop text

Categories

(Core :: DOM: Copy & Paste and Drag & Drop, defect)

defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: arni2033, Unassigned)

Details

>>>   My Info:   Win7_64, Nightly 49, 32bit, ID 20160526082509
STR_1:
1. Open url [1]
2. Click on the 1st "Click" button, then drag selected word "First"
3. Click on the 2nd "Click" button, then drag selected word "Third"

AR:
 Step 2 - previews of 1st and 2nd selection ranges of dragging text (i.e. words "First" and "Second")
          appear respectively to their relative positioning.
 Step 3 - preview of the 2nd selection range appears far away from its logical place
ER:
 Step 3 - preview of the 2nd selection range should appear near the preview of the 1st selection range
          i.e. 40px to the right from preview of word "Third". Reference of good behavior: Step 2.


[1]
data:text/html,
<script>
  function setSelection(firstId, secondId) {
    function addRangeById(id){
      var rng = document.createRange();
      rng.selectNode(document.getElementById(id));
      sel.addRange(rng);
    }

    var sel = window.getSelection();
    sel.removeAllRanges();
    addRangeById(firstId);
    addRangeById(secondId);
  }
</script>

<div id="div_1" style="position:fixed;top:0px;left:000px; width:200px;">
  <div>
  <button id="button_1" onclick="setSelection('A','B')">Click1</button>
  <span id="A">First</span> then <span id="B">Second</span>
  </div>
</div>

<div id="div_2" style="position:fixed;top:6px;left:200px;">
  <button id="button_2" onclick="setSelection('C','D')">Click2</button>
  <span id="C">Third</span> then <span id="D">ForthForthForthForthForthForthForthForthForthForthForthForthForth</span>
</div>
No longer blocks: 1277113
Component: Untriaged → Drag and Drop
Product: Firefox → Core
Can't reproduce this. Likely fixed by 1301673.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.