Dragging an email is still selecting text in Gmail

ASSIGNED
Assigned to

Status

P1
normal
Rank:
4
ASSIGNED
3 years ago
5 months ago

People

(Reporter: kevinberaca, Assigned: karlcow)

Tracking

Firefox Tracking Flags

(platform-rel -)

Details

(Whiteboard: dom-triaged [platform-rel-Google] [platform-rel-Gmail] [js] [sitewait], URL)

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0
Build ID: 20160120154102

Steps to reproduce:

1. Log into Gmail (I made sure to test this with add-ons disabled).
2. Hold left click on an e-mail.
3. Drag it anywhere.


Actual results:

It moves (drags) the e-mail, but it also selects the text around it.


Expected results:

It should just drag the e-mail.
(Reporter)

Comment 1

3 years ago
Created attachment 8711006 [details]
Drag_selects_text.jpg

This is how it looks for me.

Updated

3 years ago
Status: UNCONFIRMED → NEW
Component: Untriaged → Untriaged
Ever confirmed: true
Product: Firefox → Core
Summary: Dragging an e-mail also selects text → Dragging an email is still selecting text in Gmail
Hi Vitesse,

I have tested this issue on latest Firefox (44.0) release and latest Nightly (47.0a1) release and I have managed to reproduce it. 

Firefox:44.0, Build ID: 20160123151951, User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0
Firefox: 47.0a1, Build ID: 20160201030241, User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0

Considering this I will assign a component to it.

Thanks,
Cosmin.
Component: Untriaged → Drag and Drop
Neil, is this your wheelhouse?
Flags: needinfo?(enndeakin)
Drag and drop API isn't being used here. Likely doing something with mouse events and not cancelling the event. Brief testing shows that the mousedown event isn't cancelled when the selection handling code is run at nsFrame::HandlePress.
Flags: needinfo?(enndeakin)

Updated

3 years ago
Component: Drag and Drop → Event Handling

Comment 5

3 years ago
Added to my todo list
Whiteboard: dom-noted
Whiteboard: dom-noted → dom-triaged
Duplicate of this bug: 1246026
Whiteboard: dom-triaged → dom-triaged [platform-rel-Google] [platform-rel-Gmail]

Updated

2 years ago
platform-rel: --- → ?

Updated

2 years ago
platform-rel: ? → +
Blocks: 1286385

Updated

2 years ago
Rank: 7

Updated

2 years ago
Rank: 7 → 4

Comment 7

2 years ago
I can also reproduce on Microsoft Edge 38.14393.0.0 Windows10 home 64bit
smaug, do you have any ideas as to what's up here?
Flags: needinfo?(bugs)
Mike, given comment 4 and comment 7 it seems like this may be a website issue. Can you or someone on your team work your magic and investigate?
Flags: needinfo?(miket)
Tom, can you take a look?
Flags: needinfo?(wisniewskit)
Flags: needinfo?(miket)
Flags: needinfo?(bugs)

Comment 11

2 years ago
Sure. Stepping through the debugger in Chrome, it looks like preventDefault is indeed never being called on mousedown. I'm not sure how Chrome manages to stop the text from being selectable despite this, as I don't see them applying -webkit-user-select:none to the elements either (or if they are, it's not showing up in their CSS inspector just after the mousedown handler is called).

However, calling preventDefault on the event does fix things for Firefox. Just run this in the console after page-load to see it in action (note of course that closure_lm_650743 changes names with page reload, so you can't just blindly copy-paste):

>var Cp = $('.Cp');
>var Cp_handler = Cp.closure_lm_650743.ha.mousedown[0].listener;
>Cp.closure_lm_650743.ha.mousedown[0].listener = function() {
>    var rv = Cp_handler.apply(this, arguments);
>    var evt = arguments[0];
>    if (evt.type == "mousedown") evt.preventDefault();
>    return rv;
>}

The actual mousedown handler is the following function, which does seem to try to preventDefault if the mousedown event isn't specially handled by the Gsb() function (which does not seem to preventDefault itself).

> (in rs=AHGWq9C8-1m4aAGes0vxQcOlrVA_wjDm-A.html)
> 
>IA.prototype.$a = function(a) {
>    var b = a.type;
>    if ("mousedown" != b || ud(a, 0) || ud(a, 2))
>        if ("click" != b && "dblclick" != b || ud(a, 0)) {
>            a.ra = !1;
>            var c = this.tNa(a.target);
>            c ? "click" == b || "dblclick" == b ? Gsb(this, a, c) : "keydown" == b ? Gsb(this, a, c) : "mouseover" == b ? this.UMa(a, c) : "mouseout" == b ? this.TMa(a, c) : "mousedown" == b ? Gsb(this, a, c) : "contextmenu" == b && Gsb(this, a, c) : "mousedown" == b && a.preventDefault();
>            // ** snipped code for size **
>        }
>    }
>};

Based on this, it may be a trivial fix for them (just call preventDefault on *all* mousedowns in that function, whether Gsb() is called as well or not).
Flags: needinfo?(wisniewskit)
Thanks for the analysis! Do you/WebCompat have contacts on the GMail team or should we go through email?
Flags: needinfo?(wisniewskit)

Comment 13

2 years ago
I'm actually not sure. karl, would you happen to know if we have contacts for GMail for such issues?
Flags: needinfo?(wisniewskit) → needinfo?(kdubost)
(In reply to Thomas Wisniewski from comment #13)
> I'm actually not sure. karl, would you happen to know if we have contacts
> for GMail for such issues?

Great work, Thomas.

A DL exists of which members of Gmail (Sanda and Martin) are active.

A few steps though:
1. Email :jst to add you to the DL (it's one of the few that I don't admin)
2. Email the DL with the info and fix addressing it to Sanda, Martin and the Gmail team 

Myself, Karl or :miket can provide more info via email as needed.
(Assignee)

Comment 15

2 years ago
Google has been contacted by email.
Component: Event Handling → Desktop
Flags: needinfo?(kdubost)
Product: Core → Tech Evangelism
Version: 44 Branch → Firefox 49
(Assignee)

Updated

2 years ago
Assignee: nobody → kdubost
Status: NEW → ASSIGNED
Whiteboard: dom-triaged [platform-rel-Google] [platform-rel-Gmail] → dom-triaged [platform-rel-Google] [platform-rel-Gmail] [js] [sitewait]

Comment 16

2 years ago
Is this perhaps also due to the same problem (on Google keep, also a selecting issue when dragging cards): https://bugzilla.mozilla.org/show_bug.cgi?id=1285171
(In reply to skroon from comment #16)
> Is this perhaps also due to the same problem (on Google keep, also a
> selecting issue when dragging cards):
> https://bugzilla.mozilla.org/show_bug.cgi?id=1285171

I think you're right.
See Also: → bug 1285171

Comment 18

2 years ago
It's now been almost a month since :karlcow reported Google had been emailed, without any update on that front.  Have they acknowledged the email or indicated they'll look into this?
(In reply to skroon from comment #18)
> It's now been almost a month since :karlcow reported Google had been
> emailed, without any update on that front.  Have they acknowledged the email
> or indicated they'll look into this?

They indicated at the time that a bug was filed in their internal bug tracker for this issue, and it was added to their regular bug triage queue. We haven't had an update since (there may be updates in their internal tracker, but we don't have access to that).
Thomas based on your analysis in Comment 11 are you able to retest? Perhaps this has moved internal within the Gmail team - but they haven't alerted us.
Flags: needinfo?(wisniewskit)

Comment 21

2 years ago
(In reply to Desigan Chinniah [:cyberdees] [:dees] [London - GMT] from comment #20)
> Thomas based on your analysis in Comment 11 are you able to retest?

Nope, the text is still selected for me in GMail as before, in both release and nightly. Calling preventDefault as in comment #11 still seems to fix it, too, so I don't think anything has changed (at least not on the public version of GMail I can access).
Flags: needinfo?(wisniewskit)
Karl, can we bring this up to Google again please? It seems like nothing has been fixed here and it's been ~3 months. Thanks!
Flags: needinfo?(kdubost)
(Assignee)

Comment 23

2 years ago
I will. 3 months ago.

> Thanks for the report, I've filed http://b/32761364 and added it to our regular bug triage queue. Thanks to Thomas for the analysis!

I asked about the status today.
Flags: needinfo?(kdubost)

Updated

2 years ago
platform-rel: + → -
Duplicate of this bug: 881989
Results while going through bug#881989 to see if it was still a valid issue:

I can still reproduce this on all three platforms with the latest builds of fx.

Quick example of the issue: https://youtu.be/vSZJBLublAI

Builds:

* fx54.0, buildid: 20170608105825, changeset: e832ed037a3c - reproduced
* fx55.0b3, buildid: 20170619071954, changeset: be4a0ad5d6ca - reproduced
* fx56.0a1, buildid: 20170620030208, changeset: 7a6baa6cca32 - reproduced

Platforms:

* macOS 10.12.5 x64 - reproduced
* Ubuntu 16.04.2 LTS x64 VM - reproduced
* Win 10 x64 VM - reproduced
OS: Unspecified → All
Hardware: Unspecified → All

Updated

5 months ago
Duplicate of this bug: 1446049
You need to log in before you can comment on or make changes to this bug.