Dynamic toolbar should not hide when page is not scrollable
Categories
(GeckoView :: General, defect, P1)
Tracking
(firefox75 fixed)
Tracking | Status | |
---|---|---|
firefox75 | --- | fixed |
People
(Reporter: agi, Assigned: snorp)
References
Details
(Whiteboard: [geckoview:m75])
Attachments
(3 files)
Elements with height: 100% don't include the dynamic toolbar. To reproduce load testcase in Fenix Nightly and scroll down so that the dynamic toolbar disappear, observe that the grey overlay doesn't cover the bottom part of the screen.
Reporter | ||
Comment 1•5 years ago
|
||
Assignee | ||
Comment 2•5 years ago
|
||
I think this just boils down to Fenix should not be hiding the toolbar when a page is not scrollable. I'm not sure if they even have a way of figuring that out right now. Hiro, does this sound right to you? Otherwise, the height difference would be according to spec, no?
Updated•5 years ago
|
Assignee | ||
Comment 3•5 years ago
|
||
Botond, I think I expected us to be able to handle this by PanZoomController.onTouchEventForResult
returning UNHANDLED
[1], but we never seem to get that when APZ isn't actually scrolling. Is this broken, or did we never get that working, or what?
Comment 4•5 years ago
|
||
Comment 5•5 years ago
|
||
(The return statement at the bottom of the function is the one that would need adjusting, not the one I linked directly to)
Comment 6•5 years ago
|
||
(In reply to James Willcox (:snorp) (jwillcox@mozilla.com) (he/him) from comment #2)
I think this just boils down to Fenix should not be hiding the toolbar when a page is not scrollable. I'm not sure if they even have a way of figuring that out right now. Hiro, does this sound right to you? Otherwise, the height difference would be according to spec, no?
Right, Fenix should not move the toolbar. IIRC, there is an API to tell whether the content is scrollable or not. I will find it out. Maybe the API returns a wrong value in this case. Keeping NI to me.
Assignee | ||
Comment 7•5 years ago
|
||
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #5)
(The return statement at the bottom of the function is the one that would need adjusting, not the one I linked directly to)
Oh, hmm. Yeah, that looks wrong. I've modified it to do this instead, which seems more correct:
if (result.mHitRegionWithApzAwareListeners) {
return INPUT_RESULT_HANDLED_CONTENT;
}
switch (result.mStatus) {
case nsEventStatus_eIgnore:
return INPUT_RESULT_UNHANDLED;
case nsEventStatus_eConsumeDoDefault:
return INPUT_RESULT_HANDLED;
default:
MOZ_ASSERT_UNREACHABLE("Unexpected nsEventStatus");
}
If we return UNHANDLED
in that case, the current GeckoView.onTouchEvent()
[1] code will then return false
. That means we won't get any more events for that touch, breaking things like text selection, button clicks, etc. I guess we could just always return true
?
Fenix should then be able to assume that UNHANDLED
(via onTouchEventForResult
[1]) on a touch down event means non-scrollable and could then show the toolbar. I think for simplicity, they should just keep it pinned for the lifetime of that page.
[1] https://searchfox.org/mozilla-central/source/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoView.java#735
[2] https://searchfox.org/mozilla-central/source/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoView.java#746
Comment 8•5 years ago
|
||
(In reply to James Willcox (:snorp) (jwillcox@mozilla.com) (he/him) from comment #7)
Oh, hmm. Yeah, that looks wrong. I've modified it to do this instead, which seems more correct:
Yeah your edit seems more correct.
If we return
UNHANDLED
in that case, the currentGeckoView.onTouchEvent()
[1] code will then returnfalse
. That means we won't get any more events for that touch, breaking things like text selection, button clicks, etc. I guess we could just always returntrue
?
Hm, I'm not sure what the exact semantics of returning true/false from View.onTouchEvent is. What about the scenario where the embedding application has a small GeckoView instance embedded inside a larger scrolling thing. And let's say the content inside the GV is non-scrollable, and the user starts a pan gesture by putting their finger down on the GV and dragging. My guess is that if you always return true
the GV will "consume" the event and so the "larger scrolling thing" that the GV is embedded inside will not scroll, even though the user might expect it to. Whereas if you returned false it would behave as expected?
At any rate, the current code will be returning true in that scenario anyway so it won't be a regression. /me shrugs
Fenix should then be able to assume that
UNHANDLED
(viaonTouchEventForResult
[1]) on a touch down event means non-scrollable and could then show the toolbar. I think for simplicity, they should just keep it pinned for the lifetime of that page.
That seems reasonable.
Updated•5 years ago
|
Assignee | ||
Comment 9•5 years ago
|
||
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #8)
(In reply to James Willcox (:snorp) (jwillcox@mozilla.com) (he/him) from comment #7)
Oh, hmm. Yeah, that looks wrong. I've modified it to do this instead, which seems more correct:
Yeah your edit seems more correct.
If we return
UNHANDLED
in that case, the currentGeckoView.onTouchEvent()
[1] code will then returnfalse
. That means we won't get any more events for that touch, breaking things like text selection, button clicks, etc. I guess we could just always returntrue
?Hm, I'm not sure what the exact semantics of returning true/false from View.onTouchEvent is. What about the scenario where the embedding application has a small GeckoView instance embedded inside a larger scrolling thing. And let's say the content inside the GV is non-scrollable, and the user starts a pan gesture by putting their finger down on the GV and dragging. My guess is that if you always return
true
the GV will "consume" the event and so the "larger scrolling thing" that the GV is embedded inside will not scroll, even though the user might expect it to. Whereas if you returned false it would behave as expected?
For scrolling I don't think the result matters here. There are some containers that do this sort of thing (CoordinatorLayout), but I believe they rely on NestedScrollView
for the children, which we already don't support.
Assignee | ||
Comment 10•5 years ago
|
||
This also makes GeckoView#onTouchEvent()
always return true
, because
returning false
will cause us to not receive any more events for that
touch. We always want to receive events.
Updated•5 years ago
|
Comment 11•5 years ago
|
||
Updated•5 years ago
|
Comment 12•5 years ago
|
||
bugherder |
Comment 13•5 years ago
|
||
Adding a link to the comment by snorp Fenix needs to do something for this issue.
Comment 15•2 years ago
|
||
Moving toolbar bugs to the new GeckoView::Toolbar component.
Updated•5 months ago
|
Description
•