Text selection dialog does not disappear after 3 seconds on an empty input

RESOLVED FIXED in Firefox 43, Firefox OS master

Status

()

Core
Selection
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: TYLin, Assigned: TYLin)

Tracking

(Blocks: 2 bugs)

Trunk
FxOS-S5 (21Aug)
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox43 fixed, b2g-master fixed)

Details

Attachments

(3 attachments)

Steps to reproduce:

1. Copy some text.
2. Focus on an empty input.
3. The text selection dialog shows with a paste icon.

Actual results:
The dialog does not disappear after 3 seconds.

Expected results:
The dialog should disappear after 3 seconds timeout like it did on non-empty input.
Gaia has a bug that it triggers shortcut timeout in line 181, and cancel the timer in the first line of show() [1]. This causes issue when focusing on an empty input since currently gecko does not send another caretStateChange event after 3 seconds timeout.

Swapping line 181 and 182 should fix this bug. However, I'm thinking about another approach that gecko should send caretStateChange event after 3 seconds timeout on a collapsed selection whether the caret is actually visible to the user or not. In this way, Gaia could completely get rid of the shortcut timeout timer, and Gceko could maintain a consistent state that the first caret has Appearance::None in cursor mode after 3 seconds timeout.

[1] https://github.com/mozilla-b2g/gaia/blob/474784fc494519a0fab866407c0215aacf984ed9/apps/system/js/app_text_selection_dialog.js#L181-L182
Created attachment 8649093 [details] [diff] [review]
Always launch caret timer in cursor mode. (v1)

If the timer is not launched when the content is empty, the first caret
will always has Appearance::NormalNotShown, which is not consistent with
the behavior when the caret is shown when the content is not empty.

After this patch, Gaia will always receive an update event after 3
seconds timeout. Hence fixed a bug that the shortcut text dialog does
not hide after 3 seconds timeout.
Attachment #8649093 - Flags: review?(mtseng)
Created attachment 8649095 [details] [diff] [review]
Update link to point to the diagram directly. (v1)
Attachment #8649095 - Flags: review?(mtseng)
Attachment #8649093 - Flags: review?(mtseng) → review+
Attachment #8649095 - Flags: review?(mtseng) → review+
Leave-open for Gaia patch.
Keywords: leave-open
Created attachment 8649280 [details] [review]
[gaia] aethanyc:1194063 > mozilla-b2g:master
Attachment #8649280 - Flags: review?(timdream)
Attachment #8649280 - Flags: review?(timdream) → review+
Morris & Tim, thank you for the review.

Please check in the Gaia patch. Thanks.
Keywords: leave-open → checkin-needed
Master: https://github.com/mozilla-b2g/gaia/commit/05b4ddbc7ee7747bd754da715c5f42a146976d4d
Status: NEW → RESOLVED
Last Resolved: 3 years ago
status-b2g-master: --- → fixed
status-firefox43: affected → fixed
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → FxOS-S5 (21Aug)
You need to log in before you can comment on or make changes to this bug.