Closed Bug 2029505 Opened 4 months ago Closed 3 months ago

GBoard gestures (cursor control/swipe-to-delete) fail to work on DuckDuckGo search input in Firefox for Android

Categories

(GeckoView :: IME, defect)

Firefox 151
All
Android
defect

Tracking

(firefox150 fixed, firefox151 verified, firefox152 verified)

VERIFIED FIXED
152 Branch
Tracking Status
firefox150 --- fixed
firefox151 --- verified
firefox152 --- verified

People

(Reporter: gabeweb, Assigned: emilio)

References

(Regression)

Details

(Keywords: regression, webcompat:platform-bug)

User Story

user-impact-score:300

Attachments

(3 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0

Steps to reproduce:

I am experiencing an issue where GBoard's advanced input features (glide typing, spacebar cursor control, and backspace swipe-to-delete) are non-functional specifically within the DuckDuckGo search box.

Steps to reproduce:

  1. Open Firefox for Android.
  2. Navigate to duckduckgo.com.
  3. Tap on the search input field.
  4. Try to use GBoard gestures (e.g., sliding the finger over the spacebar to move the cursor or the backspace to swipe-to-delete gesture).

Actual results:

The gestures are ignored. The cursor remains static, and swipe-to-delete does not trigger.

Expected results:

GBoard should handle the input connection correctly, allowing for standard gesture-based text manipulation as it does in other Gecko-based browsers (like Midori) or Chromium-based browsers.

Additional Information:

  • Tested with: Enhanced Tracking Protection OFF, uBlock Origin OFF.
  • Environment: (Xiaomi) Redmi Note 13 4G; Android 15 (AQ3A.240829.003)/Xiaomi HyperOS 2.0.210.0.VNGMIXM.

Note: The issue seems specific to the interaction between current GeckoView and DDG’s input implementation.

Video: https://www.reddit.com/r/firefox/comments/1sda299/gboard_gestures_not_working_specifically_on/

I cannot reproduce this with Pixel 8a + the latest GBoard (us layout). Could you reproduce this on www.google.com too?

Also, if using swipe gesture (don't release finger) on GBoard's keyboard, is all text selected?

Flags: needinfo?(gabeweb)

(In reply to Makoto Kato [:m_kato] from comment #1)

I cannot reproduce this with Pixel 8a + the latest GBoard (us layout). Could you reproduce this on www.google.com too?

Also, if using swipe gesture (don't release finger) on GBoard's keyboard, is all text selected?

Hi. No, it only happens on DuckDuckGo.

​On the DuckDuckGo front page, keyboard gestures work fine. However, when trying to use the search box from the results page, the gestures don't work, except for the first few seconds before the page finishes loading.

​The same behavior is present in other keyboards, such as Microsoft SwiftKey.

Flags: needinfo?(gabeweb)
Keywords: regression
Regressed by: 2016280
Duplicate of this bug: 2031068

:emilio, since you are the author of the regressor, bug 2016280, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

Flags: needinfo?(emilio)

(In reply to Makoto Kato [:m_kato] from comment #3)

Ah, this issue occurs on search result page only, not top page. (ex. https://duckduckgo.com/?ia=web&origin=funnel_home_google&t=hp&q=sample)

According to mozregression, regression range is https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=e835d0f9fea4b05436e5f3be55c9c4e31a82f377&tochange=a810895a0020d2d6be3ccf63452b8808a0d020a4

Hi. Yes, the issue occurs in search results. Additionally, when using suggestions, autocompleted words get piled up, forcing you to select the entire element to edit it manually instead of using keyboard gestures.

Makoto do you know how are these actions communicated to Gecko?

Flags: needinfo?(m_kato)
Blocks: 2032689

(In reply to Emilio Cobos Álvarez [:emilio] from comment #7)

Makoto do you know how are these actions communicated to Gecko?

C++ side is called as IME_REPLACE_TEXT: aStart=0, aEnd=2, aText="", mIMERanges=0, mIMEKeyEvents=0 in https://searchfox.org/firefox-main/rev/dab03896ede1413be148884e054b311767bcf1a0/widget/android/GeckoEditableSupport.cpp#876-877. GeckoView sets the selection on content process by https://searchfox.org/firefox-main/rev/dab03896ede1413be148884e054b311767bcf1a0/widget/android/GeckoEditableSupport.cpp#943-948, but selection isn't updated.

Flags: needinfo?(m_kato)

Also, finally mSelection->SetBaseAndExtentInLimiter is called by ContentEventHandler::OnSelectionEvent.

https://searchfox.org/firefox-main/rev/dab03896ede1413be148884e054b311767bcf1a0/dom/base/Selection.cpp#4277 is false. So I guess that root cause is ConvertFlatTextOffsetToUnsafeDOMRange or SetBaseAndExtentInLimiter (for shadow DOM).

I don't understand yet, do you mean that the range passed to SetBaseAndExtentInLimiter is bad? If so, could you comment which nodes and offsets are passed to the method?

(Currently, TextEditor works only with a Text. Therefore, we could make ContentEventHandler simpler for <input> and <textarea>. If mRootElement is the anonymous <div>.)

MOZ_LOG=SelectionAPI:3,sync might help you.

Flags: needinfo?(m_kato)

I don't understand why this issue occurs on Duck Duck Go's search result page yet. It uses input element (<input id="search_form_input" ...>).

Widget side uses WidgetSelectionEvent to set selection, then ContentEventHandler::OnSelectionEvent to handle this. It uses SetBaseAndExtentInLimiter, but since HasSameRootOrSameComposedDoc is false, SetBaseAndExtentInLimiter returns without error.

Flags: needinfo?(m_kato)
User Story: (updated)

GetSelectionAndRoot might return old selection? Editor might be re-created by reflow or something?

This smells a bit like bug 2014481 fwiw.

See Also: → 2014481

Indeed the example in that bug also reproduces this issue.

Flags: needinfo?(emilio)
Flags: needinfo?(emilio)

The selection controller might be recreated without editor recreation
itself. This could already realistically happen before bug 2016280 as
far as I can tell.

Assignee: nobody → emilio
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

So the main difference is that before bug 2016280 the whole editor got torn down and up again (the anonymous content got recreated) and now it doesn't. I have a patch that fixes it, but I don't know what the best way to test this is. Makoto, could you point me at some tests that I could crib from? Something like the test-case from bug 2014481 but with these IME actions should work afaict.

Flags: needinfo?(emilio) → needinfo?(m_kato)

Ok, I found nsIDOMWindowUtils.sendSelectionSetEvent and came up with a test-case that fails before my patch and works with it.

Flags: needinfo?(m_kato)

Can this be uplifted to Firefox 150?

Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 152 Branch

firefox-beta Uplift Approval Request

  • User impact if declined/Reason for urgency: comment 0
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: yes
  • Steps to reproduce for manual QE testing: comment 0
  • Risk associated with taking this patch: low
  • Explanation of risk level: targetted fix.
  • String changes made/needed?: none
  • Is Android affected?: yes
Attachment #9572666 - Flags: approval-mozilla-beta?
Flags: qe-verify+

The selection controller might be recreated without editor recreation
itself. This could already realistically happen before bug 2016280 as
far as I can tell.

Original Revision: https://phabricator.services.mozilla.com/D295508

firefox-release Uplift Approval Request

  • User impact if declined/Reason for urgency: comment 0
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: yes
  • Steps to reproduce for manual QE testing: comment 0
  • Risk associated with taking this patch: low
  • Explanation of risk level: targetted fix.
  • String changes made/needed?: none
  • Is Android affected?: yes
Attachment #9572667 - Flags: approval-mozilla-release?

The selection controller might be recreated without editor recreation
itself. This could already realistically happen before bug 2016280 as
far as I can tell.

Original Revision: https://phabricator.services.mozilla.com/D295508

Set release status flags based on info from the regressing bug 2016280

Attachment #9572666 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Flags: in-testsuite+
Attachment #9572667 - Flags: approval-mozilla-release? → approval-mozilla-release+

Verified as fixed on the latest Nightly 152.0a1 and on the latest Beta (151.0b2) builds.

The GBoard handles the input connection correctly, allowing for standard gesture-based text manipulation.

Devices used:

  • Samsung Galaxy S25 Ultra (Android 16);
  • Xiaomi Mi11 Lite (Android 11).
Status: RESOLVED → VERIFIED
Duplicate of this bug: 2023328
Duplicate of this bug: 2035029
Duplicate of this bug: 2032689

Hey Donal, could you please clarify why this bug is set as fixed for release (v150), but bug 2023328 is not? If it's indeed fixed in release, which version will (doed) include the fix?

Flags: needinfo?(dmeehan)

Fenix 150.0.1 released today and includes the fix tracked here

Flags: needinfo?(dmeehan)

Thank you!

No longer duplicate of this bug: 2032689
Duplicate of this bug: 2036209
Duplicate of this bug: 2029605
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: