From 3442eee048b67b78ba93b502570b1d2fa119f841 Mon Sep 17 00:00:00 2001 From: Jim Chen Date: Fri, 1 Jun 2018 13:39:20 -0400 Subject: [PATCH] Bug 1463576 - 2. Add test-only geckoview.selection_action.show_on_focus pref; r=jchen Add the "geckoview.selection_action.show_on_focus" pref for testing only. The pref makes us show selection actions when the selection is initially collapsed in an editor, which makes it easier to test behavior for collapsed selections. MozReview-Commit-ID: 3U6UfzokHaI --HG-- extra : rebase_source : fa99dc24e50e09a905664e70ebc34b0ad219dfff --- .../chrome/geckoview/GeckoViewSelectionActionContent.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mobile/android/chrome/geckoview/GeckoViewSelectionActionContent.js b/mobile/android/chrome/geckoview/GeckoViewSelectionActionContent.js index 744812372b48..88f0c481a0bb 100644 --- a/mobile/android/chrome/geckoview/GeckoViewSelectionActionContent.js +++ b/mobile/android/chrome/geckoview/GeckoViewSelectionActionContent.js @@ -146,7 +146,9 @@ class GeckoViewSelectionActionContent extends GeckoViewContentModule { } else if (aEvent.selectionEditable && aEvent.collapsed && reason !== "longpressonemptycontent" && - reason !== "taponcaret") { + reason !== "taponcaret" && + !Services.prefs.getBoolPref( + "geckoview.selection_action.show_on_focus", false)) { // Don't show selection actions when merely focusing on an editor or // repositioning the cursor. Wait until long press or the caret is tapped // in order to match Android behavior. @@ -205,10 +207,12 @@ class GeckoViewSelectionActionContent extends GeckoViewContentModule { onSuccess: response => { if (response.seqNo !== this._seqNo) { // Stale action. + warn `Stale response ${response.id}`; return; } let action = actions.find(action => action.id === response.id); if (action) { + debug `Performing ${response.id}`; action.perform.call(this, aEvent, response); } else { warn `Invalid action ${response.id}`;