Closed Bug 1194063 Opened 4 years ago Closed 4 years ago

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


(Core :: DOM: Selection, defect)

Not set



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


(Reporter: TYLin, Assigned: TYLin)


(Blocks 1 open bug)



(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.

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.
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.