mouse movement changes selected text even when no key or mouse key is pressed

RESOLVED FIXED in mozilla2.0b12

Status

()

RESOLVED FIXED
8 years ago
8 years ago

People

(Reporter: kdevel, Assigned: enndeakin)

Tracking

({regression})

Trunk
mozilla2.0b12
x86_64
Linux
regression
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(blocking2.0 .x+)

Details

Attachments

(2 attachments, 3 obsolete attachments)

(Reporter)

Description

8 years ago
User-Agent:       
Build Identifier: Mozilla/5.0 (X11; Linux x86_64; rv:2.0b9pre) Gecko/20100101 Firefox/4.0b9pre

Mouse movements without keys pressed modify the current text selection as if the left mouse button is still pressed.

Reproducible: Always

Steps to Reproduce:
1. clear cookies, load www.youtube.com
   -> box (light blue background) with "Welcome to YouTube! Suggested 
      Location Filte..." appears
2. Place mouse cursor in front of "W" in "Welcome".
3. Click and hold left mouse button until step 5
4. Move (mark) downwards until mouse is in the advertisement image
   -> text in box is selected
5. release left mouse button.
6. slowly move mouse up
Actual Results:  
Selection shrinks as if left mouse button is still pressed.

Expected Results:  
Keep selection after releasing left mouse button.
(Reporter)

Comment 1

8 years ago
Built from http://hg.mozilla.org/mozilla-central/rev/df3c1150dd7a

Comment 2

8 years ago
Regression window:
Works:
http://hg.mozilla.org/mozilla-central/rev/bf0fdec8f43b
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.3a1pre) Gecko/20090913 Minefield/3.7a1pre ID:20090913032541
Fails:
http://hg.mozilla.org/mozilla-central/rev/912c6ae3b70c
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.3a1pre) Gecko/20090914 Minefield/3.7a1pre ID:20090914031022
Pushlog:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=bf0fdec8f43b&tochange=912c6ae3b70c

In local build,
build from eda2433181c9 : Fails
build from 8afb65205203 : works

Regressed by:
eda2433181c9	Neil Deakin — Bug 503943, add mouse capturing api to elements, remove capturing from views, r=roc,sr=smaug
Blocks: 503943
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: regression

Updated

8 years ago
Component: General → Event Handling
Product: Firefox → Core
QA Contact: general → events
Version: unspecified → Trunk
blocking2.0: --- → ?
Blocking, but .x. I don't think we absolutely have to fix this for 2.0. Over to Neil as this appears to be a regression from his changes.
Assignee: nobody → enndeakin
blocking2.0: ? → .x
(Assignee)

Comment 4

8 years ago
Need a testcase, or at least some steps to reproduce that aren't dependent on what youtube website looks like. (There is no text 'Welcome to YouTube!...' when I view it)
Keywords: testcase-wanted
(Reporter)

Comment 5

8 years ago
Created attachment 507090 [details]
testcase
(Reporter)

Comment 6

8 years ago
STR:

1. click and hold before the "N" in the first line
2. drag into the iframe
3. release button
4. move to second line
(Reporter)

Comment 7

8 years ago
Created attachment 507091 [details]
testcase
Attachment #507090 - Attachment is obsolete: true
(Assignee)

Comment 8

8 years ago
This is caused because SetMouseDownState(PR_TRUE) is called on the parent presshell when the mouse is pressed, and on SetMouseDownState(PR_FALSE) the child frame's presshell when the mouse is released.

So SetMouseDownState(PR_FALSE) will need to be retargeted to the right presshell.
(Assignee)

Comment 9

8 years ago
Created attachment 507140 [details]
possible patch

This demonstrates a fix, but it probably isn't the right place to clear the mousedown state.
(Assignee)

Comment 10

8 years ago
Created attachment 508459 [details] [diff] [review]
better patch
Attachment #507140 - Attachment is obsolete: true
Attachment #508459 - Flags: review?(Olli.Pettay)
Attachment #508459 - Flags: review?(Olli.Pettay) → review+
(Assignee)

Updated

8 years ago
Attachment #508459 - Flags: approval2.0?
     frameSelection->SetMouseDownState(PR_FALSE);
     frameSelection->StopAutoScrollTimer();
   }
 
+  if (captureContent) {
+    nsIDocument* doc = captureContent->GetCurrentDoc();
+    if (doc) {
+      nsIPresShell* capturingShell = doc->GetShell();
+      if (capturingShell && capturingShell != PresContext()->GetPresShell()) {
+        nsCOMPtr<nsFrameSelection> frameSelection = capturingShell->FrameSelection();
+        frameSelection->SetMouseDownState(PR_FALSE);
+        frameSelection->StopAutoScrollTimer();

Can we restructure things a little bit so we only have one call to SetMouseDownState and StopAutoScrollTimer?

Updated

8 years ago
Attachment #508459 - Flags: approval2.0? → approval2.0+
(Assignee)

Comment 12

8 years ago
Created attachment 509317 [details] [diff] [review]
updated for comments
Attachment #508459 - Attachment is obsolete: true
(Assignee)

Updated

8 years ago
Keywords: testcase-wanted → checkin-needed

Comment 13

8 years ago
http://hg.mozilla.org/mozilla-central/rev/f1f0bf6fedbb
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Flags: in-testsuite+
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b12
You need to log in before you can comment on or make changes to this bug.