Closed Bug 956530 Opened 7 years ago Closed 6 years ago method not staying selected on multiple clicks


(Core :: DOM: Selection, defect)

26 Branch
Windows 7
Not set



Tracking Status
firefox40 --- fixed


(Reporter: impressive.webs, Assigned: ehsan.akhgari)


(Keywords: testcase)


(1 file)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36

Steps to reproduce:

Go to this page:

Click in the text field. Then click outside the text field. Then click again inside the text field.

Actual results:

The first time the field is clicked into, the text is selected (highlighted via the select() method). The 2nd time you click into the field (after clicking outside the field, then back inside again) the text is momentarily selected, then it deselects.

Expected results:

The text should always be selected no matter how many times you click into the text field.

Other browser results:

- Google Chrome has the same bug on all clicks, even the first one.
- IE11 and Opera do not have this bug. They correctly select the text on each click.
FYI, I also wrote a blog post about this issue here:

There are brief screencasts showing each browser's behaviour.
Component: Untriaged → DOM: Core & HTML
Keywords: testcase
Product: Firefox → Core
That's .... pretty odd.  Ehsan, do you have time to take a look?
Component: DOM: Core & HTML → Selection
Flags: needinfo?(ehsan)
Yes, but it needs to wait until a weekend or something.  Taking.
Assignee: nobody → ehsan
What's happening here is that the second time that you click on the text box, we detect that you're clicking on a selection, and set the drag state to false here: <>, then in HandleRelease, we detect this case <> and we end up setting the position of the caret forcefully which results in the observed bug.  The reason why this bug happens every other time is that the odd times when you click on the text box, we get to this code <> which causes mouseDown to end up being true in HandleRelease.
Flags: needinfo?(ehsan)
Closed: 6 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in before you can comment on or make changes to this bug.