[TabBottomSheet] Implement synchronous gesture zone touch arbitration [chromium/src : main]

0 views
Skip to first unread message

Wenyu Fu (Gerrit)

unread,
Mar 28, 2026, 9:39:09 PM (8 days ago) Mar 28
to Hailey Wang, David Trainor, Hitarth Kothari, Jerome Jiang, Mirko Bonadei, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, titoua...@chromium.org, devtools...@chromium.org, browser-comp...@chromium.org, mar...@chromium.org, eme-r...@chromium.org, jz...@chromium.org, cblume...@chromium.org, penghuan...@chromium.org, ortuno...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, oshima...@chromium.org, chrome-intelligence-te...@google.com, fgal...@chromium.org, chrome-intell...@chromium.org
Attention needed from David Trainor and Hailey Wang

Wenyu Fu added 1 comment

Patchset-level comments
File-level comment, Patchset 17:
Wenyu Fu . resolved

PTAL - I still have to figure out ways to test this... sharing this as an early concept.

Open in Gerrit

Related details

Attention is currently required from:
  • David Trainor
  • Hailey Wang
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ib1de44df33d5c7a06be3f633f098a3659d913d1c
Gerrit-Change-Number: 7665057
Gerrit-PatchSet: 21
Gerrit-Owner: Wenyu Fu <wen...@chromium.org>
Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
Gerrit-Reviewer: Hailey Wang <haile...@google.com>
Gerrit-Reviewer: Wenyu Fu <wen...@chromium.org>
Gerrit-CC: Hitarth Kothari <hitarth...@google.com>
Gerrit-CC: Jerome Jiang <ji...@chromium.org>
Gerrit-CC: Mirko Bonadei <mbon...@chromium.org>
Gerrit-Attention: Hailey Wang <haile...@google.com>
Gerrit-Attention: David Trainor <dtra...@chromium.org>
Gerrit-Comment-Date: Sun, 29 Mar 2026 01:38:29 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Hailey Wang (Gerrit)

unread,
Mar 30, 2026, 3:10:13 PM (6 days ago) Mar 30
to Wenyu Fu, David Trainor, Hitarth Kothari, Jerome Jiang, Mirko Bonadei, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, titoua...@chromium.org, devtools...@chromium.org, browser-comp...@chromium.org, mar...@chromium.org, eme-r...@chromium.org, jz...@chromium.org, cblume...@chromium.org, penghuan...@chromium.org, ortuno...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, oshima...@chromium.org, chrome-intelligence-te...@google.com, fgal...@chromium.org, chrome-intell...@chromium.org
Attention needed from David Trainor and Wenyu Fu

Hailey Wang voted and added 1 comment

Votes added by Hailey Wang

Code-Review+1

1 comment

File chrome/browser/context_sharing/tab_bottom_sheet/android/java/src/org/chromium/chrome/browser/tab_bottom_sheet/TabBottomSheetMediator.java
Line 37, Patchset 21 (Latest): void setPeekHeight(int peekHeight) {
Hailey Wang . unresolved

Where is this suppose to be used?

Open in Gerrit

Related details

Attention is currently required from:
  • David Trainor
  • Wenyu Fu
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ib1de44df33d5c7a06be3f633f098a3659d913d1c
Gerrit-Change-Number: 7665057
Gerrit-PatchSet: 21
Gerrit-Owner: Wenyu Fu <wen...@chromium.org>
Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
Gerrit-Reviewer: Hailey Wang <haile...@google.com>
Gerrit-Reviewer: Wenyu Fu <wen...@chromium.org>
Gerrit-CC: Hitarth Kothari <hitarth...@google.com>
Gerrit-CC: Jerome Jiang <ji...@chromium.org>
Gerrit-CC: Mirko Bonadei <mbon...@chromium.org>
Gerrit-Attention: David Trainor <dtra...@chromium.org>
Gerrit-Attention: Wenyu Fu <wen...@chromium.org>
Gerrit-Comment-Date: Mon, 30 Mar 2026 19:10:02 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

David Trainor (Gerrit)

unread,
Mar 31, 2026, 5:05:54 PM (5 days ago) Mar 31
to Wenyu Fu, Hailey Wang, Hitarth Kothari, Jerome Jiang, Mirko Bonadei, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, titoua...@chromium.org, devtools...@chromium.org, browser-comp...@chromium.org, mar...@chromium.org, eme-r...@chromium.org, jz...@chromium.org, cblume...@chromium.org, penghuan...@chromium.org, ortuno...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, oshima...@chromium.org, chrome-intelligence-te...@google.com, fgal...@chromium.org, chrome-intell...@chromium.org
Attention needed from Wenyu Fu

David Trainor added 1 comment

Patchset-level comments
File-level comment, Patchset 21 (Latest):
David Trainor . resolved

Where do we determine if this is a scroll event? We still need taps to propagate through to the web contents right?

Open in Gerrit

Related details

Attention is currently required from:
  • Wenyu Fu
Gerrit-Attention: Wenyu Fu <wen...@chromium.org>
Gerrit-Comment-Date: Tue, 31 Mar 2026 21:05:44 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Wenyu Fu (Gerrit)

unread,
Mar 31, 2026, 7:00:18 PM (5 days ago) Mar 31
to Hailey Wang, David Trainor, Hitarth Kothari, Jerome Jiang, Mirko Bonadei, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, titoua...@chromium.org, devtools...@chromium.org, browser-comp...@chromium.org, mar...@chromium.org, eme-r...@chromium.org, jz...@chromium.org, cblume...@chromium.org, penghuan...@chromium.org, ortuno...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, oshima...@chromium.org, chrome-intelligence-te...@google.com, fgal...@chromium.org, chrome-intell...@chromium.org
Attention needed from David Trainor and Hailey Wang

Wenyu Fu added 2 comments

Patchset-level comments
File-level comment, Patchset 21:
David Trainor . unresolved

Where do we determine if this is a scroll event? We still need taps to propagate through to the web contents right?

Wenyu Fu

We are just using the original Android's gesture mechanism to determine if it is scroll events. Even after this CL, the web content will still receive the taps, respecting the Android gesture event dispatching ordering.

[requestDisallowInterceptTouchEvent(true)](https://developer.android.com/reference/android/view/ViewGroup?_gl=1*gdnm8q*_up*MQ..*_ga*MjcxMjgzMDU0LjE3NzQ5OTY1NzQ.*_ga_6HH9YJMN9M*czE3NzQ5OTY1NzMkbzEkZzAkdDE3NzQ5OTY1NzMkajYwJGwwJGgxODI1MzkxODQ4#requestDisallowInterceptTouchEvent(boolean)) is a mechanism to disable gesture event to bubble up to its parent; we change it during the initial ACTION_DOWN, which basically tells the BottomSheet.java do not keep intercepting scroll events.

Calling `requestDisallowInterceptTouchEvent` resets the flag to the default state, so it will not skipping passing the signal to the web content, it's just allowing the parent view to resume intercept touch events

File chrome/browser/context_sharing/tab_bottom_sheet/android/java/src/org/chromium/chrome/browser/tab_bottom_sheet/TabBottomSheetMediator.java
Line 37, Patchset 21: void setPeekHeight(int peekHeight) {
Hailey Wang . resolved

Where is this suppose to be used?

Wenyu Fu

Oops

Open in Gerrit

Related details

Attention is currently required from:
  • David Trainor
  • Hailey Wang
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ib1de44df33d5c7a06be3f633f098a3659d913d1c
Gerrit-Change-Number: 7665057
Gerrit-PatchSet: 23
Gerrit-Owner: Wenyu Fu <wen...@chromium.org>
Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
Gerrit-Reviewer: Hailey Wang <haile...@google.com>
Gerrit-Reviewer: Wenyu Fu <wen...@chromium.org>
Gerrit-CC: Hitarth Kothari <hitarth...@google.com>
Gerrit-CC: Jerome Jiang <ji...@chromium.org>
Gerrit-CC: Mirko Bonadei <mbon...@chromium.org>
Gerrit-Attention: Hailey Wang <haile...@google.com>
Gerrit-Attention: David Trainor <dtra...@chromium.org>
Gerrit-Comment-Date: Tue, 31 Mar 2026 22:59:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Hailey Wang <haile...@google.com>
Comment-In-Reply-To: David Trainor <dtra...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

David Trainor (Gerrit)

unread,
Apr 1, 2026, 11:03:25 PM (4 days ago) Apr 1
to Wenyu Fu, Hailey Wang, Hitarth Kothari, Jerome Jiang, Mirko Bonadei, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, titoua...@chromium.org, devtools...@chromium.org, browser-comp...@chromium.org, mar...@chromium.org, eme-r...@chromium.org, jz...@chromium.org, cblume...@chromium.org, penghuan...@chromium.org, ortuno...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, oshima...@chromium.org, chrome-intelligence-te...@google.com, fgal...@chromium.org, chrome-intell...@chromium.org
Attention needed from Hailey Wang and Wenyu Fu

David Trainor voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Hailey Wang
  • Wenyu Fu
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ib1de44df33d5c7a06be3f633f098a3659d913d1c
Gerrit-Change-Number: 7665057
Gerrit-PatchSet: 23
Gerrit-Owner: Wenyu Fu <wen...@chromium.org>
Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
Gerrit-Reviewer: Hailey Wang <haile...@google.com>
Gerrit-Reviewer: Wenyu Fu <wen...@chromium.org>
Gerrit-CC: Hitarth Kothari <hitarth...@google.com>
Gerrit-CC: Jerome Jiang <ji...@chromium.org>
Gerrit-CC: Mirko Bonadei <mbon...@chromium.org>
Gerrit-Attention: Hailey Wang <haile...@google.com>
Gerrit-Attention: Wenyu Fu <wen...@chromium.org>
Gerrit-Comment-Date: Thu, 02 Apr 2026 03:03:12 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Hailey Wang (Gerrit)

unread,
Apr 2, 2026, 6:09:08 PM (3 days ago) Apr 2
to Wenyu Fu, David Trainor, Hitarth Kothari, Jerome Jiang, Mirko Bonadei, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, titoua...@chromium.org, devtools...@chromium.org, browser-comp...@chromium.org, mar...@chromium.org, eme-r...@chromium.org, jz...@chromium.org, cblume...@chromium.org, penghuan...@chromium.org, ortuno...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, oshima...@chromium.org, chrome-intelligence-te...@google.com, fgal...@chromium.org, chrome-intell...@chromium.org
Attention needed from Wenyu Fu

Hailey Wang voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Wenyu Fu
Gerrit-Attention: Wenyu Fu <wen...@chromium.org>
Gerrit-Comment-Date: Thu, 02 Apr 2026 22:08:58 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Wenyu Fu (Gerrit)

unread,
Apr 3, 2026, 1:50:55 PM (2 days ago) Apr 3
to Hailey Wang, David Trainor, Hitarth Kothari, Jerome Jiang, Mirko Bonadei, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, titoua...@chromium.org, devtools...@chromium.org, browser-comp...@chromium.org, mar...@chromium.org, eme-r...@chromium.org, jz...@chromium.org, cblume...@chromium.org, penghuan...@chromium.org, ortuno...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, oshima...@chromium.org, chrome-intelligence-te...@google.com, fgal...@chromium.org, chrome-intell...@chromium.org

Wenyu Fu voted and added 1 comment

Votes added by Wenyu Fu

Commit-Queue+2

1 comment

Patchset-level comments
File-level comment, Patchset 21:
David Trainor . resolved

Where do we determine if this is a scroll event? We still need taps to propagate through to the web contents right?

Wenyu Fu

We are just using the original Android's gesture mechanism to determine if it is scroll events. Even after this CL, the web content will still receive the taps, respecting the Android gesture event dispatching ordering.

[requestDisallowInterceptTouchEvent(true)](https://developer.android.com/reference/android/view/ViewGroup?_gl=1*gdnm8q*_up*MQ..*_ga*MjcxMjgzMDU0LjE3NzQ5OTY1NzQ.*_ga_6HH9YJMN9M*czE3NzQ5OTY1NzMkbzEkZzAkdDE3NzQ5OTY1NzMkajYwJGwwJGgxODI1MzkxODQ4#requestDisallowInterceptTouchEvent(boolean)) is a mechanism to disable gesture event to bubble up to its parent; we change it during the initial ACTION_DOWN, which basically tells the BottomSheet.java do not keep intercepting scroll events.

Calling `requestDisallowInterceptTouchEvent` resets the flag to the default state, so it will not skipping passing the signal to the web content, it's just allowing the parent view to resume intercept touch events

Wenyu Fu

Done

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ib1de44df33d5c7a06be3f633f098a3659d913d1c
    Gerrit-Change-Number: 7665057
    Gerrit-PatchSet: 25
    Gerrit-Owner: Wenyu Fu <wen...@chromium.org>
    Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
    Gerrit-Reviewer: Hailey Wang <haile...@google.com>
    Gerrit-Reviewer: Wenyu Fu <wen...@chromium.org>
    Gerrit-CC: Hitarth Kothari <hitarth...@google.com>
    Gerrit-CC: Jerome Jiang <ji...@chromium.org>
    Gerrit-CC: Mirko Bonadei <mbon...@chromium.org>
    Gerrit-Comment-Date: Fri, 03 Apr 2026 17:50:43 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: David Trainor <dtra...@chromium.org>
    Comment-In-Reply-To: Wenyu Fu <wen...@chromium.org>
    satisfied_requirement
    open
    diffy

    Wenyu Fu (Gerrit)

    unread,
    Apr 3, 2026, 2:59:50 PM (2 days ago) Apr 3
    to Hailey Wang, David Trainor, Hitarth Kothari, Jerome Jiang, Mirko Bonadei, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, titoua...@chromium.org, devtools...@chromium.org, browser-comp...@chromium.org, mar...@chromium.org, eme-r...@chromium.org, jz...@chromium.org, cblume...@chromium.org, penghuan...@chromium.org, ortuno...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, oshima...@chromium.org, chrome-intelligence-te...@google.com, fgal...@chromium.org, chrome-intell...@chromium.org

    Wenyu Fu voted Commit-Queue+2

    Commit-Queue+2
    Gerrit-Comment-Date: Fri, 03 Apr 2026 18:59:40 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Chromium LUCI CQ (Gerrit)

    unread,
    Apr 3, 2026, 3:39:21 PM (2 days ago) Apr 3
    to Wenyu Fu, Hailey Wang, David Trainor, Hitarth Kothari, Jerome Jiang, Mirko Bonadei, AyeAye, chromium...@chromium.org, titoua...@chromium.org, devtools...@chromium.org, browser-comp...@chromium.org, mar...@chromium.org, eme-r...@chromium.org, jz...@chromium.org, cblume...@chromium.org, penghuan...@chromium.org, ortuno...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, oshima...@chromium.org, chrome-intelligence-te...@google.com, fgal...@chromium.org, chrome-intell...@chromium.org

    Chromium LUCI CQ submitted the change with unreviewed changes

    Unreviewed changes

    23 is the latest approved patch-set.
    The change was submitted with unreviewed changes in the following files:

    ```
    The name of the file: chrome/browser/context_sharing/tab_bottom_sheet/android/java/src/org/chromium/chrome/browser/tab_bottom_sheet/TabBottomSheetMediator.java
    Insertions: 3, Deletions: 7.

    The diff is too large to show. Please review the diff.
    ```
    ```
    The name of the file: chrome/browser/context_sharing/tab_bottom_sheet/android/java/src/org/chromium/chrome/browser/tab_bottom_sheet/TabBottomSheetMediatorTest.java
    Insertions: 80, Deletions: 24.

    The diff is too large to show. Please review the diff.
    ```

    Change information

    Commit message:
    [TabBottomSheet] Implement synchronous gesture zone touch arbitration

    This patch refactors the TabBottomSheet touch arbitration to use a
    static, layout-bound "Gesture Zone" instead of relying on asynchronous
    signals from a GestureStateListener.

    Previously, scrolling on the TabBottomSheet content was not reliable
    because touches would reach the Java container view before the
    underlying WebContents could interpret them. Attempting to delay
    arbitration by waiting for the web content to report its vertical scroll
    offset created a race condition: it heavily relied on the timing of
    asynchronous gesture state callbacks, leading to janky scrolling or the
    bottom sheet unexpectedly taking over the scroll.

    Furthermore, checking the root element's scroll offset
    (`getContentVerticalScroll`) is flawed for web architectures involving
    nested scrolling elements (where the nested div consumes the scroll
    while root offset remains exactly 0).

    To address this deterministically:
    - We introduce a top-aligned "Gesture Zone", anchored by the bottom sheet's
    dynamically provided peek height (with a 48dp min-touch-target fallback).
    - We intercept all touches synchronously on ACTION_DOWN:
    1. If the sheet is not fully maximized (e.g. running in PEEK state), the
    sheet unconditionally intercepts the touch.
    2. If the sheet is maximized and the touch lands explicitly in the top
    Gesture Zone boundary, the sheet intercepts the touch.
    3. Otherwise, the touch is securely locked to the WebContents and delivered
    manually by preempting parent interception.

    This cleanly guarantees seamless inner-content scrolling, eliminates the
    dependency on `GestureListenerManager` and `WebContents`, and simplifies
    the mediator.

    Demo: https://screencast.googleplex.com/cast/NTYyNDEzMDM0NTg5Mzg4OHw5ODFjNGUzYS1jYw
    Bug: 486917749
    Change-Id: Ib1de44df33d5c7a06be3f633f098a3659d913d1c
    Reviewed-by: Hailey Wang <haile...@google.com>
    Reviewed-by: David Trainor <dtra...@chromium.org>
    Commit-Queue: Wenyu Fu <wen...@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1609908}
    Files:
    • M chrome/browser/context_sharing/tab_bottom_sheet/android/BUILD.gn
    • M chrome/browser/context_sharing/tab_bottom_sheet/android/java/src/org/chromium/chrome/browser/tab_bottom_sheet/TabBottomSheetCoordinator.java
    • M chrome/browser/context_sharing/tab_bottom_sheet/android/java/src/org/chromium/chrome/browser/tab_bottom_sheet/TabBottomSheetMediator.java
    • M chrome/browser/context_sharing/tab_bottom_sheet/android/java/src/org/chromium/chrome/browser/tab_bottom_sheet/TabBottomSheetMediatorTest.java
    • M chrome/browser/context_sharing/tab_bottom_sheet/android/java/src/org/chromium/chrome/browser/tab_bottom_sheet/TabBottomSheetWebUiContainer.java
    Change size: M
    Delta: 5 files changed, 125 insertions(+), 16 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Hailey Wang, +1 by David Trainor
    Open in Gerrit
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: merged
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ib1de44df33d5c7a06be3f633f098a3659d913d1c
    Gerrit-Change-Number: 7665057
    Gerrit-PatchSet: 26
    Gerrit-Owner: Wenyu Fu <wen...@chromium.org>
    Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
    Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
    Gerrit-Reviewer: Hailey Wang <haile...@google.com>
    Gerrit-Reviewer: Wenyu Fu <wen...@chromium.org>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages