PTAL - I still have to figure out ways to test this... sharing this as an early concept.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
void setPeekHeight(int peekHeight) {Where is this suppose to be used?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Where do we determine if this is a scroll event? We still need taps to propagate through to the web contents right?
Where do we determine if this is a scroll event? We still need taps to propagate through to the web contents right?
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
Where is this suppose to be used?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
Wenyu FuWhere do we determine if this is a scroll event? We still need taps to propagate through to the web contents right?
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
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
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.
```
[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
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |