Closed Bug 1127160 Opened 9 years ago Closed 9 years ago

[text selection]No new line copied after copying multiple lines from email compose view

Categories

(Firefox OS Graveyard :: Gaia::E-Mail, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:2.2+, b2g-v2.2 verified, b2g-master verified)

VERIFIED FIXED
2.2 S5 (6feb)
blocking-b2g 2.2+
Tracking Status
b2g-v2.2 --- verified
b2g-master --- verified

People

(Reporter: pchang, Assigned: jrburke)

References

Details

Attachments

(2 files)

This bug is created according to bug 1121335 comment 2.
The following is the copied information from bug 1121335.


a. Email app assigns -moz-user-selection:none for all elements by default, and change to -moz-user-select:text if the element is content editable. Under this configuration, the <br> becomes unselectable. Therefore, it introduces multiple selection ranges in compose view if users input text as multiple lines. It causes some trobule during the multiple lines copying because the <br> is not selectable.
OS: Linux → Gonk (Firefox OS)
Hardware: x86_64 → ARM
Blocks: CopyPasteGaia
No longer blocks: CopyPasteLegacy
blocking-b2g: --- → 2.2?
Assignee: nobody → jrburke
I tried using -moz-user-select: all, but I cannot reliably get the copy/paste buttons to show up with it. The diff I am trying:

https://github.com/jrburke/gaia/compare/bug1127160-email-compose-select

Here is a zip of the email app with this change:

http://jrburke.com/work/gaia/email-select.zip

It can be unzipped locally and pushed to flame device (assumes latest master) using the WebIDE.

Steps I was using:

* Go to email compose, type two short lines of text.
* tap and hold to bring up selection. Sometimes it would select, but no buttons, if I swipe up, then the buttons would show up so that I could copy. I pressed copy.
* Then go back to email list, then back into compose.
* Tap and hold in text area to hopefully see paste button. Sometimes I can get it to show up, but pressing it does not insert any text.

Asking if :pchang has extra guidance as far as if we should be doing this CSS change or something else, and if this is the correct thing to do if the button display and selection difficulties are being tracked as other bugs.
Flags: needinfo?(pchang)
Target Milestone: --- → 2.2 S5 (6feb)
George, could you help to answer the comment 1?
Flags: needinfo?(pchang) → needinfo?(gduan)
(In reply to James Burke [:jrburke] from comment #1)
> I tried using -moz-user-select: all, but I cannot reliably get the
> copy/paste buttons to show up with it. The diff I am trying:
> 
> https://github.com/jrburke/gaia/compare/bug1127160-email-compose-select
> 
> Here is a zip of the email app with this change:
> 
> http://jrburke.com/work/gaia/email-select.zip
> 
> It can be unzipped locally and pushed to flame device (assumes latest
> master) using the WebIDE.
> 
> Steps I was using:
> 
> * Go to email compose, type two short lines of text.
Edge gesture is easily triggered and it might cause some wierd copypaste behavior. 
> * tap and hold to bring up selection. Sometimes it would select, but no
> buttons, if I swipe up, then the buttons would show up so that I could copy.
Does the caret show? And how about the keyboard?
> I pressed copy.
> * Then go back to email list, then back into compose.
> * Tap and hold in text area to hopefully see paste button. Sometimes I can
> get it to show up, but pressing it does not insert any text.
Is the input field empty? In collpased mode, currently gecko doesn't send new position event, so I will close the bubble instead. Gecko and gaia have bug to trace it (bug 1127207)
However, when it shows up, the copy function should work. That will help if there's a video ... 

> 
> Asking if :pchang has extra guidance as far as if we should be doing this
> CSS change or something else, and if this is the correct thing to do if the
> button display and selection difficulties are being tracked as other bugs.
Flags: needinfo?(gduan)
(In reply to George Duan [:gduan] [:喬智] from comment #3)
> (In reply to James Burke [:jrburke] from comment #1)
> > * tap and hold to bring up selection. Sometimes it would select, but no
> > buttons, if I swipe up, then the buttons would show up so that I could copy.
> Does the caret show? And how about the keyboard?

While there initially, depending on my taps in the area, at some point the caret does disappear. The keyboard visible always though.

> > * Tap and hold in text area to hopefully see paste button. Sometimes I can
> > get it to show up, but pressing it does not insert any text.
> Is the input field empty? In collpased mode, currently gecko doesn't send
> new position event, so I will close the bubble instead. Gecko and gaia have
> bug to trace it (bug 1127207)
> However, when it shows up, the copy function should work. That will help if
> there's a video ... 


This is for a div with contenteditable set on it, so more than just an input, but it did have text in it.

This bug was about being able to copy the text in the Compose card and have it preserve the line returns. 

As far as changes the email app can do to help this is to make sure children of the contenteditable field all have `-moz-user-select: text;` set on them, to catch the br tags in the text field. I just tried that, and that fixes the missing line return problem, and the copy/paste buttons showing up.

(Summary, do not use `-moz-user-select: all;` for those nodes)

I will have the email app change up for review shortly.
Attachment #8559280 - Flags: review?(bugmail)
Comment on attachment 8559280 [details] [review]
[PullReq] jrburke:bug1127160-email-compose-select to mozilla-b2g:master

The * selector always makes me cringe, but this does make the most sense.  It's too bad we can't use scoped styles because of CSP (and they don't support links to external files, it seems.)  Although it's possible that would have CSS engine costs anyways.  Maybe that's a future win for the shadow DOM!  (Or I guess just iframes.)
Attachment #8559280 - Flags: review?(bugmail) → review+
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Comment on attachment 8559280 [details] [review]
[PullReq] jrburke:bug1127160-email-compose-select to mozilla-b2g:master

[Approval Request Comment]
[Bug caused by] (feature/regressing bug #):
This further supports the text selection feature that is part of 2.2.

[User impact] if declined:
If copying text from the compose area, it will not include line returns.

[Testing completed]:
On flame device.

[Risk to taking this patch] (and alternatives if risky):
Very low, just a CSS change, scoped to just the compose area and only affects the text selection property.

[String changes made]:
none
Attachment #8559280 - Flags: approval-gaia-v2.2?
blocking-b2g: 2.2? → 2.2+
Attachment #8559280 - Flags: approval-gaia-v2.2? → approval-gaia-v2.2+
This bug has been verified as "pass" on latest nightly build of Flame v2.2&Master by the STR of comment 1.

Actual results: User is able to copy the text freely in the 'Compose' area, and the lines return normally when copying/pasting in Email. 
See attachment: verified_Flame_v2.2.3gp
Reproduce rate: 0/10


Device: Flame v2.2 (Verified) 
Build ID               20150712002506
Gaia Revision          84d0c76370dcd3d25813b00de55194730884355b
Gaia Date              2015-07-09 13:09:14
Gecko Revision         https://hg.mozilla.org/releases/mozilla-b2g37_v2_2/rev/8d59402ba85a
Gecko Version          37.0
Device Name            flame
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.cltbld.20150712.040416
Firmware Date          Sun Jul 12 04:04:27 EDT 2015
Bootloader             L1TC000118D0

Device: Flame master (Verified)
Build ID               20150712010205
Gaia Revision          e4b63559eba364892867eb381c3002d6518e5d6a
Gaia Date              2015-07-10 14:29:23
Gecko Revision         https://hg.mozilla.org/mozilla-central/rev/eab21ec484bb
Gecko Version          42.0a1
Device Name            flame
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.cltbld.20150712.050401
Firmware Date          Sun Jul 12 05:04:12 EDT 2015
Bootloader             L1TC000118D0
Status: RESOLVED → VERIFIED
QA Whiteboard: [MGSEI-Triage+]
You need to log in before you can comment on or make changes to this bug.