Closed Bug 1194063 Opened 4 years ago Closed 4 years ago

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

Categories

(Core :: DOM: Selection, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
FxOS-S5 (21Aug)
Tracking Status
firefox43 --- fixed
b2g-master --- fixed

People

(Reporter: TYLin, Assigned: TYLin)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

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
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)
Attachment #8649093 - Flags: review?(mtseng) → review+
Attachment #8649095 - Flags: review?(mtseng) → review+
Leave-open for Gaia patch.
Keywords: leave-open
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.
Master: https://github.com/mozilla-b2g/gaia/commit/05b4ddbc7ee7747bd754da715c5f42a146976d4d
Status: NEW → RESOLVED
Closed: 4 years ago
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.