Open Bug 1028117 Opened 10 years ago Updated 3 years ago

Selection changes when highlighted text is updated

Categories

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

x86_64
Windows 7
defect

Tracking

()

UNCONFIRMED

People

(Reporter: jastekken, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0 (Beta/Release)
Build ID: 20140619030203

Steps to reproduce:

1. Go to any Reddit thread that has comments newer than 23 hours.
2. Select comment text by dragging (created an attachment to show what to select)
3. Wait until live update triggers (happens each 20 seconds)


Actual results:

Time stamp before your selection get's added to the start of your selection.
Time stamp that ended your selection gets un-highlighted (is still selected).


Expected results:

Highlighted area should stay the same, only the updated content in it should change.
OR
Highlighted area should stay the same and updated content should not get updated if it was highlighted by the user.
Long description about the behavior:

The live update that Reddit uses (I haven't seen this anywhere else) causes selected text to update too. This would be fine, even if not what user wants, if it would work correctly. Reddit updates time that has passed after the comment was posted. Let's say that timestamp of parent comment is string1 and timestamp of comment straight below it is string2.

I would start selecting text by dragging a rectagle starting from the same line after string1 and going down to the line that ends with string2 (See the attachment). Now I should've selected some text that start with whatever is on the next line after string1 and ends with "string2".

You can confirm this is indeed correct by copying it and paste it somewhere. When the update triggers the string1 gets highlighted and string2 loses it's highlight. String2 seems to be actually still selected because if you copy the selection it still includes string2. However, if you were to right-click and press "Search [your_default_search_engine] for..." it will only search the string that is currently highlighted.

String1 needs to be right before the selection-start and string2 needs to be the last string in selection, including newlines. If you select only the time stamp (end your dragging to the same line where it is) it will count as string2 and gets un-highlighted when the update happens. If you start your selection to the right from the time stamp and go to the start of the next line before any other text, you will initially select only a newline. At least Firefox thinks you have selected something as context menu shows "copy" "view selection source etc". But on update the time stamp gets added to the selection.

I tracked this to start with Nightly cset f890732ebaa3 from dec2011 and there was indeed a major selection bug 619273 landed in there. Before that, something similar does happen at least until 4.0beta1. Firefox 3.6.x is unaffected as it gives javascript error and content update never happens. 

What happened before is that string1 doesn't get highlighted until window goes out of focus. String1 does still get selected on content update as it gets copied and context menu entry get's updated, it just isn't highlighted. String2 still loses it's highlight, but this time it doesn't need to be the last bit of the selection. Behavior after cset f890732ebaa3 doesn't seem to care whether window is focused or not so I'll leave details about earlier behavior to that.

It doesn't seems to matter if you start the selection from up or from down, both result in same behavior. It is always reproducible with HWA on or off. However, it seems Reddit doesn't update timestamps older than 23 hours. I have tried this only with Windows 7.

Bulk-downgrade of unassigned, >=3 years untouched DOM/Storage bug's priority.

If you have reason to believe this is wrong, please write a comment and ni :jstutte.

Severity: normal → S4
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: