Closed
Bug 1152172
Opened 9 years ago
Closed 9 years ago
[Text Selection] Left caret disappeared in view email
Categories
(Firefox OS Graveyard :: Gaia::E-Mail, defect)
Tracking
(blocking-b2g:2.2+, b2g-v2.2 fixed, b2g-master fixed)
People
(Reporter: twen, Assigned: jrburke)
References
Details
Attachments
(5 files)
49.67 KB,
image/png
|
Details | |
74.12 KB,
image/png
|
Details | |
1021 bytes,
patch
|
Details | Diff | Splinter Review | |
46 bytes,
text/x-github-pull-request
|
asuth
:
review+
bajaj
:
approval-gaia-v2.2+
|
Details | Review |
54.72 KB,
image/png
|
Details |
### STR 0. Prerequisite: Set up an email account. 1. Open email app. 2. Tap to open an email 3. Long press on the text to bring out copy/paste selection menu. 4. Tap select all icon ### Actual Selection only has right caret. ### Expected Selection with both carets. ### Version Gaia-Rev 485322797a069e5b185931e87d15d4e921e25b64 Gecko-Rev https://hg.mozilla.org/releases/mozilla-b2g37_v2_2/rev/f766e5052b39 Build-ID 20150406162505 Version 37.0 Device-Name flame FW-Release 4.4.2 FW-Incremental eng.cltbld.20150406.200227 FW-Date Mon Apr 6 20:02:39 EDT 2015 Bootloader L1TC000118D0
Reporter | ||
Comment 1•9 years ago
|
||
Mark blocking 2.2 because feature broken.
Comment 2•9 years ago
|
||
Ting-Yu, please help to check where is the left caret.
Flags: needinfo?(tlin)
Updated•9 years ago
|
Flags: needinfo?(tlin)
Comment 3•9 years ago
|
||
After reproducing this issue by the steps in description, I set "left: 32em" to the div with id="cardContainer" in WebIDE, and see the left caret as in attached screenshot.
Comment 4•9 years ago
|
||
Hi Andrew, can you help to check why this happens like the picture in Comment 3 ? And is this something email app can fix? Thanks.
Flags: needinfo?(bugmail)
Comment 5•9 years ago
|
||
It seems like the selection logic is choosing a weird root common element for select all. What text is being long pressed on to trigger the select all?
Flags: needinfo?(twen)
Reporter | ||
Comment 6•9 years ago
|
||
In the example of the screenshot, I long pressed the message "b14285331236035016" and tapped select all.
Flags: needinfo?(twen)
Comment 7•9 years ago
|
||
I found that after select all, the range would be divided by 3 ranges by nsRange::ExcludeNonSelectableNodes. Second and third range is text of subject and content. That's ok. The problem is first range. The first range contains an input which is search bar of mail. But the content of input has independent selection which means input or textarea should be excluded. So I write a patch which ignores content with independent selection. Does it make any sense?
Comment 8•9 years ago
|
||
Attachment #8591513 -
Flags: review?(mats)
Updated•9 years ago
|
Assignee: nobody → mtseng
Status: NEW → ASSIGNED
Comment 9•9 years ago
|
||
I think in general the behaviour of "select all" isn't particularly useful outside of input fields, so this is a somewhat odd issue. I've tried to start a discussion on that at https://groups.google.com/forum/#!topic/mozilla.dev.gaia/3tBQxCN5INQ. But for this bug, it seems like: - There may be a bug in the selection code, and :mtseng's patch may address that - But fixing that bug doesn't actually fix the flaw in email, which is that email's marking elements as selectable is not impacted by whether they are on an (in)active card. However, fixing that bug may hide the only instance of this being a problem in the email app since we have a very limited set of cases we mark things as selectable and most of the time the only sane things to try and select are the contents of input elements. Probably the least horrible selector strategy is to leave the "* { -moz-user-select: none; }" as our one horrible wildcard selector. And then in the cases where we re-enable selection, we do it by prepending a ".center" descendant selector to the existing selector. So ".tng-signature-text { -moz-user-select: text; }" becomes ".center .tng-signature-text { -moz-user-select: text; }". Alternately we could do ".before *, .after * { -moz-user-select: none !important; }" (or further increase the specificity), but I worry about the cost of that selector. Adding a needinfo to :jrburke for his thoughts on altering our scoping strategy to activate selection.
Flags: needinfo?(bugmail) → needinfo?(jrburke)
Comment 10•9 years ago
|
||
I think "-ms-user-select:element" behavior in IE would help in this case. See this [1]. Basically, this css attribute will bound selection range to element. So we don't select entire document if we select all. Unfortunatelly, we don't support it yet. [1]: http://blogs.msdn.com/b/ie/archive/2012/01/11/controlling-selection-with-css-user-select.aspx
Comment 11•9 years ago
|
||
Comment on attachment 8591513 [details] [diff] [review] Ignore content with independent selection when excluding non-selectable nodes. My gut feeling is that this is wrong, but I haven't looked in detail yet. I'd like to understand the problem better. Can you make a small testcase that demonstrates the problem? I gather from the comments that there is an <input> in some "hidden" place that is selectable and thus affects the Selection range, but that seems like the correct behavior to me.
Comment 12•9 years ago
|
||
Why do "inactive cards" have CSS boxes at all? It seems better if they had display:none which would avoid this problem (and would be better for performance, memory footprint etc).
Assignee | ||
Comment 13•9 years ago
|
||
:asuth - As to the email doing a .center scoped selector, that makes sense, and I will work up an email patch just to have it available, just in case that ends up being the fix. Hopefully just adding the .center is enough and not the extra !important ones for .before and .after. :mats - on the question about inactive cards not using display:none in the DOM: we can have some cards that overlap or show together on a screen, so we cannot do that as a generic solution, and so I think we would still need the scoped css selector fix. I am also a bit concerned if there is a perf hit for turning off display none just before triggering a css transform animation between cards. Our DOM structures are normally not very deep either. However, it is definitely worth it for me to do an experiment around using display: none with options to not do it for overlapping cases. I will take that as a research item to try longer term for email, and for this bug, for an email-targeted fix, do the more targeted .center CSS selection.
Flags: needinfo?(jrburke)
Comment 14•9 years ago
|
||
Comment 15•9 years ago
|
||
(In reply to James Burke [:jrburke] from comment #13) > I am also a bit concerned if there is a perf hit for turning off display > none just before triggering a css transform animation between cards. I just want to second this concern. It may sound superstitious, but it's been difficult to keep the card transition animations working. And a bigger complication for us now is that since we no longer develop on devices that will ship, only on Flame, "it works on Flame" isn't really confidence-building. (Unless we know that all the devices shipping are as/more-powerful than Flame with APZ cranked up to the same levels, etc., which I don't think is the case.)
Assignee | ||
Comment 16•9 years ago
|
||
Autolander added the pull request that has the gaia/email change to scope the text selection to .center active cards. This screenshot shows what it looks like with that patch applied. Note that the title ends up selected, because of the text selection CSS behavior described in comment 9, so I do not believe the email app can control that behavior given the set of CSS properties we have available. The left caret is visible though with this change. I will hold off on asking for review until there is more consensus that this should be the way to fix the issue for now.
Comment 17•9 years ago
|
||
Comment on attachment 8591929 [details] [review] [gaia] jrburke:bug1152172-email-select-all > mozilla-b2g:master This looks good to me, and I suspect we're going to need it, so speculatively r+'ing.
Attachment #8591929 -
Flags: review+
Comment 18•9 years ago
|
||
Assigned to James since him provided a workable gaia patch. I'll create a follow-up bug for gecko part once I finish the small testcase which Mats ask for.
Assignee: mtseng → jrburke
Updated•9 years ago
|
Attachment #8591513 -
Flags: review?(mats)
Assignee | ||
Comment 19•9 years ago
|
||
Merged in gaia master: https://github.com/mozilla-b2g/gaia/commit/4ba5ce17a076d8d585d73de7c6955fa329bc73cc Manually merged given the component does not match, although in retrospect I should have switched that to gaia email component and will do that now
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Component: Selection → Gaia::E-Mail
Product: Core → Firefox OS
Resolution: --- → FIXED
Assignee | ||
Comment 20•9 years ago
|
||
Comment on attachment 8591929 [details] [review] [gaia] jrburke:bug1152172-email-select-all > mozilla-b2g:master [Approval Request Comment] Asking for 2.2 inclusion since I believe text selection is part of the 2.2 release, this was flagged as blocking-b2g: 2.2? and the fix is very simple. [Bug caused by] (feature/regressing bug #): The main text selection work done for email in bug 1092440. [User impact] if declined: Select all text when done on a text email body will not get what is expected. [Testing completed]: On flame device, see screenshot in comment 9. [Risk to taking this patch] (and alternatives if risky): Super low. Just a more specific CSS selector than what was used before, and since the more specific part is to scope it just to the visible card, should be very safe. [String changes made]: none
Attachment #8591929 -
Flags: approval-gaia-v2.2?
Updated•9 years ago
|
Attachment #8591929 -
Flags: approval-gaia-v2.2? → approval-gaia-v2.2+
Comment 21•9 years ago
|
||
v2.2: https://github.com/mozilla-b2g/gaia/commit/a9b348807256f765d8a6189d67bfb3d1bbe40a7a
Updated•9 years ago
|
blocking-b2g: 2.2? → 2.2+
Reporter | ||
Comment 22•9 years ago
|
||
Verified fixed on v2.2. Verification on v3.0 is blocked by bug 1154604. v2.2 Gaia-Rev 16e948bfaaa15dbc0200135d52f16257b4eab193 Gecko-Rev https://hg.mozilla.org/releases/mozilla-b2g37_v2_2/rev/0eec28e78eb1 Build-ID 20150414162502 Version 37.0 Device-Name hammerhead FW-Release 5.1 FW-Incremental eng.cltbld.20150414.201650 FW-Date Tue Apr 14 20:17:04 EDT 2015 Bootloader HHZ12d
Reporter | ||
Comment 23•9 years ago
|
||
Verified fixed on v3.0. Gaia-Rev 777d01f4a2c7b41c4b02e3cf87715714ccc0590b Gecko-Rev https://hg.mozilla.org/mozilla-central/rev/53ceefb0e1c8 Build-ID 20150415160205 Version 40.0a1 Device-Name hammerhead FW-Release 5.1 FW-Incremental eng.cltbld.20150415.192113 FW-Date Wed Apr 15 19:21:33 EDT 2015 Bootloader HHZ12d
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•