Closed Bug 1241856 Opened 8 years ago Closed 6 years ago

Dragging an email is still selecting text in Gmail

Categories

(Web Compatibility :: Site Reports, defect, P1)

Firefox 49
defect

Tracking

(platform-rel -)

RESOLVED FIXED
Tracking Status
platform-rel --- -

People

(Reporter: kevinberaca, Assigned: karlcow)

References

()

Details

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

Attachments

(1 file)

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.
Attached image Drag_selects_text.jpg
This is how it looks for me.
Status: UNCONFIRMED → NEW
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)
Component: Drag and Drop → Event Handling
Added to my todo list
Whiteboard: dom-noted
Whiteboard: dom-noted → dom-triaged
Whiteboard: dom-triaged → dom-triaged [platform-rel-Google] [platform-rel-Gmail]
platform-rel: --- → ?
platform-rel: ? → +
Rank: 7
Rank: 7 → 4
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)
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)
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.
Google has been contacted by email.
Component: Event Handling → Desktop
Flags: needinfo?(kdubost)
Product: Core → Tech Evangelism
Version: 44 Branch → Firefox 49
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]
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: → 1285171
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)
(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)
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)
platform-rel: + → -
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
Priority: -- → P1
On the new interface of Gmail, the issue is no longer reproducible.
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Product: Tech Evangelism → Web Compatibility
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: