The color picker starts to follow the pointer if the pointer is pressed down and then released outside the tooltip frame (in the markup view)

RESOLVED FIXED in Firefox 40

Status

()

Firefox
Developer Tools: Inspector
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: Sami Jaktholm, Assigned: Sami Jaktholm)

Tracking

unspecified
Firefox 40
Unspecified
Linux
Points:
---

Firefox Tracking Flags

(firefox40 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

3 years ago
Steps to reproduce:

1. Go to data:text/html;charset=utf-8,<div style="color: red">red
2. Inspect the red text
3. Click on the color swatch in the rule-view
4. Press mouse down to select a color and drag it
5. Drag the pointer outside the tooltip frame and release the mouse button
6. Move the pointer back inside the color picker and move it around

What happens: The color changes constantly as the picker keeps following the mouse.

What should happen: The picker should not follow the pointer if the mouse button is not pressed down.

The spectrum [1] should probably check the buttons attribute of the mousemove [2] event to check if a button is still pressed as it can't receive mouseup events that happen outside the frame to abort the movement.

[1] https://dxr.mozilla.org/mozilla-central/source/browser/devtools/shared/widgets/Spectrum.js#164
[2] https://w3c.github.io/uievents/#widl-MouseEvent-buttons
(Assignee)

Comment 1

3 years ago
Created attachment 8600973 [details] [diff] [review]
bug-1160720-color-picker-tooltip.patch

Here's a fix for this. It aborts the drag if there's no buttons pressed down on mousemove.

The test in this patch is quite complex. I tried to write simpler one in shared/test/browser_spectrum.js but for some reason I wasn't able to get the widget to hear events sent via EventUtils there.
Assignee: nobody → sjakthol
Status: NEW → ASSIGNED
Attachment #8600973 - Flags: review?(pbrosset)
(Assignee)

Comment 2

3 years ago
Try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=d14449d40031
Comment on attachment 8600973 [details] [diff] [review]
bug-1160720-color-picker-tooltip.patch

Thanks Sami for working on this. Unfortunately I'll be off the rest of this week, and Brian should be a better reviewer than me for this since he's the author of the Spectrum widget.
Attachment #8600973 - Flags: review?(pbrosset) → review?(bgrinstead)
Hi Sami, thanks for the patch.  I'm not able to reproduce the problem (I've checked on osx, windows and linux while mousing up outside of the tooltip frame, and even outside of the entire browser window.  The fix makes sense, but I'd like to narrow down exactly the scenario this happens in.
Flags: needinfo?(sjakthol)
Note: the test case does fails for me without the fix applied but I still can't figure out how to reproduce manually
(Assignee)

Comment 6

3 years ago
Interesting. I can't reproduce this on Windows and now that you pointed it out I can't always reproduce it on Ubuntu 14.04 either.

For example, if I release the button over the page content, this doesn't seem to happen. On Ubuntu 14.04 the best way I've figured out so far is to release the mouse button on top of the markup view.

That seems to reliably reproduce the issue but it sure seems odd that it only happens on certain platforms and when the mouse is released at specific points. Or maybe this happens to me due to some setting I've toggled or an application I've installed. I'll check if I can reproduce this with stock Ubuntu 14.04 installation later.
Flags: needinfo?(sjakthol)
(In reply to Sami Jaktholm from comment #6)
> Interesting. I can't reproduce this on Windows and now that you pointed it
> out I can't always reproduce it on Ubuntu 14.04 either.
> 
> For example, if I release the button over the page content, this doesn't
> seem to happen. On Ubuntu 14.04 the best way I've figured out so far is to
> release the mouse button on top of the markup view.

OK, thanks for the info.  I was able to reproduce by mousing up somewhere in the markup view on Ubuntu.
Summary: The color picker starts to follow the pointer if the pointer is pressed down and then released outside the tooltip frame → The color picker starts to follow the pointer if the pointer is pressed down and then released outside the tooltip frame (in the markup view)
OS: Unspecified → Linux
Comment on attachment 8600973 [details] [diff] [review]
bug-1160720-color-picker-tooltip.patch

Review of attachment 8600973 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good.  Please update the commit message with r=bgrins
Attachment #8600973 - Flags: review?(bgrinstead) → review+
(Assignee)

Comment 9

3 years ago
Created attachment 8602172 [details] [diff] [review]
bug-1160720-color-picker-tooltip.patch

Rebased patch with correct reviewer and updated commit message.
Attachment #8602172 - Flags: review+
(Assignee)

Updated

3 years ago
Attachment #8600973 - Attachment is obsolete: true
(Assignee)

Updated

3 years ago
Keywords: checkin-needed

Comment 10

3 years ago
https://hg.mozilla.org/integration/fx-team/rev/019c10ffbe16
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/019c10ffbe16
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
status-firefox40: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 40
You need to log in before you can comment on or make changes to this bug.